administrate 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of administrate might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/administrate/application_controller.rb +1 -0
- data/app/views/administrate/application/_collection.html.erb +7 -3
- data/app/views/administrate/application/_javascript.html.erb +3 -1
- data/app/views/administrate/application/_stylesheet.html.erb +14 -0
- data/app/views/administrate/application/show.html.erb +6 -1
- data/app/views/fields/date_time/_show.html.erb +1 -1
- data/app/views/fields/has_many/_show.html.erb +1 -1
- data/app/views/layouts/administrate/application.html.erb +1 -1
- data/lib/administrate/engine.rb +22 -0
- data/lib/administrate/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dcf61ca72126a4432eda744d07b390e1ec3b2da
|
4
|
+
data.tar.gz: 781a34ee9c1fad4f418908f34c2340f142f54b0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02e412ab411212d0c9a39cb54cac74f1c594c29c2076ed253d59b438af9f64f5d44a642e31db6108db3b3a685fd0ec726dbf28190687154861958726a037e200
|
7
|
+
data.tar.gz: 82e28834016669c8f48eca8e9028384abf6d4098e8f14f331654f1bbc7d425fd32e19f08afe7b677908b2021a9a0cce6bcce63cd6735903f35accd7fbc25e1b4
|
@@ -22,13 +22,17 @@ to display a collection of resources in an HTML table.
|
|
22
22
|
<thead>
|
23
23
|
<tr>
|
24
24
|
<% collection_presenter.attribute_types.each do |attr_name, attr_type| %>
|
25
|
-
<th class="cell-label
|
26
|
-
|
25
|
+
<th class="cell-label
|
26
|
+
cell-label--<%= attr_type.html_class %>
|
27
|
+
cell-label--<%= collection_presenter.ordered_html_class(attr_name) %>
|
27
28
|
" scope="col">
|
28
29
|
<%= link_to(params.merge(
|
29
30
|
collection_presenter.order_params_for(attr_name)
|
30
31
|
)) do %>
|
31
|
-
|
32
|
+
<%= t(
|
33
|
+
"helpers.label.#{resource_name}.#{attr_name}",
|
34
|
+
default: attr_name.to_s,
|
35
|
+
).titleize %>
|
32
36
|
|
33
37
|
<% if collection_presenter.ordered_by?(attr_name) %>
|
34
38
|
<span class="cell-label__sort-indicator cell-label__sort-indicator--<%= collection_presenter.ordered_html_class(attr_name) %>">
|
@@ -7,7 +7,9 @@ but each page can define additional JS sources
|
|
7
7
|
by providing a `content_for(:javascript)` block.
|
8
8
|
%>
|
9
9
|
|
10
|
-
|
10
|
+
<% Administrate::Engine.javascripts.each do |js_path| %>
|
11
|
+
<%= javascript_include_tag js_path %>
|
12
|
+
<% end %>
|
11
13
|
|
12
14
|
<%= yield :javascript %>
|
13
15
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%#
|
2
|
+
# Stylesheet Partial
|
3
|
+
|
4
|
+
This partial imports the necessary stylesheets on each page.
|
5
|
+
By default, it includes the application CSS,
|
6
|
+
but each page can define additional CSS sources
|
7
|
+
by providing a `content_for(:stylesheet)` block.
|
8
|
+
%>
|
9
|
+
|
10
|
+
<% Administrate::Engine.stylesheets.each do |css_path| %>
|
11
|
+
<%= stylesheet_link_tag css_path %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<%= yield :stylesheet %>
|
@@ -31,7 +31,12 @@ as well as a link to its edit page.
|
|
31
31
|
|
32
32
|
<dl>
|
33
33
|
<% page.attributes.each do |attribute| %>
|
34
|
-
<dt class="attribute-label"
|
34
|
+
<dt class="attribute-label">
|
35
|
+
<%= t(
|
36
|
+
"helpers.label.#{resource_name}.#{attribute.name}",
|
37
|
+
default: attribute.name.titleize,
|
38
|
+
) %>
|
39
|
+
</dt>
|
35
40
|
|
36
41
|
<dd class="attribute-data attribute-data--<%=attribute.html_class%>"
|
37
42
|
><%= render_field attribute %></dd>
|
@@ -19,7 +19,7 @@ By default, it renders:
|
|
19
19
|
<meta name="ROBOTS" content="NOODP" />
|
20
20
|
<meta name="viewport" content="initial-scale=1" />
|
21
21
|
<title><%= content_for(:title) %> | <%= Rails.application.class.parent_name.titlecase %></title>
|
22
|
-
<%=
|
22
|
+
<%= render "stylesheet" %>
|
23
23
|
<%= csrf_meta_tags %>
|
24
24
|
</head>
|
25
25
|
|
data/lib/administrate/engine.rb
CHANGED
@@ -20,6 +20,28 @@ module Administrate
|
|
20
20
|
class Engine < ::Rails::Engine
|
21
21
|
isolate_namespace Administrate
|
22
22
|
|
23
|
+
@@javascripts = []
|
24
|
+
@@stylesheets = []
|
25
|
+
|
23
26
|
Engine.config.assets.precompile << /\.(?:svg)\z/
|
27
|
+
|
28
|
+
def self.add_javascript(script)
|
29
|
+
@@javascripts << script
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.add_stylesheet(stylesheet)
|
33
|
+
@@stylesheets << stylesheet
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.stylesheets
|
37
|
+
@@stylesheets
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.javascripts
|
41
|
+
@@javascripts
|
42
|
+
end
|
43
|
+
|
44
|
+
add_javascript "administrate/application"
|
45
|
+
add_stylesheet "administrate/application"
|
24
46
|
end
|
25
47
|
end
|
data/lib/administrate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grayson Wright
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: autoprefixer-rails
|
@@ -208,6 +208,7 @@ files:
|
|
208
208
|
- app/views/administrate/application/_form.html.erb
|
209
209
|
- app/views/administrate/application/_javascript.html.erb
|
210
210
|
- app/views/administrate/application/_sidebar.html.erb
|
211
|
+
- app/views/administrate/application/_stylesheet.html.erb
|
211
212
|
- app/views/administrate/application/edit.html.erb
|
212
213
|
- app/views/administrate/application/index.html.erb
|
213
214
|
- app/views/administrate/application/new.html.erb
|
@@ -346,3 +347,4 @@ signing_key:
|
|
346
347
|
specification_version: 4
|
347
348
|
summary: A Rails engine for creating super-flexible admin dashboards
|
348
349
|
test_files: []
|
350
|
+
has_rdoc:
|