admin_interface 1.4.3 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile +8 -0
- data/README.rdoc +8 -37
- data/Rakefile +30 -0
- data/admin_interface.gemspec +319 -17
- data/app/helpers/admin/base_helper.rb +6 -0
- data/app/inputs/country_code_input.rb +10 -0
- data/config/locales/en.yml +3 -0
- data/lib/admin_interface/engine.rb +11 -1
- data/lib/admin_interface/version.rb +11 -0
- data/lib/generators/{admin_scaffold/USAGE → admin_interface/SCAFFOLD_USAGE} +0 -0
- data/lib/generators/admin_interface/scaffold_generator.rb +154 -0
- data/lib/generators/admin_interface/setup_generator.rb +59 -0
- data/lib/generators/admin_interface/templates/scaffold/INSTALL +12 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/controller.rb +0 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/functional_test.rb +0 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/helper.rb +0 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/helper_test.rb +0 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/layout.html.erb +0 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/style.css +0 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_edit.html.erb +3 -3
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_form_partial.html.erb +4 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_index.html.erb +3 -3
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_list_partial.html.erb +0 -0
- data/lib/generators/admin_interface/templates/scaffold/view_new.html.erb +10 -0
- data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_show.html.erb +1 -1
- data/lib/generators/admin_interface/templates/setup/INSTALL +2 -0
- data/lib/generators/admin_interface/templates/{controllers → setup/controllers}/base_controller.rb +2 -2
- data/lib/generators/admin_interface/templates/{controllers → setup/controllers}/resource_controller.rb +0 -0
- data/lib/generators/admin_interface/templates/{views → setup/views}/index.html.erb +0 -0
- data/lib/generators/admin_interface/templates/{views → setup/views}/layout.html.erb +0 -0
- data/vendor/assets/images/admin/map.png +0 -0
- data/vendor/assets/images/admin/slide_show.png +0 -0
- data/vendor/assets/images/admin/view.png +0 -0
- data/vendor/assets/images/admin/world.png +0 -0
- data/vendor/assets/images/admin/zoom_in.png +0 -0
- data/vendor/assets/images/admin/zoom_in.png.old +0 -0
- data/vendor/assets/stylesheets/admin_interface.css.scss +17 -2
- metadata +398 -64
- data/lib/generators/admin_interface/admin_interface_generator.rb +0 -50
- data/lib/generators/admin_interface/templates/INSTALL +0 -1
- data/lib/generators/admin_scaffold/admin_scaffold_generator.rb +0 -144
- data/lib/generators/admin_scaffold/templates/INSTALL +0 -1
- data/lib/generators/admin_scaffold/templates/view_new.html.erb +0 -10
- data/vendor/assets/images/admin/22x22/.svn/all-wcprops +0 -89
- data/vendor/assets/images/admin/22x22/.svn/entries +0 -210
- data/vendor/assets/images/admin/22x22/.svn/format +0 -1
- data/vendor/assets/images/admin/22x22/.svn/prop-base/authent.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/comment.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/file.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/info.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/notifications.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/options.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/package.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/plugin.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/projects.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/role.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/settings.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/tracker.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/users.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/prop-base/workflow.png.svn-base +0 -5
- data/vendor/assets/images/admin/22x22/.svn/text-base/authent.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/comment.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/file.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/info.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/notifications.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/options.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/package.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/plugin.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/projects.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/role.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/settings.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/tracker.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/users.png.svn-base +0 -0
- data/vendor/assets/images/admin/22x22/.svn/text-base/workflow.png.svn-base +0 -0
@@ -38,6 +38,12 @@ module Admin::BaseHelper
|
|
38
38
|
time.nil? ? '' : I18n.l(time)
|
39
39
|
end
|
40
40
|
|
41
|
+
# This is a replacement for Ransack's sort_link (https://github.com/ernie/ransack/blob/master/lib/ransack/helpers/form_helper.rb).
|
42
|
+
# It works for @search stuff and without @search stuff.
|
43
|
+
def order_link(ransack, attribute, options = {})
|
44
|
+
ransack ? sort_link(ransack, attribute, options) : attribute.to_s.humanize # FIXME: Model.human_attribute_name("title")
|
45
|
+
end
|
46
|
+
|
41
47
|
# Following are extra helper for kaminari gem (pagination).
|
42
48
|
# It shows similar to Redmine.
|
43
49
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Simple Form gem custom input (see: https://github.com/plataformatec/simple_form).
|
2
|
+
#
|
3
|
+
# Usage (in your simple_form):
|
4
|
+
# <%= form.input :country_code, :as => :country_code %>
|
5
|
+
#
|
6
|
+
class CountryCodeInput < SimpleForm::Inputs::Base
|
7
|
+
def input
|
8
|
+
@builder.country_code_select(attribute_name, input_options.delete(:priority), input_html_options) #, priority_countries, options)
|
9
|
+
end
|
10
|
+
end
|
@@ -1,4 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# Require gems
|
2
|
+
require 'kaminari' # pagination
|
3
|
+
require 'ransack' # search
|
4
|
+
require 'inherited_resources' # simple controllers
|
5
|
+
require 'simple_form' # simple forms
|
6
|
+
require 'dynamic_form' # error_messages method
|
7
|
+
require 'country_code_select' # country_select when having country_code attributes in your simple_forms
|
8
|
+
|
9
|
+
# Configure Rails 3.x to include assets.
|
2
10
|
module AdminInterface
|
3
11
|
|
4
12
|
class Engine < ::Rails::Engine
|
@@ -8,6 +16,8 @@ module AdminInterface
|
|
8
16
|
# Load helpers
|
9
17
|
# FIXME: Does this work correctly with __FILE__ instead of File.dirname(__FILE__)
|
10
18
|
config.autoload_paths << File.expand_path("../../../app/helpers", __FILE__)
|
19
|
+
# simple_form gem inputs (for country_helper)
|
20
|
+
# config.autoload_paths << File.expand_path("../../../app/inputs", __FILE__) # FIXME: this seems to be auto loaded
|
11
21
|
end
|
12
22
|
|
13
23
|
end
|
File without changes
|
@@ -0,0 +1,154 @@
|
|
1
|
+
require 'rails/generators/resource_helpers'
|
2
|
+
module AdminInterface
|
3
|
+
module Generators
|
4
|
+
class Scaffold < Rails::Generators::NamedBase
|
5
|
+
|
6
|
+
desc <<DESC
|
7
|
+
Description:
|
8
|
+
Scaffolds a admin controller and views.
|
9
|
+
DESC
|
10
|
+
|
11
|
+
# See: http://railsapi.com/doc/rails-v3.0.7/classes/Rails/Generators/ResourceHelpers.html
|
12
|
+
include Rails::Generators::ResourceHelpers
|
13
|
+
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
14
|
+
|
15
|
+
source_root File.expand_path("../templates", __FILE__)
|
16
|
+
|
17
|
+
CONTROLLER_PATH = 'app/controllers/admin'
|
18
|
+
# MODEL_PATH = 'app/models/admin'
|
19
|
+
VIEW_PATH = 'app/views/admin'
|
20
|
+
|
21
|
+
# default_options :skip_timestamps => false, :skip_migration => false, :force_plural => false
|
22
|
+
|
23
|
+
def controller_plural_name
|
24
|
+
@name.pluralize.downcase
|
25
|
+
end
|
26
|
+
|
27
|
+
alias_method :controller_file_name, :controller_file_name
|
28
|
+
alias_method :controller_table_name, :controller_plural_name
|
29
|
+
|
30
|
+
def check_class_collisions # TODO
|
31
|
+
# Check for class naming collisions.
|
32
|
+
# class_collisions class_path, "Admin::#{class_name}Controller"
|
33
|
+
end
|
34
|
+
|
35
|
+
def copy_controller_files
|
36
|
+
template 'scaffold/controller.rb', File.join(CONTROLLER_PATH, class_path, "#{controller_file_name}_controller.rb")
|
37
|
+
end
|
38
|
+
|
39
|
+
def create_admin_scaffold
|
40
|
+
@name = file_name
|
41
|
+
|
42
|
+
if @name == @name.pluralize && !options[:force_plural]
|
43
|
+
puts "Plural version of the model detected, using singularized version. Override with --force-plural."
|
44
|
+
@name = @name.singularize
|
45
|
+
end
|
46
|
+
|
47
|
+
for action in scaffold_views
|
48
|
+
template(
|
49
|
+
"scaffold/view_#{action}.html.erb",
|
50
|
+
File.join(VIEW_PATH, controller_class_path, controller_file_name, "#{action}.html.erb")
|
51
|
+
)
|
52
|
+
end
|
53
|
+
template 'scaffold/view_form_partial.html.erb', File.join(VIEW_PATH, controller_class_path, controller_file_name, "_form.html.erb")
|
54
|
+
|
55
|
+
readme 'scaffold/INSTALL'
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def scaffold_views
|
61
|
+
%w[ index show new edit ]
|
62
|
+
end
|
63
|
+
|
64
|
+
# def create_admin_scaffold
|
65
|
+
# @name = file_name
|
66
|
+
#
|
67
|
+
# if @name == @name.pluralize && !options[:force_plural]
|
68
|
+
# logger.warning "Plural version of the model detected, using singularized version. Override with --force-plural."
|
69
|
+
# @name = @name.singularize
|
70
|
+
# end
|
71
|
+
#
|
72
|
+
# @controller_name = @name.pluralize
|
73
|
+
#
|
74
|
+
# base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
|
75
|
+
# @controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
|
76
|
+
# @controller_singular_name=base_name.singularize
|
77
|
+
# if @controller_class_nesting.empty?
|
78
|
+
# @controller_class_name = @controller_class_name_without_nesting
|
79
|
+
# else
|
80
|
+
# @controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
|
81
|
+
# end
|
82
|
+
# end
|
83
|
+
#
|
84
|
+
# def manifest
|
85
|
+
# # Check for class naming collisions.
|
86
|
+
# # m.class_collisions("Admin::#{controller_class_name}Controller")
|
87
|
+
# # m.class_collisions(class_name)
|
88
|
+
#
|
89
|
+
# # Controller, helper, views, test and stylesheets directories.
|
90
|
+
# # m.directory(File.join('app/models', class_path))
|
91
|
+
# directory(File.join(CONTROLLER_PATH, controller_class_path))
|
92
|
+
# # m.directory(File.join('app/helpers', controller_class_path))
|
93
|
+
# directory(File.join(VIEW_PATH, controller_class_path, controller_file_name))
|
94
|
+
# # m.directory(File.join('app/views/layouts', controller_class_path))
|
95
|
+
# # m.directory(File.join('test/functional', controller_class_path))
|
96
|
+
# # m.directory(File.join('test/unit', class_path))
|
97
|
+
# # m.directory(File.join('test/unit/helpers', class_path))
|
98
|
+
# # m.directory(File.join('public/stylesheets', class_path))
|
99
|
+
#
|
100
|
+
# for action in scaffold_views
|
101
|
+
# template(
|
102
|
+
# "view_#{action}.html.erb",
|
103
|
+
# File.join(VIEW_PATH, controller_class_path, controller_file_name, "#{action}.html.erb")
|
104
|
+
# )
|
105
|
+
# end
|
106
|
+
# template 'view_form_partial.html.erb', File.join(VIEW_PATH, controller_class_path, controller_file_name, "_form.html.erb")
|
107
|
+
#
|
108
|
+
# # Layout and stylesheet.
|
109
|
+
# # m.template('layout.html.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.erb"))
|
110
|
+
# # m.template('style.css', 'public/stylesheets/scaffold.css')
|
111
|
+
#
|
112
|
+
# template(
|
113
|
+
# 'controller.rb', File.join(CONTROLLER_PATH, controller_class_path, "#{controller_file_name}_controller.rb")
|
114
|
+
# )
|
115
|
+
#
|
116
|
+
# # m.template('functional_test.rb', File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
|
117
|
+
# # m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb"))
|
118
|
+
# # m.template('helper_test.rb', File.join('test/unit/helpers', controller_class_path, "#{controller_file_name}_helper_test.rb"))
|
119
|
+
#
|
120
|
+
# # m.route_resources controller_file_name
|
121
|
+
#
|
122
|
+
# # m.dependency 'model', [name] + @args, :collision => :skip
|
123
|
+
#
|
124
|
+
# readme 'INSTALL'
|
125
|
+
# end
|
126
|
+
#
|
127
|
+
# protected
|
128
|
+
# # Override with your own usage banner.
|
129
|
+
# def banner
|
130
|
+
# "Usage: #{$0} scaffold ModelName [field:type, field:type]"
|
131
|
+
# end
|
132
|
+
#
|
133
|
+
# def add_options!(opt)
|
134
|
+
# opt.separator ''
|
135
|
+
# opt.separator 'Options:'
|
136
|
+
# opt.on("--skip-timestamps",
|
137
|
+
# "Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v }
|
138
|
+
# opt.on("--skip-migration",
|
139
|
+
# "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
|
140
|
+
# opt.on("--force-plural",
|
141
|
+
# "Forces the generation of a plural ModelName") { |v| options[:force_plural] = v }
|
142
|
+
# end
|
143
|
+
#
|
144
|
+
# def scaffold_views
|
145
|
+
# %w[ index show new edit ]
|
146
|
+
# end
|
147
|
+
#
|
148
|
+
# def model_name
|
149
|
+
# class_name.demodulize
|
150
|
+
# end
|
151
|
+
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module AdminInterface
|
2
|
+
module Generators
|
3
|
+
class SetupGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
desc <<DESC
|
6
|
+
Description:
|
7
|
+
Creates admin controller and needed routes.
|
8
|
+
DESC
|
9
|
+
|
10
|
+
source_root File.expand_path("../templates", __FILE__)
|
11
|
+
|
12
|
+
# def copy_image_files
|
13
|
+
# # Images
|
14
|
+
# # Copy all images to public/images/admin
|
15
|
+
# admin_image_dir = File.join('public', 'images', 'admin')
|
16
|
+
# directory('images', admin_image_dir)
|
17
|
+
# end
|
18
|
+
|
19
|
+
def copy_controller_files
|
20
|
+
copy_file("setup/controllers/base_controller.rb", "app/controllers/admin/base_controller.rb")
|
21
|
+
copy_file("setup/controllers/resource_controller.rb", "app/controllers/admin/resource_controller.rb")
|
22
|
+
end
|
23
|
+
|
24
|
+
def copy_view_files
|
25
|
+
copy_file("setup/views/layout.html.erb", "app/views/layouts/admin.html.erb")
|
26
|
+
copy_file("setup/views/index.html.erb", "app/views/admin/base/index.html.erb")
|
27
|
+
end
|
28
|
+
|
29
|
+
# def copy_javascript_files
|
30
|
+
# copy_file("javascripts/jquery.admin.js", "public/javascripts/jquery.admin.js")
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# def copy_stylesheet_files
|
34
|
+
# copy_file("views/admin.css", "public/stylesheets/admin.css")
|
35
|
+
# end
|
36
|
+
|
37
|
+
# Helper files are kept in the Engine Gem.
|
38
|
+
# def copy_helper_files
|
39
|
+
# copy_file("helpers/admin/base_helper.rb", "app/helpers/admin/base_helper.rb")
|
40
|
+
# end
|
41
|
+
|
42
|
+
def add_admin_route
|
43
|
+
route <<ROUTE
|
44
|
+
namespace :admin do
|
45
|
+
root :to => 'base#index'
|
46
|
+
# resources :some_model do
|
47
|
+
# delete 'destroy_all', :on => :collection
|
48
|
+
# end
|
49
|
+
end
|
50
|
+
ROUTE
|
51
|
+
end
|
52
|
+
|
53
|
+
def show_readme
|
54
|
+
readme('setup/INSTALL')
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Make sure the following is in your routes files:
|
2
|
+
|
3
|
+
namespace :admin do
|
4
|
+
root :to => 'base#index'
|
5
|
+
resources :model_name do
|
6
|
+
delete 'destroy_all', :on => :collection
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
Next enabled a new tab in app/controllers/admin/base_controller.rb.
|
11
|
+
|
12
|
+
Enjoy!
|
data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/controller.rb
RENAMED
File without changes
|
File without changes
|
data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/helper.rb
RENAMED
File without changes
|
data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/helper_test.rb
RENAMED
File without changes
|
data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/layout.html.erb
RENAMED
File without changes
|
data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/style.css
RENAMED
File without changes
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<div class="contextual">
|
2
|
-
<%%= link_to 'Show', [:admin, @<%= singular_name %>], :class => 'icon icon-
|
2
|
+
<%%= link_to 'Show', [:admin, @<%= singular_name %>], :class => 'icon icon-view' %>
|
3
3
|
<%%= link_to 'Destroy', [:admin, @<%= singular_name %>], :confirm => 'Are you sure?', :method => :delete, :class => 'icon icon-del' %>
|
4
4
|
</div>
|
5
5
|
|
6
|
-
<h2>Editing <%= singular_name %></h2>
|
6
|
+
<h2>Editing <%= singular_name.humanize %></h2>
|
7
7
|
|
8
|
-
<%%=
|
8
|
+
<%%= simple_form_for(@<%= singular_name %>, :url => [:admin, @<%= singular_name %>], :html => {:class => 'tabular'}) do |form| %>
|
9
9
|
<%%= form.error_messages %>
|
10
10
|
|
11
11
|
<%%= render :partial => form %>
|
@@ -8,9 +8,13 @@
|
|
8
8
|
|
9
9
|
<div class="box">
|
10
10
|
<% for attribute in attributes -%>
|
11
|
+
<% if false -%>
|
12
|
+
<!-- This is for normal forms -->
|
11
13
|
<p>
|
12
14
|
<%%= form.label :<%= attribute.name %> %>
|
13
15
|
<%%= form.<%= attribute.field_type %> :<%= attribute.name %> %>
|
14
16
|
</p>
|
17
|
+
<% end -%>
|
18
|
+
<%%= form.input :<%= attribute.name %> -%>
|
15
19
|
<% end -%>
|
16
20
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="contextual">
|
2
|
-
<%%= link_to 'New <%= singular_name %>', new_admin_<%= singular_name %>_path, :class => 'icon icon-add' %>
|
2
|
+
<%%= link_to 'New <%= singular_name.humanize %>', new_admin_<%= singular_name %>_path, :class => 'icon icon-add' %>
|
3
3
|
| <%%= search_form_for @search, :url => collection_url do |f| %>
|
4
4
|
<%%
|
5
5
|
# Check https://github.com/ernie/ransack for options.
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<h2>
|
13
13
|
<%= # FIXME: parent? doesn't always work :S
|
14
14
|
link_to(parent.to_s, [:admin, parent]) + " >".html_safe if defined?(parent) && parent?
|
15
|
-
|
15
|
+
-%>
|
16
16
|
<%= plural_name.humanize %>
|
17
17
|
</h2>
|
18
18
|
|
@@ -41,7 +41,7 @@
|
|
41
41
|
<td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
|
42
42
|
<% end -%>
|
43
43
|
<td class="buttons">
|
44
|
-
<%%= link_to 'Show', [:admin, <%= singular_name %>], :class => 'icon icon-
|
44
|
+
<%%= link_to 'Show', [:admin, <%= singular_name %>], :class => 'icon icon-view' %>
|
45
45
|
<%%= link_to 'Edit', edit_admin_<%= singular_name %>_path(<%= singular_name %>), :class => 'icon icon-edit' %>
|
46
46
|
<%%= link_to 'Destroy', [:admin, <%= singular_name %>], :confirm => 'Are you sure?', :method => :delete, :class => 'icon icon-del' %>
|
47
47
|
</td>
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<h2>New <%= singular_name.humanize %></h2>
|
2
|
+
|
3
|
+
<%%= simple_form_for(@<%= singular_name %>, :url => [:admin, @<%= singular_name %>], :html => {:class => 'tabular'}) do |form| %>
|
4
|
+
<%%= form.error_messages %>
|
5
|
+
|
6
|
+
<%%= render :partial => form %>
|
7
|
+
|
8
|
+
<%%= form.submit 'Create' %>
|
9
|
+
<%%= link_to 'Back', admin_<%= plural_name %>_path %>
|
10
|
+
<%% end %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%%= link_to 'Destroy', [:admin, @<%= singular_name %>], :confirm => 'Are you sure?', :method => :delete, :class => 'icon icon-del' %>
|
4
4
|
</div>
|
5
5
|
|
6
|
-
<h2><%= singular_name.
|
6
|
+
<h2><%= singular_name.humanize %> <%%= @<%= singular_name %>.id %></h2>
|
7
7
|
|
8
8
|
<div class="box">
|
9
9
|
<% for attribute in attributes -%>
|
data/lib/generators/admin_interface/templates/{controllers → setup/controllers}/base_controller.rb
RENAMED
@@ -20,8 +20,8 @@ class Admin::BaseController < ApplicationController
|
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
ADMIN_USERNAME = 'admin'
|
24
|
-
ADMIN_PASSWORD = 'admin'
|
23
|
+
ADMIN_USERNAME = 'admin' # HTTP Basic admin username
|
24
|
+
ADMIN_PASSWORD = 'admin' # HTTP Basic admin password
|
25
25
|
|
26
26
|
def http_authentication
|
27
27
|
authenticate_or_request_with_http_basic do |username, password|
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -4,6 +4,11 @@
|
|
4
4
|
color: #DD0000;
|
5
5
|
}
|
6
6
|
|
7
|
+
span.error {
|
8
|
+
color: #DD0000;
|
9
|
+
padding: 4px;
|
10
|
+
}
|
11
|
+
|
7
12
|
label.disabled {
|
8
13
|
color: lightgray;
|
9
14
|
}
|
@@ -14,7 +19,6 @@ div.input {
|
|
14
19
|
height: 1%;
|
15
20
|
margin: 0;
|
16
21
|
padding: 5px 0 8px 180px;
|
17
|
-
border: 1px solid #D7D7D7;
|
18
22
|
}
|
19
23
|
|
20
24
|
/***** Custom additions to Redmine *****/
|
@@ -38,6 +42,12 @@ div.flash.alert {
|
|
38
42
|
text-align: left;
|
39
43
|
}
|
40
44
|
|
45
|
+
/* Used for form hints */
|
46
|
+
.hint {
|
47
|
+
display: block;
|
48
|
+
font-size: 0.8em;
|
49
|
+
}
|
50
|
+
|
41
51
|
/***** NOTE: Copied from Redmine (application) *****/
|
42
52
|
|
43
53
|
/*
|
@@ -923,6 +933,11 @@ padding-bottom: 3px;
|
|
923
933
|
.icon-call { background-image: image-url('admin/call.gif'); }
|
924
934
|
.icon-call-in { background-image: image-url('admin/call_in.png'); }
|
925
935
|
.icon-call-out { background-image: image-url('admin/call_out.png'); }
|
936
|
+
.icon-slide-show { background-image: image-url('admin/slide_show.png'); }
|
937
|
+
.icon-view { background-image: image-url('admin/view.png'); }
|
938
|
+
.icon-map { background-image: image-url('admin/map.png'); }
|
939
|
+
.icon-world { background-image: image-url('admin/world.png'); }
|
940
|
+
.icon-page-go { background-image: image-url('admin/page_go.png'); }
|
926
941
|
|
927
942
|
.icon-file { background-image: image-url('admin/files/default.png'); }
|
928
943
|
.icon-file.text-plain { background-image: image-url('admin/files/text.png'); }
|
@@ -1072,7 +1087,7 @@ input[type="button"], input[type="submit"], input[type="reset"] { background-col
|
|
1072
1087
|
input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover { background-color: #ccccbb; }
|
1073
1088
|
|
1074
1089
|
/* Fields */
|
1075
|
-
input[type="text"], input[type="password"], textarea, select { padding: 2px; border: 1px solid #d7d7d7; }
|
1090
|
+
input[type="text"], input[type="number"], input[type="tel"], input[type="email"], input[type="password"], input[type="url"], textarea, select { padding: 2px; border: 1px solid #d7d7d7; }
|
1076
1091
|
input[type="text"], input[type="password"] { padding: 3px; }
|
1077
1092
|
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus { border: 1px solid #888866; }
|
1078
1093
|
option { border-bottom: 1px dotted #d7d7d7; }
|