Feature #16043

Consider have a progress bar on the donation campaign

Added by sajolida 2018-10-11 15:58:34 . Updated 2018-11-02 12:08:53 .

Status:
Resolved
Priority:
Elevated
Assignee:
Category:
Fundraising
Target version:
Start date:
2018-10-11
Due date:
% Done:

0%

Feature Branch:
web/16043-donation-counter
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description


Subtasks


History

#1 Updated by sajolida 2018-10-11 15:58:55

#2 Updated by sajolida 2018-10-21 20:26:49

  • Target version changed from Tails_3.10.1 to Tails_3.11

This will require some coding work but it can go live in the middle of the campaign.

#3 Updated by sajolida 2018-10-25 06:12:25

  • Status changed from Confirmed to In Progress

I started writing some code…

#4 Updated by sajolida 2018-10-27 10:33:59

  • Assignee changed from sajolida to moire
  • QA Check set to Ready for QA
  • Feature Branch set to web/16043-donation-counter

Here is some coooooode!

moire: Please have a look! I’ll also ask someone else to review the bits of JS in there.

All our account handlers agreed on updating us every ~2 weeks. We can update the total amount each time one of them sends us fresh information. That’s why I added a ‘Last updated’ info.

Rationale behind the code:

NB: I haven’t tested the version without JavaScript. Please try it out and report. Sorry!

#5 Updated by Anonymous 2018-10-29 13:53:33

  • Assignee changed from moire to sajolida
  • QA Check changed from Ready for QA to Pass

Hi!

I’m having a look at the code.


+  var days = document.getElementsByClassName('counter-days');
+  for (let i = 0; i < days.length; i++) {
+    days[i].style.display = "block";
+  }

I see you are using a for loop here because there is the information in all languages at once. Not beautiful, but I understand the reasoning.

From a CSS point of view, I think it would be useful to have .counter set on an absolute position only using a media query for bigger screens and display it below the donation sentence and icon on smaller screens. Now if you look on a small screen / smartphone, it looks not very nice.

There is also a really cool thing now to display things next to each other:

a.donate-banner {
    display: flex;
    justify-content: space-between;
}

and then both columns (the donation text on the left and the counter on the right) would get another div around them and the above code would adjust it nicely, while you could still use margins and paddings to adjust it more to one side or the other. → But that’s just CSS-Geekeries, not necessary :)

Everything else looks good to me.

#7 Updated by Anonymous 2018-10-29 13:59:01

@moire: I’ve added you as a watcher so that you can comment on this, and reassigned this back to sajolida so he can read the review he asked for. Hope that’s fine, I did not want do short circuit your communications.

#8 Updated by sajolida 2018-10-29 16:06:04

> I’m having a look at the code.

Thanks a lot!

>>From a CSS point of view, I think it would be useful to have .counter set on an absolute position only using a media query for bigger screens and display it below the donation sentence and icon on smaller screens. Now if you look on a small screen / smartphone, it looks not very nice.

Good catch! I fixed that with 0a7cfce402.

> There is also a really cool thing now to display things next to each other:
>

> a.donate-banner {
>     display: flex;
>     justify-content: space-between;
> }
> 
> 

I briefly saw this when searching other CSS stuff online and it looks
really cool but I think I’ll learn that next time :)

>> * We need JS to display the number of days remaining.
>
> Actually, because you update this file manually regularly, you could
> also just update the days manually I guess?

We’ll update the counter only every week or so, so I thought it was
worth writing 6 lines of JavaScript to have it up-to-date when JS is
enabled.

Now, you’re right that this info can still be displayed when JS is
disabled even though it will be slightly outdated. I did this in
ce4b4919b6 and this simplifies the code a tiny bit.

>> NB: I haven’t tested the version without JavaScript. Please try it
>> out and report. Sorry!
>
> I tried it and it just shows the counter and it works as expected.

Yeah! Thanks for running my untested code :)

#9 Updated by sajolida 2018-10-29 16:10:47

  • Assignee changed from sajolida to moire
  • QA Check changed from Pass to Ready for QA

moire: Feel free to still have a look but since Ulrike did an extensive review already I’ll ask our account holders to send me a first batch of information and release the counter as soon as I have something valuable.

#10 Updated by moire 2018-11-01 18:09:38

u wrote:
> @moire: I’ve added you as a watcher so that you can comment on this, and reassigned this back to sajolida so he can read the review he asked for. Hope that’s fine, I did not want do short circuit your communications.

@u: thanks, and that’s fine.

#11 Updated by moire 2018-11-01 18:28:06

  • Assignee changed from moire to sajolida
  • QA Check changed from Ready for QA to Dev Needed

sajolida wrote:
> moire: Feel free to still have a look but since Ulrike did an extensive review already I’ll ask our account holders to send me a first batch of information and release the counter as soon as I have something valuable.

I viewed it with and without javascript, with and without the “mobile” view provided by Firefox.

It looks good and works well: progress bar, goal, values, time left and “last updated” popup.

On “mobile” though the underline that should end with “Tails!” continues until the end of the screen.

#12 Updated by intrigeri 2018-11-02 10:31:55

The alt="Info" text is displayed instead of the intended picture on most pages, e.g. https://tails.boum.org/recentchanges/. I suspect the link to the picture only works on the homepage.

#13 Updated by sajolida 2018-11-02 11:58:36

  • Status changed from In Progress to Resolved
  • Assignee deleted (sajolida)
  • QA Check deleted (Dev Needed)

Done :)

And fixed the glitch with b351e23f48.

#14 Updated by Anonymous 2018-11-02 12:08:53

In 4e30a3e59b7c97cf90b5a87bc6df1ece568f4335 I’ve implemented a very quick fix to force the reloading of the CSS file. Please drop whenever convienent. Or keep as is, and change the date to force reloading.