woople-theme 0.5.13 → 0.5.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,6 +25,32 @@ section.certification-content {
25
25
  }
26
26
  }
27
27
 
28
+ #electives_points > div {
29
+ width: 50%;
30
+ margin: 0 auto;
31
+ text-align: center;
32
+ padding:@contentPadding;
33
+
34
+ @media (max-width: 767px) {
35
+ width: auto;
36
+ }
37
+
38
+ .points {
39
+ .content-title();
40
+ margin-bottom: 0;
41
+ }
42
+ }
43
+
44
+ .progress {
45
+ height: 40px;
46
+ text-align: left;
47
+ .bar {
48
+ filter: none;
49
+ background:fade(@highlight, 100%);
50
+ height: 40px;
51
+ }
52
+ }
53
+
28
54
  .styled-table();
29
55
 
30
56
  table {
@@ -22,6 +22,11 @@ module DashboardHelper
22
22
  object: ThemePresentation.wrap(presenter, WoopleTheme::Dashboard::ElectivesSectionPresenter)
23
23
  end
24
24
 
25
+ def electives_points(points_earned, points_total)
26
+ render partial: 'dashboard/points',
27
+ object: ThemePresentation.wrap({ earned: points_earned, total: points_total }, WoopleTheme::Dashboard::PointsPresenter)
28
+ end
29
+
25
30
  def electives_history(items)
26
31
  render_collection_partial(items, WoopleTheme::Dashboard::ElectiveHistoryPresenter, 'woople-theme/content_item')
27
32
  end
@@ -0,0 +1,19 @@
1
+ require 'explicit_delegator'
2
+
3
+ module WoopleTheme
4
+ module Dashboard
5
+ class PointsPresenter < ExplicitDelegator
6
+ enforce_definitions :earned, :total
7
+
8
+ def percent_complete
9
+ ( (data.earned.to_f / data.total.to_f) * 100 ).round
10
+ end
11
+
12
+ private
13
+
14
+ def data
15
+ __getobj__
16
+ end
17
+ end
18
+ end
19
+ end
@@ -2,6 +2,7 @@
2
2
  <section id="electives-section" class="certification-content">
3
3
  <h2><%= t 'woople_theme.dashboards.member.electives_section.title' %></h2>
4
4
  <ul class="nav nav-tabs" id="electives_tab_nav">
5
+ <li><a href="#electives_points" data-toggle="tab"><%= t 'woople_theme.dashboards.member.electives_section.points_tab_name' %></a></li>
5
6
  <% electives_section.render_history do %>
6
7
  <li><a href="#electives_history" data-toggle="tab"><%= t 'woople_theme.dashboards.member.electives_section.history_tab_name' %></a></li>
7
8
  <% end %>
@@ -10,6 +11,9 @@
10
11
  <% end %>
11
12
  </ul>
12
13
  <div class="tab-content">
14
+ <div class="tab-pane" id="electives_points">
15
+ <%= electives_points(electives_section.points_earned, electives_section.points_total) %>
16
+ </div>
13
17
  <% electives_section.render_history do %>
14
18
  <div class="tab-pane" id="electives_history">
15
19
  <%= electives_history(electives_section.electives_history) %>
@@ -0,0 +1,7 @@
1
+ <div>
2
+ <div class="progress">
3
+ <div class="bar" style="width: <%= points.percent_complete %>%;"></div>
4
+ </div>
5
+ <h2 class="points"><%= t 'woople_theme.dashboards.member.electives_section.points_earned', points_earned: points.earned, points_total: points.total %> </h2>
6
+ </div>
7
+
@@ -80,8 +80,10 @@ en:
80
80
  electives_section:
81
81
  title: Electives
82
82
  history_tab_name: History
83
+ points_tab_name: Points
83
84
  reason_points: Reason/Points
84
85
  in_progress: In-Progress
86
+ points_earned: '%{points_earned} of %{points_total} elective points earned'
85
87
 
86
88
  date:
87
89
  formats:
@@ -1,3 +1,3 @@
1
1
  module WoopleTheme
2
- VERSION = '0.5.13'
2
+ VERSION = '0.5.14'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woople-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.13
4
+ version: 0.5.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -216,6 +216,7 @@ files:
216
216
  - app/presenters/woople_theme/dashboard/essential_exception_presenter.rb
217
217
  - app/presenters/woople_theme/dashboard/essentials_section_presenter.rb
218
218
  - app/presenters/woople_theme/dashboard/exception_presenter.rb
219
+ - app/presenters/woople_theme/dashboard/points_presenter.rb
219
220
  - app/presenters/woople_theme/dashboard/section_presenter.rb
220
221
  - app/presenters/woople_theme/dashboard/status_alert_presenter.rb
221
222
  - app/presenters/woople_theme/question_presenter.rb
@@ -225,6 +226,7 @@ files:
225
226
  - app/views/dashboard/_electives_section.html.erb
226
227
  - app/views/dashboard/_essentials_section.html.erb
227
228
  - app/views/dashboard/_exception.html.erb
229
+ - app/views/dashboard/_points.html.erb
228
230
  - app/views/dashboard/_status_alert.html.erb
229
231
  - app/views/layouts/theme.html.erb
230
232
  - app/views/woople-theme/_assessment_form.html.erb