administrate_collapsible_navigation 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25a5b1f61a6994d3ab93e044e453b9bdba078330
4
- data.tar.gz: 5ca314752ca01cec6bfa3c9a9c686679ccbb7681
3
+ metadata.gz: 7b8477bffabe5a33e5e19476725189f7aee246ab
4
+ data.tar.gz: 9dc6ca9dd0c38d97a9317c0f3ce5bae95b932927
5
5
  SHA512:
6
- metadata.gz: 05c72a7fa302cc9de922a9a1ace8fa78b43cd29226278e0320742446dec9b86afd214e6bc5cbdb925597510a6ef554e04257e9527c616171baa431e60b3cbaa9
7
- data.tar.gz: a2ea545a2e070bd1f030377dce1e558c14794348fd373bb94ecd7252037f916ed15d8e9e6b605ba16794ca8b1f4f5ffa617f677d93015f510ec1f996778ce214
6
+ metadata.gz: c6f54dedf187f3a0ad423287500bd557f3393d1b4c61dcde18b4b88280b930bef636778e2f3c967a24eab8fd158b7bda9f5cee8cba4b77fafd09db2e5de75bd7
7
+ data.tar.gz: 737f994930f85e6990facf641704fd0b9af241e94709d534cfd59eff4744ff63d4722d24a76aab8e5a39b53bc0bad509906606f18f9ae6424af2edea543b40ed
@@ -1,10 +1,12 @@
1
- document.getElementById('navigation__toggle').onclick = function() {
2
- var navigation = document.getElementsByClassName('navigation')[0];
3
- if (navigation.style.display === 'none') {
4
- navigation.style.display = 'block';
5
- this.src = "<%= image_path 'menu_open.png' %>";
6
- } else {
7
- navigation.style.display = 'none';
8
- this.src = "<%= image_path 'menu_closed.png' %>";
9
- }
10
- };
1
+ if (document.getElementById('navigation__toggle')) {
2
+ document.getElementById('navigation__toggle').onclick = function() {
3
+ var navigation = document.getElementsByClassName('navigation')[0];
4
+ if (navigation.style.display === 'none') {
5
+ navigation.style.display = 'block';
6
+ this.src = "<%= image_path 'menu_open.png' %>";
7
+ } else {
8
+ navigation.style.display = 'none';
9
+ this.src = "<%= image_path 'menu_closed.png' %>";
10
+ }
11
+ };
12
+ };
@@ -0,0 +1,37 @@
1
+ <%#
2
+ # Edit
3
+
4
+ This view is the template for the edit page.
5
+
6
+ It displays a header, and renders the `_form` partial to do the heavy lifting.
7
+
8
+ ## Local variables:
9
+
10
+ - `page`:
11
+ An instance of [Administrate::Page::Form][1].
12
+ Contains helper methods to help display a form,
13
+ and knows which attributes should be displayed in the resource's form.
14
+
15
+ [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form
16
+ %>
17
+
18
+ <% content_for(:title) { t("administrate.actions.edit_resource", name: page.page_title) } %>
19
+
20
+ <header class="main-content__header" role="banner">
21
+ <%= image_tag 'menu_open.png', id: 'navigation__toggle' %>
22
+ <h1 class="main-content__page-title">
23
+ <%= content_for(:title) %>
24
+ </h1>
25
+
26
+ <div>
27
+ <%= link_to(
28
+ t("administrate.actions.show_resource", name: page.page_title),
29
+ [namespace, page.resource],
30
+ class: "button",
31
+ ) if valid_action?(:show) && show_action?(:show, page.resource) %>
32
+ </div>
33
+ </header>
34
+
35
+ <section class="main-content__body">
36
+ <%= render "form", page: page %>
37
+ </section>
@@ -0,0 +1,38 @@
1
+ <%#
2
+ # New
3
+
4
+ This view is the template for the "new resource" page.
5
+ It displays a header, and then renders the `_form` partial
6
+ to do the heavy lifting.
7
+
8
+ ## Local variables:
9
+
10
+ - `page`:
11
+ An instance of [Administrate::Page::Form][1].
12
+ Contains helper methods to help display a form,
13
+ and knows which attributes should be displayed in the resource's form.
14
+
15
+ [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form
16
+ %>
17
+
18
+ <% content_for(:title) do %>
19
+ <%= t(
20
+ "administrate.actions.new_resource",
21
+ name: display_resource_name(page.resource_name).titleize
22
+ ) %>
23
+ <% end %>
24
+
25
+ <header class="main-content__header" role="banner">
26
+ <%= image_tag 'menu_open.png', id: 'navigation__toggle' %>
27
+ <h1 class="main-content__page-title">
28
+ <%= content_for(:title) %>
29
+ </h1>
30
+
31
+ <div>
32
+ <%= link_to t("administrate.actions.back"), :back, class: "button" %>
33
+ </div>
34
+ </header>
35
+
36
+ <section class="main-content__body">
37
+ <%= render "form", page: page %>
38
+ </section>
@@ -0,0 +1,50 @@
1
+ <%#
2
+ # Show
3
+
4
+ This view is the template for the show page.
5
+ It renders the attributes of a resource,
6
+ as well as a link to its edit page.
7
+
8
+ ## Local variables:
9
+
10
+ - `page`:
11
+ An instance of [Administrate::Page::Show][1].
12
+ Contains methods for accessing the resource to be displayed on the page,
13
+ as well as helpers for describing how each attribute of the resource
14
+ should be displayed.
15
+
16
+ [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show
17
+ %>
18
+
19
+ <% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %>
20
+
21
+ <header class="main-content__header" role="banner">
22
+ <%= image_tag 'menu_open.png', id: 'navigation__toggle' %>
23
+ <h1 class="main-content__page-title">
24
+ <%= content_for(:title) %>
25
+ </h1>
26
+
27
+ <div>
28
+ <%= link_to(
29
+ t("administrate.actions.edit_resource", name: page.page_title),
30
+ [:edit, namespace, page.resource],
31
+ class: "button",
32
+ ) if valid_action?(:edit) && show_action?(:edit, page.resource) %>
33
+ </div>
34
+ </header>
35
+
36
+ <section class="main-content__body">
37
+ <dl>
38
+ <% page.attributes.each do |attribute| %>
39
+ <dt class="attribute-label" id="<%= attribute.name %>">
40
+ <%= t(
41
+ "helpers.label.#{resource_name}.#{attribute.name}",
42
+ default: attribute.name.titleize,
43
+ ) %>
44
+ </dt>
45
+
46
+ <dd class="attribute-data attribute-data--<%=attribute.html_class%>"
47
+ ><%= render_field attribute, page: page %></dd>
48
+ <% end %>
49
+ </dl>
50
+ </section>
@@ -1,3 +1,3 @@
1
1
  module AdministrateCollapsibleNavigation
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate_collapsible_navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Bondarev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-23 00:00:00.000000000 Z
11
+ date: 2019-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -71,7 +71,10 @@ files:
71
71
  - app/assets/images/menu_open.png
72
72
  - app/assets/javascripts/administrate_collapsible_navigation/application.js.erb
73
73
  - app/assets/stylesheets/administrate_collapsible_navigation/application.css
74
+ - app/views/admin/application/edit.html.erb
74
75
  - app/views/admin/application/index.html.erb
76
+ - app/views/admin/application/new.html.erb
77
+ - app/views/admin/application/show.html.erb
75
78
  - lib/administrate_collapsible_navigation.rb
76
79
  - lib/administrate_collapsible_navigation/version.rb
77
80
  - test/administrate_collapsible_navigation_test.rb
@@ -131,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
134
  version: '0'
132
135
  requirements: []
133
136
  rubyforge_project:
134
- rubygems_version: 2.6.14
137
+ rubygems_version: 2.5.2
135
138
  signing_key:
136
139
  specification_version: 4
137
140
  summary: Collapsible navigation for Administrate