tkh_menus 0.3.2 → 0.3.3
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.
- data/CHANGELOG.md +8 -0
- data/app/views/menus/_form.html.erb +1 -0
- data/app/views/menus/_tab_admin_menu.html.erb +1 -1
- data/app/views/shared/_context_menu.html.erb +6 -49
- data/app/views/shared/_context_menu_for_levels.html.erb +21 -0
- data/app/views/shared/_context_menu_for_pages.html.erb +48 -0
- data/app/views/shared/_context_menu_for_styles.html.erb +21 -0
- data/lib/tkh_menus/version.rb +1 -1
- metadata +7 -4
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## 0.3.3
|
6
|
+
|
7
|
+
* Turned off browser autocomplete from menu form, parent menu field
|
8
|
+
* Changed neutral edit link in tab admin menu
|
9
|
+
* Added a context menu for styles
|
10
|
+
* Added a context menu for levels
|
11
|
+
|
12
|
+
|
5
13
|
## 0.3.2
|
6
14
|
|
7
15
|
* Refactored the language switchers
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<ul class="nav nav-tabs" id="admin-menu-tab">
|
2
2
|
<%= content_tag :li, link_to(t('new'), new_menu_path), ({ class: 'active' } if controller.action_name.to_s == 'new' ) %>
|
3
3
|
<%= content_tag :li, link_to(t('list'), menus_path), ({ class: 'active' } if controller.action_name.to_s == 'index' ) %>
|
4
|
-
<%= content_tag :li, link_to(t('edit'),
|
4
|
+
<%= content_tag :li, link_to(t('edit'), '#'), ({ class: 'active' }) if controller.action_name.to_s == 'edit' %>
|
5
5
|
</ul>
|
@@ -1,52 +1,9 @@
|
|
1
1
|
<% content_for :context_menu do %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<% for page in @page.children.by_menu_position %>
|
9
|
-
<%= content_tag :li, link_to(page.nickname, page) %>
|
10
|
-
<% end %>
|
11
|
-
</ul>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<% if !@page.orphan? && @page.has_siblings? %>
|
15
|
-
<h2><%= link_to @page.parent.nickname, @page.parent %></h2>
|
16
|
-
<ul>
|
17
|
-
<% for page in @page.siblings.by_menu_position %>
|
18
|
-
<%= content_tag :li, link_to(page.nickname, page) %>
|
19
|
-
<% end %>
|
20
|
-
</ul>
|
21
|
-
<% end %>
|
22
|
-
<% end -%>
|
23
|
-
|
24
|
-
<% else # administrators can reorder menu pages %>
|
25
|
-
|
26
|
-
<% if @page %>
|
27
|
-
<% if @page.has_children? %>
|
28
|
-
<h2><%= @page.nickname %></h2>
|
29
|
-
<ul class="draggable" data-update-url="<%= sort_pages_path %>">
|
30
|
-
<% for page in @page.children.by_menu_position %>
|
31
|
-
<%= content_tag :li, page, class: 'page', id: "page_#{page.id}" do %>
|
32
|
-
<%= image_tag 'drag-handle.gif', :class => 'handle silhouette' %> <%= link_to page.nickname, page -%>
|
33
|
-
<% end -%>
|
34
|
-
<% end %>
|
35
|
-
</ul>
|
36
|
-
<% end %>
|
37
|
-
|
38
|
-
<% if !@page.orphan? && @page.has_siblings? %>
|
39
|
-
<h2><%= link_to @page.parent.nickname, @page.parent %></h2>
|
40
|
-
<ul class="draggable" data-update-url="<%= sort_pages_path %>">
|
41
|
-
<% for page in @page.siblings.by_menu_position %>
|
42
|
-
<%= content_tag :li, page, class: 'page', id: "page_#{page.id}" do %>
|
43
|
-
<%= image_tag 'drag-handle.gif', :class => 'handle silhouette' %> <%= link_to page.nickname, page -%>
|
44
|
-
<% end -%>
|
45
|
-
<% end %>
|
46
|
-
</ul>
|
47
|
-
<% end %>
|
48
|
-
<% end -%>
|
49
|
-
|
2
|
+
<% if controller.controller_name == 'pages' %>
|
3
|
+
<%= render 'shared/context_menu_for_pages' %>
|
4
|
+
<% elsif controller.controller_name == 'styles' %>
|
5
|
+
<%= render 'shared/context_menu_for_styles' %>
|
6
|
+
<% elsif controller.controller_name == 'levels' %>
|
7
|
+
<%= render 'shared/context_menu_for_levels' %>
|
50
8
|
<% end -%>
|
51
|
-
|
52
9
|
<% end -%>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% unless administrator? # basic functionality for all users %>
|
2
|
+
|
3
|
+
<h2>Levels</h2>
|
4
|
+
<ul>
|
5
|
+
<% for level in Level.by_position %>
|
6
|
+
<%= content_tag :li, link_to(level.nickname, level) %>
|
7
|
+
<% end %>
|
8
|
+
</ul>
|
9
|
+
|
10
|
+
<% else # administrators can reorder menu levels %>
|
11
|
+
|
12
|
+
<h2>Levels</h2>
|
13
|
+
<ul class="draggable" data-update-url="<%= sort_levels_path %>">
|
14
|
+
<% for level in Level.by_position %>
|
15
|
+
<%= content_tag :li, level, class: 'level', id: "level_#{level.id}" do %>
|
16
|
+
<%= image_tag 'drag-handle.gif', :class => 'handle silhouette' %> <%= link_to level.nickname, level -%>
|
17
|
+
<% end -%>
|
18
|
+
<% end %>
|
19
|
+
</ul>
|
20
|
+
|
21
|
+
<% end -%>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<% unless administrator? # basic functionality for all users %>
|
2
|
+
<% if @page %>
|
3
|
+
<% if @page.has_children? %>
|
4
|
+
<h2><%= @page.nickname %></h2>
|
5
|
+
<ul>
|
6
|
+
<% for page in @page.children.by_menu_position %>
|
7
|
+
<%= content_tag :li, link_to(page.nickname, page) %>
|
8
|
+
<% end %>
|
9
|
+
</ul>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% if !@page.orphan? && @page.has_siblings? %>
|
13
|
+
<h2><%= link_to @page.parent.nickname, @page.parent %></h2>
|
14
|
+
<ul>
|
15
|
+
<% for page in @page.siblings.by_menu_position %>
|
16
|
+
<%= content_tag :li, link_to(page.nickname, page) %>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
19
|
+
<% end %>
|
20
|
+
<% end -%>
|
21
|
+
|
22
|
+
<% else # administrators can reorder menu pages %>
|
23
|
+
|
24
|
+
<% if @page %>
|
25
|
+
<% if @page.has_children? %>
|
26
|
+
<h2><%= @page.nickname %></h2>
|
27
|
+
<ul class="draggable" data-update-url="<%= sort_pages_path %>">
|
28
|
+
<% for page in @page.children.by_menu_position %>
|
29
|
+
<%= content_tag :li, page, class: 'page', id: "page_#{page.id}" do %>
|
30
|
+
<%= image_tag 'drag-handle.gif', :class => 'handle silhouette' %> <%= link_to page.nickname, page -%>
|
31
|
+
<% end -%>
|
32
|
+
<% end %>
|
33
|
+
</ul>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<% if !@page.orphan? && @page.has_siblings? %>
|
37
|
+
<h2><%= link_to @page.parent.nickname, @page.parent %></h2>
|
38
|
+
<ul class="draggable" data-update-url="<%= sort_pages_path %>">
|
39
|
+
<% for page in @page.siblings.by_menu_position %>
|
40
|
+
<%= content_tag :li, page, class: 'page', id: "page_#{page.id}" do %>
|
41
|
+
<%= image_tag 'drag-handle.gif', :class => 'handle silhouette' %> <%= link_to page.nickname, page -%>
|
42
|
+
<% end -%>
|
43
|
+
<% end %>
|
44
|
+
</ul>
|
45
|
+
<% end %>
|
46
|
+
<% end -%>
|
47
|
+
|
48
|
+
<% end -%>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% unless administrator? # basic functionality for all users %>
|
2
|
+
|
3
|
+
<h2>Styles</h2>
|
4
|
+
<ul>
|
5
|
+
<% for style in Style.by_position %>
|
6
|
+
<%= content_tag :li, link_to(style.nickname, style) %>
|
7
|
+
<% end %>
|
8
|
+
</ul>
|
9
|
+
|
10
|
+
<% else # administrators can reorder menu styles %>
|
11
|
+
|
12
|
+
<h2>Styles</h2>
|
13
|
+
<ul class="draggable" data-update-url="<%= sort_styles_path %>">
|
14
|
+
<% for style in Style.by_position %>
|
15
|
+
<%= content_tag :li, style, class: 'style', id: "style_#{style.id}" do %>
|
16
|
+
<%= image_tag 'drag-handle.gif', :class => 'handle silhouette' %> <%= link_to style.nickname, style -%>
|
17
|
+
<% end -%>
|
18
|
+
<% end %>
|
19
|
+
</ul>
|
20
|
+
|
21
|
+
<% end -%>
|
data/lib/tkh_menus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_menus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -108,6 +108,9 @@ files:
|
|
108
108
|
- app/views/menus/index.html.erb
|
109
109
|
- app/views/menus/new.html.erb
|
110
110
|
- app/views/shared/_context_menu.html.erb
|
111
|
+
- app/views/shared/_context_menu_for_levels.html.erb
|
112
|
+
- app/views/shared/_context_menu_for_pages.html.erb
|
113
|
+
- app/views/shared/_context_menu_for_styles.html.erb
|
111
114
|
- app/views/shared/_language_switcher.html.erb
|
112
115
|
- app/views/shared/_language_switcher_for_navbar.html.erb
|
113
116
|
- app/views/shared/_menu_for_navbar.html.erb
|
@@ -173,7 +176,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
173
176
|
version: '0'
|
174
177
|
segments:
|
175
178
|
- 0
|
176
|
-
hash:
|
179
|
+
hash: 509402811979920923
|
177
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
181
|
none: false
|
179
182
|
requirements:
|
@@ -182,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
185
|
version: '0'
|
183
186
|
segments:
|
184
187
|
- 0
|
185
|
-
hash:
|
188
|
+
hash: 509402811979920923
|
186
189
|
requirements: []
|
187
190
|
rubyforge_project:
|
188
191
|
rubygems_version: 1.8.23
|