woople-theme 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  $(document).ready(function() {
2
- $('.touch .alert').click(function() {
2
+ $('.touch .alert.fade.in').click(function() {
3
3
  $(this).alert('close');
4
4
  });
5
5
  });
@@ -0,0 +1,56 @@
1
+ @status-height: 32px;
2
+ @alert-padding: 8px;
3
+
4
+ .status-alert {
5
+ margin: 8px;
6
+ padding-left: 8px;
7
+ min-height: @status-height;
8
+ background-image: asset-url('woople-theme/certification/yellow-status.png');
9
+ background-position: @alert-padding @alert-padding;
10
+ background-repeat: no-repeat;
11
+
12
+ strong {
13
+ display: inline-block;
14
+ margin-top: 7px;
15
+ margin-left: @status-height + 4;
16
+ font-size: 24px;
17
+ font-weight: 500;
18
+ }
19
+
20
+ span {
21
+ margin-left: 4px;
22
+ font-size: 14px;
23
+ }
24
+ }
25
+
26
+ .status-alert.alert-error {
27
+ background-image: asset-url('woople-theme/certification/red-status.png');
28
+ }
29
+
30
+ .status-alert.alert-success {
31
+ background-image: asset-url('woople-theme/certification/green-status.png');
32
+ }
33
+
34
+ @media (max-width: 480px) {
35
+ .status-alert {
36
+ span {
37
+ display: block;
38
+ margin-top: 4px;
39
+ }
40
+ }
41
+ }
42
+
43
+ @media (-webkit-min-device-pixel-ratio: 2) {
44
+ .status-alert {
45
+ background-size: @status-height @status-height;
46
+ background-image: asset-url('woople-theme/certification/yellow-status-2x.png');
47
+ }
48
+
49
+ .status-alert.alert-error {
50
+ background-image: asset-url('woople-theme/certification/red-status-2x.png');
51
+ }
52
+
53
+ .status-alert.alert-success {
54
+ background-image: asset-url('woople-theme/certification/green-status-2x.png');
55
+ }
56
+ }
@@ -1,24 +1,28 @@
1
1
  /*
2
- *= require woople-theme/responsive
2
+ = require twitter/bootstrap
3
3
 
4
- * COMPONENTS
5
- *= require woople-theme/base
6
- *= require woople-theme/menu
7
- *= require woople-theme/content
8
- *= require woople-theme/profile
9
- *= require woople-theme/page-header
10
- *= require woople-theme/outline
11
- *= require woople-theme/grid
12
- *= require woople-theme/buttons
13
- *= require woople-theme/content-item
14
- *= require woople-theme/search-results
15
- *= require woople-theme/pagination
16
- *= require woople-theme/modal
17
- *= require woople-theme/legacy
18
- *= require woople-theme/basic-content
19
- *= require woople-theme/video-js.min
20
- *= require woople-theme/assessment
4
+ = require woople-theme/responsive
21
5
 
22
- * PAGE SPECIFIC STYLES
23
- *= require woople-theme/course
24
- */
6
+ COMPONENTS
7
+ = require woople-theme/base
8
+ = require woople-theme/menu
9
+ = require woople-theme/content
10
+ = require woople-theme/profile
11
+ = require woople-theme/page-header
12
+ = require woople-theme/outline
13
+ = require woople-theme/grid
14
+ = require woople-theme/buttons
15
+ = require woople-theme/content-item
16
+ = require woople-theme/search-results
17
+ = require woople-theme/pagination
18
+ = require woople-theme/modal
19
+ = require woople-theme/legacy
20
+ = require woople-theme/basic-content
21
+ = require woople-theme/video-js.min
22
+ = require woople-theme/assessment
23
+ = require_directory ./dashboard
24
+
25
+ PAGE SPECIFIC STYLES
26
+ = require woople-theme/course
27
+ */
28
+
@@ -0,0 +1,5 @@
1
+ module DashboardHelper
2
+ def status_alert(color, description)
3
+ render partial: 'dashboard/status_alert', object: ThemePresentation.wrap({ color: color, description: description }, WoopleTheme::Dashboard::StatusAlertPresenter)
4
+ end
5
+ end
@@ -40,11 +40,8 @@ class SubmittedAssessmentFormPresenter < AssessmentFormPresenter
40
40
  end
41
41
 
42
42
  def result_status_classes
43
- classes = [:alert, :fade, :in]
44
- classes << 'alert-success' if passed?
45
- classes << 'alert-error' if !passed?
46
-
47
- classes
43
+ css_classes = [:alert]
44
+ css_classes << (passed? ? 'alert-success' : 'alert-error')
48
45
  end
49
46
 
50
47
  def status
@@ -0,0 +1,22 @@
1
+ require 'explicit_delegator'
2
+
3
+ module WoopleTheme
4
+ module Dashboard
5
+ class StatusAlertPresenter < ExplicitDelegator
6
+ enforce_definitions :color, :description
7
+
8
+ def css_class
9
+ case __getobj__.color
10
+ when :red
11
+ 'alert-error'
12
+ when :green
13
+ 'alert-success'
14
+ end
15
+ end
16
+
17
+ def color
18
+ __getobj__.color.to_s.capitalize!
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,4 @@
1
+ <div class="alert <%= status_alert.css_class %> status-alert">
2
+ <strong class="alert-heading"><%= status_alert.color %></strong>
3
+ <span><%= status_alert.description %></span>
4
+ </div>
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <meta name="apple-mobile-web-app-capable" content="yes" />
7
7
 
8
- <%= stylesheet_link_tag "woople-theme/theme", :media => "all" %>
8
+ <%= stylesheet_link_tag 'woople-theme/index', media: 'all' %>
9
9
  <%= stylesheet_link_tag "woople-theme/theme-retina", media: 'only screen and (-webkit-min-device-pixel-ratio: 2)' %>
10
10
  <%= javascript_include_tag "woople-theme/theme" %>
11
11
  <%= application_javascript %>
@@ -6,7 +6,7 @@ module WoopleTheme
6
6
  initializer :assets do |config|
7
7
  Rails.application.config.assets.precompile += [
8
8
  'woople-theme/framework.css',
9
- 'woople-theme/theme.css',
9
+ 'woople-theme/index.css',
10
10
  'woople-theme/theme-retina.css'
11
11
  ]
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module WoopleTheme
2
- VERSION = '0.4.2'
2
+ VERSION = '0.5.0'
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.4.2
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -132,11 +132,17 @@ extra_rdoc_files: []
132
132
  files:
133
133
  - app/assets/images/woople-theme/certification/green-icon.png
134
134
  - app/assets/images/woople-theme/certification/green-icon2x.png
135
+ - app/assets/images/woople-theme/certification/green-status-2x.png
136
+ - app/assets/images/woople-theme/certification/green-status.png
135
137
  - app/assets/images/woople-theme/certification/missing.png
136
138
  - app/assets/images/woople-theme/certification/red-icon.png
137
139
  - app/assets/images/woople-theme/certification/red-icon2x.png
140
+ - app/assets/images/woople-theme/certification/red-status-2x.png
141
+ - app/assets/images/woople-theme/certification/red-status.png
138
142
  - app/assets/images/woople-theme/certification/yellow-icon.png
139
143
  - app/assets/images/woople-theme/certification/yellow-icon2x.png
144
+ - app/assets/images/woople-theme/certification/yellow-status-2x.png
145
+ - app/assets/images/woople-theme/certification/yellow-status.png
140
146
  - app/assets/images/woople-theme/completed-triangle.png
141
147
  - app/assets/images/woople-theme/completed-triangle2x.png
142
148
  - app/assets/images/woople-theme/icons/menu.png
@@ -166,6 +172,7 @@ files:
166
172
  - app/assets/stylesheets/woople-theme/content-item.css.less
167
173
  - app/assets/stylesheets/woople-theme/content.css.less
168
174
  - app/assets/stylesheets/woople-theme/course.css.less
175
+ - app/assets/stylesheets/woople-theme/dashboard/status-alert.css.less
169
176
  - app/assets/stylesheets/woople-theme/framework/index.css.less
170
177
  - app/assets/stylesheets/woople-theme/framework/responsive.css.less
171
178
  - app/assets/stylesheets/woople-theme/framework.css
@@ -181,9 +188,9 @@ files:
181
188
  - app/assets/stylesheets/woople-theme/responsive.css.less
182
189
  - app/assets/stylesheets/woople-theme/search-results.css.less
183
190
  - app/assets/stylesheets/woople-theme/theme-retina.css
184
- - app/assets/stylesheets/woople-theme/theme.css
185
191
  - app/assets/stylesheets/woople-theme/variables.css.less
186
192
  - app/helpers/assessment_helper.rb
193
+ - app/helpers/dashboard_helper.rb
187
194
  - app/helpers/javascript_helper.rb
188
195
  - app/helpers/theme_helper.rb
189
196
  - app/presenters/assessment_form_presenter.rb
@@ -201,10 +208,12 @@ files:
201
208
  - app/presenters/submitted_assessment_form_presenter.rb
202
209
  - app/presenters/theme_presentation.rb
203
210
  - app/presenters/woople_theme/answer_presenter.rb
211
+ - app/presenters/woople_theme/dashboard/status_alert_presenter.rb
204
212
  - app/presenters/woople_theme/question_presenter.rb
205
213
  - app/presenters/woople_theme/submitted_answer_presenter.rb
206
214
  - app/presenters/woople_theme/submitted_question_presenter.rb
207
215
  - app/presenters/woople_theme/video_presenter.rb
216
+ - app/views/dashboard/_status_alert.html.erb
208
217
  - app/views/layouts/theme.html.erb
209
218
  - app/views/woople-theme/_assessment_form.html.erb
210
219
  - app/views/woople-theme/_assessment_form_answer.html.erb
@@ -1,8 +0,0 @@
1
- /*
2
- *= require twitter/bootstrap
3
- *= require woople-theme/index
4
- */
5
-
6
- .somestyle {
7
- background:red;
8
- }