woople-theme 0.6.9 → 0.6.10
Sign up to get free protection for your applications and to get access to all the features.
- data/app/presenters/content_image.rb +3 -3
- data/app/presenters/menu_section_presenter.rb +0 -2
- data/app/presenters/profile_link_presenter.rb +5 -0
- data/app/presenters/profile_presenter.rb +26 -5
- data/app/presenters/profile_section_presenter.rb +14 -0
- data/app/views/woople-theme/_profile.html.erb +8 -9
- data/lib/woople-theme/version.rb +1 -1
- metadata +3 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
module ContentImage
|
2
|
-
DEFAULT_IMAGE
|
3
|
-
MISSING_WOOPLE_IMAGE = '/
|
2
|
+
DEFAULT_IMAGE = 'woople-theme/missing.png'
|
3
|
+
MISSING_WOOPLE_IMAGE = '/assets/retina_thumb/missing.png'
|
4
4
|
|
5
5
|
def image(&block)
|
6
6
|
yield(normalized(__getobj__.image) || DEFAULT_IMAGE) if __getobj__.respond_to? :image
|
@@ -9,7 +9,7 @@ module ContentImage
|
|
9
9
|
private
|
10
10
|
|
11
11
|
def normalized(image)
|
12
|
-
if image
|
12
|
+
if image == MISSING_WOOPLE_IMAGE
|
13
13
|
DEFAULT_IMAGE
|
14
14
|
else
|
15
15
|
image
|
@@ -1,9 +1,30 @@
|
|
1
|
-
require '
|
1
|
+
require 'explicit_delegator'
|
2
2
|
|
3
|
-
class ProfilePresenter <
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
class ProfilePresenter < ExplicitDelegator
|
4
|
+
DEFAULT_IMAGE = 'woople-theme/missing-profile.png'
|
5
|
+
MISSING_WOOPLE_IMAGE = '/assets/retina_thumb/missing.png'
|
6
|
+
|
7
|
+
enforce_definitions :image, :sections
|
8
|
+
|
9
|
+
def image
|
10
|
+
normalized(profile.image)
|
11
|
+
end
|
12
|
+
|
13
|
+
def sections
|
14
|
+
@sections ||= ThemePresentation.wrap_collection(profile.sections, ProfileSectionPresenter)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def profile
|
20
|
+
__getobj__
|
21
|
+
end
|
22
|
+
|
23
|
+
def normalized(image)
|
24
|
+
if image.nil? || image == MISSING_WOOPLE_IMAGE
|
25
|
+
DEFAULT_IMAGE
|
26
|
+
else
|
27
|
+
image
|
7
28
|
end
|
8
29
|
end
|
9
30
|
end
|
@@ -5,16 +5,15 @@
|
|
5
5
|
</form>
|
6
6
|
<ul class="nav nav-pills profile-link">
|
7
7
|
<li class="dropdown">
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
<%= link_to(image_tag(profile.image), "#", class: 'dropdown-toggle', data: { toggle: 'dropdown' }) %>
|
9
|
+
<ul id="menu1" class="dropdown-menu">
|
10
|
+
<% profile.sections.each do |section| %>
|
11
|
+
<% section.links.each do |link| %>
|
12
|
+
<li><%= link_to(link.name, link.url) %></li>
|
13
|
+
<% end %>
|
14
|
+
<li class="divider"></li>
|
13
15
|
<% end %>
|
14
|
-
|
15
|
-
<% end %>
|
16
|
-
</ul>
|
16
|
+
</ul>
|
17
17
|
</li>
|
18
18
|
</ul>
|
19
19
|
</div>
|
20
|
-
|
data/lib/woople-theme/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -207,7 +207,9 @@ files:
|
|
207
207
|
- app/presenters/outline_presenter.rb
|
208
208
|
- app/presenters/outline_video_presenter.rb
|
209
209
|
- app/presenters/page_header_presenter.rb
|
210
|
+
- app/presenters/profile_link_presenter.rb
|
210
211
|
- app/presenters/profile_presenter.rb
|
212
|
+
- app/presenters/profile_section_presenter.rb
|
211
213
|
- app/presenters/submitted_assessment_form_presenter.rb
|
212
214
|
- app/presenters/theme_presentation.rb
|
213
215
|
- app/presenters/woople_theme/answer_presenter.rb
|