Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Manage milestone progress bars #3195

Merged
merged 9 commits into from
Jan 24, 2019
Merged

Conversation

decabeza
Copy link
Collaborator

References

This is a backport of AyuntamientoMadrid#1797

Issue consul#3135

Objectives

Add sections in the administration to handle progress bars for proposals, budget investments and legislation processes.

Screenshots

screenshot 2019-01-18 at 14 23 23

screenshot 2019-01-18 at 14 23 32

screenshot 2019-01-18 at 14 23 39

javierm and others added 9 commits January 18, 2019 14:15
These bars don't have a title.
Even if it means duplicating the translations in many cases, it's
consistent with the rest of the application.
With a parent element for just input and label, there aren't conflicts
with the globalize tabs code anymore.
According to the HTML specification:

> The default value is the minimum plus half the difference between the
> minimum and the maximum, unless the maximum is less than the minimum,
> in which case the default value is the minimum.

So for new progress bars, we had a numeric value of `nil` and a range
value of `50`, meaning the input fields weren't in sync.

Manually triggering the event on the progress, while not an ideal
solution (ideally we would be able to define `0` as default), sets the
value of the numeric field.

def destroy
@progress_bar.destroy
redirect_to progress_bars_index, notice: t('admin.progress_bars.delete.notice')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)


def update
if @progress_bar.update(progress_bar_params)
redirect_to progress_bars_index, notice: t('admin.progress_bars.update.notice')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)

@voodoorai2000 voodoorai2000 added this to Review in Roadmap Jan 22, 2019
@decabeza decabeza merged commit 227f496 into master Jan 24, 2019
@decabeza decabeza deleted the milestone_progress_bar branch January 24, 2019 10:59
@decabeza decabeza self-assigned this Jan 24, 2019
@decabeza decabeza moved this from Review to Release 0.19 in Roadmap Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants