drh_admin 0.0.3 → 0.0.4
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/lib/generators/admin/admin_generator.rb +1 -0
- data/lib/generators/admin/templates/app/controllers/admin/admin_controller.rb +1 -0
- data/lib/generators/admin/templates/app/views/admin/model/index.html.erb +1 -1
- data/lib/generators/admin/templates/app/views/admin/model/show.html.erb +1 -1
- data/lib/generators/admin/templates/app/views/layouts/admin.html.erb +1 -3
- metadata +7 -7
@@ -37,6 +37,7 @@ class AdminGenerator < Rails::Generators::Base
|
|
37
37
|
@@models[k].each do |model|
|
38
38
|
@orm = k
|
39
39
|
@model = model
|
40
|
+
@reserved_title_names = @@reserved_title_names
|
40
41
|
|
41
42
|
if @orm == :activerecord
|
42
43
|
@fields = @model.new.attributes.keys - @model.protected_attributes.to_a
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<tr>
|
12
12
|
<% @fields.each do |field_name| -%>
|
13
13
|
<td>
|
14
|
-
<% if
|
14
|
+
<% if @reserved_title_names.include? field_name -%>
|
15
15
|
<%%= link_to "#{<%=model_name%>.<%=field_name %>}", admin_<%=model_name%>_path(<%=model_name %>) %>
|
16
16
|
<% else -%>
|
17
17
|
<%%= <%=model_name%>.<%=field_name %> %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% model_name = @model.name.underscore -%>
|
2
2
|
<% modelName = @model.name -%>
|
3
|
-
<% title_fields =
|
3
|
+
<% title_fields = @reserved_title_names.select {|f| @fields.include? f}-%>
|
4
4
|
<% if title_fields.any? -%>
|
5
5
|
<div class="top-bar">
|
6
6
|
<h1><%%= @<%=model_name %>.<%=title_fields[0]%>%></h1>
|
@@ -4,10 +4,8 @@
|
|
4
4
|
<title>Admin</title>
|
5
5
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
6
6
|
<%%= javascript_include_tag "admin/admin" %>
|
7
|
-
<%%= javascript_include_tag params[:controller]%>
|
8
|
-
|
9
|
-
<%%= stylesheet_link_tag params[:controller]%>
|
10
7
|
<%%= stylesheet_link_tag "admin/admin"%>
|
8
|
+
<%%= stylesheet_link_tag "admin/auth"%>
|
11
9
|
|
12
10
|
<%%= yield :scripts %>
|
13
11
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drh_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,9 +9,9 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-04 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
14
|
+
description: A simple html5 admin template gem
|
15
15
|
email: drh@wafflestudio.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
@@ -103,7 +103,7 @@ files:
|
|
103
103
|
- lib/generators/admin/templates/config/admin.yml
|
104
104
|
- lib/generators/admin/templates/script/new_admin
|
105
105
|
- lib/generators/admin/USAGE
|
106
|
-
homepage:
|
106
|
+
homepage: ''
|
107
107
|
licenses: []
|
108
108
|
post_install_message:
|
109
109
|
rdoc_options: []
|
@@ -122,9 +122,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubyforge_project:
|
126
|
-
rubygems_version: 1.8.
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 1.8.10
|
127
127
|
signing_key:
|
128
128
|
specification_version: 3
|
129
|
-
summary:
|
129
|
+
summary: A simple html5 admin template gem
|
130
130
|
test_files: []
|