Problem/Motivation

The progress bar should also be applicable for other entities and should therefore reside in salsa_entity and not in salsa_donate_page. As a first step add the progress bar to the single target action form of salsa_advocacy.

Proposed resolution

Move the theme function out into salsa_entity. To apply the progress bar in salsa_advocacy (at least for single target actions) we need a function the counts existing actions that were taken to display the progress. Additionally there has to be a configuration for the goal field similar to the one we have now for donate pages.

CommentFileSizeAuthor
#21 generic_progress_bar-2231469-21.patch30.14 KBs_leu
#20 generic_progress_bar-2231469-20.patch25.28 KBs_leu
#19 generic_progress_bar-2231469-19.interdiff.txt3.92 KBs_leu
#19 generic_progress_bar-2231469-19.patch29.35 KBs_leu
#17 generic_progress_bar-2231469-17.patch29.42 KBs_leu
#15 generic_progress_bar-2231469-15.interdiff.txt6.9 KBs_leu
#15 generic_progress_bar-2231469-15.patch27.47 KBs_leu
#14 generic_progress_bar-2231469-14.interdiff.txt9.79 KBs_leu
#14 generic_progress_bar-2231469-14.patch24.94 KBs_leu
#13 generic_progress_bar-2231469-13.interdiff.txt3.82 KBs_leu
#13 generic_progress_bar-2231469-13.patch25.29 KBs_leu
#12 generic_progress_bar-2231469-12.interdiff.txt5.03 KBs_leu
#12 generic_progress_bar-2231469-12.patch24.37 KBs_leu
#11 generic_progress_bar-2231469-11.patch22.48 KBs_leu
#11 generic_progress_bar-2231469-11.interdiff.txt9.96 KBs_leu
#10 generic_progress_bar-2231469-10.patch19.09 KBs_leu
#9 generic_progress_bar-2231469-9.interdiff.txt709 bytess_leu
#9 generic_progress_bar-2231469-9.patch16.1 KBs_leu
#8 generic_progress_bar-2231469-8.interdiff.txt717 bytess_leu
#8 generic_progress_bar-2231469-8.patch16.09 KBs_leu
#7 generic_progress_bar-2231469-7.patch16.09 KBs_leu
#7 generic_progress_bar-2231469-7.interdiff.txt7.62 KBs_leu
#5 generic_progress_bar-2231469-5.patch17.77 KBs_leu
#5 generic_progress_bar-2231469-5.interdiff.txt9.67 KBs_leu
#3 generic_progress_bar-2231469-3.patch13.23 KBs_leu
#3 generic_progress_bar-2231469-3.interdiff.txt914 bytess_leu
#2 generic_progress_bar-2231469-1.patch13.22 KBs_leu

Comments

s_leu’s picture

Adding a first patch that moves the theme function as well as the CSS and also changes all relevant parts in code. It will also allow to configure the progress bar for single target actions.

s_leu’s picture

StatusFileSize
new13.22 KB
s_leu’s picture

Small improvement on the settings form: Moved the fieldset definition to the inside of the condition.

s_leu’s picture

Status: Active » Needs review
s_leu’s picture

Made some further improvements and fixed some stuff that i missed in the last patch.

s_leu’s picture

Issue summary: View changes
s_leu’s picture

Added the progress bar to the petition form as well now. Also did some refactoring which makes it even easier to add the progress bar to further other entities.

s_leu’s picture

Fixed typo in fieldname on salsa_advocacy system settings form.

s_leu’s picture

Moved the correction of the progress bar element's weight into the condition on the petition progress bar.

s_leu’s picture

StatusFileSize
new19.09 KB

Somehow i lost some stuff of the original patches over time. So here is the complete patch with some improvements.

s_leu’s picture

Fixed few things that were obsolete such as the salsa entity object in the progress bar add function. Also changed the barometer type parameter to form_state as for the new introduced progress bar animation js requires id's in js settings and theme function output.

Also implemented hook_library for the progress bar js and css. In salsa donate page i fixed the labels alter hook to add a condition in the hook (it was altering labels for all forms before that change).

s_leu’s picture

Added option to disable progress bar globally and function in JS, that ensures that numbers can be parsed from strange strings like $12,000.00 USD, which failed before and led to broken progress bars.

s_leu’s picture

Improved JS loading that counts up in numbers instead of percent.

s_leu’s picture

Some further improvements including parallel animations if multiple progress bars are displayed on the same page. Also some setting in the UI that enables configuration of the animation speed.

s_leu’s picture

Added a configuration option in the UI that enables to switch between percent and absolute display when counting up the progress.

Status: Needs review » Needs work

The last submitted patch, 15: generic_progress_bar-2231469-15.patch, failed testing.

s_leu’s picture

StatusFileSize
new29.42 KB

Also turned the static label into percent display if the entity is configured with percent display and rerolled against latest 7.x-1.x.

s_leu’s picture

Status: Needs work » Needs review
s_leu’s picture

Fixed a bug in JS: Function was declared inside an if statement. This would break the JS in certain browsers.

s_leu’s picture

StatusFileSize
new25.28 KB

Re-rolled the patch and changed the counter function in salsa_avocacy to use EFQ instead of the salsa API in order to introduce a tag that allows altering the query.

s_leu’s picture

StatusFileSize
new30.14 KB

Somehow the JS and CSS files were missing again in the latest patch, re-added it.

  • Berdir committed 55e358d on 7.x-1.x authored by s_leu
    Issue #2231469 by s_leu: Make progress bar theme form generic and add it...
berdir’s picture

Status: Needs review » Fixed

Thanks, finally committed this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.