Every campaign has an end.

Drop ahoy, because it's more trouble than it's worth. This means dropping
visits, campaigns, targets.

Campaigns are better run to analytics, such as:
* https://matomo.org/docs/tracking-campaigns/
* https://matomo.org/docs/tracking-goals-web-analytics/
* https://support.google.com/analytics/answer/1012040?hl=en
This commit is contained in:
James Mason 2018-10-08 17:58:41 -07:00 committed by Henne Vogelsang
parent 62056fc044
commit b11001cdba
47 changed files with 19 additions and 1420 deletions

View file

@ -1,40 +0,0 @@
- if campaigns && !campaigns.empty?
.row
.col-md-12
%p
Your target "#{campaigns.values[0]['target_name']}" from campaign "#{campaigns.values[0]['campaign_name']}" has generated
%strong
#{pluralize(campaigns.values[0]['value'], campaigns.values[0]['unit'])}
since #{campaigns.values[0]['created_at']}.
%p
That is
%strong{ 'style' => "color: #{target_progress_color(campaigns.values[0]['progress'])};" }
#{campaigns.values[0]['progress']} %
of your target, there are
%strong{ 'style' => "color: #{days_left_color(campaigns.values[0]['days_left'])};" }
#{pluralize(campaigns.values[0]['days_left'], 'day')} left.
.row
.col-md-12
%div{ 'style' => 'display: none;', 'id' => "#{name}" }
- campaigns.drop(1).each do |(_key, value)|
%div
%p
Your target "#{value['target_name']}" from campaign "#{value['campaign_name']}" has generated
%strong
#{pluralize(value['value'], value['unit'])}
since #{value['created_at']}.
%p
That is
%strong{ 'style' => "color: #{target_progress_color(value['progress'])};" }
#{value['progress']} %
of your target, there are
%strong{ 'style' => "color: #{days_left_color(value['days_left'])};" }
#{pluralize(value['days_left'], 'day')} left.
.row
.col-md-12
- if campaigns.length > 1
%a.show_targets{ 'href' => '#', 'data-name' => "#{name}" }
more
- else
%h5.text-warning.text-center
No Campaigns!

View file

@ -1,32 +0,0 @@
- if targets && !targets.empty?
.row
.col-md-8.col-md-offset-2
.row
.col-md-10
%h6.text-muted.pull-left
Target 1
.row
.col-md-10
.progress{ 'title' => "#{targets.keys[0]}" }
.progress-bar{ 'role' => 'progressbar', 'aria-valuenow' => " #{targets.values[0]}", 'aria-valuemin' => '0',
'aria-valuemax' => '100', 'style' => "width: #{targets.values[0]}%;" }
= "#{targets.values[0]} %"
.row
.col-md-8.col-md-offset-2
%div{ 'style' => 'display: none;', 'id' => "#{name}" }
- targets.drop(1).each_with_index do |(key, value), index|
.row
.col-md-10
%h6.text-muted.pull-left
= "Target #{index + 2}"
.row
.col-md-10
.progress{ 'title' => "#{key}" }
.progress-bar{ 'role' => 'progressbar', 'aria-valuenow' => "#{value}", 'aria-valuemin' => '0',
'aria-valuemax' => '100', 'style' => "width: #{value}%;" }
= "#{value} %"
.row
.col-md-2.col-md-offset-2
- if targets.length > 1
%a.show_targets{ 'href' => '#', 'data-name' => "#{name}" }
more

View file

@ -115,13 +115,6 @@
= render partial: 'recent_submissions', locals: {recent_events: @recent_events}
.col-md-4
= render partial: 'top_submitter', locals: {top_submitter: @top_submitter}
.row
.col-md-12
%h3
%span
%i.fa.fa-flag
Campaigns
= render partial: 'campaigns', locals: {campaigns: @campaigns, name: 'campaigns'}
:javascript
$('#recentTable a').click(function (e) {