typus 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +86 -0
- data/Rakefile +61 -0
- data/VERSION +1 -0
- data/app/controllers/admin/master_controller.rb +354 -0
- data/app/controllers/typus_controller.rb +128 -0
- data/app/helpers/admin/form_helper.rb +386 -0
- data/app/helpers/admin/master_helper.rb +104 -0
- data/app/helpers/admin/public_helper.rb +27 -0
- data/app/helpers/admin/sidebar_helper.rb +236 -0
- data/app/helpers/admin/table_helper.rb +227 -0
- data/app/helpers/typus_helper.rb +194 -0
- data/app/models/typus_mailer.rb +14 -0
- data/app/models/typus_user.rb +5 -0
- data/app/views/admin/dashboard/_sidebar.html.erb +9 -0
- data/app/views/admin/resources/edit.html.erb +24 -0
- data/app/views/admin/resources/index.html.erb +23 -0
- data/app/views/admin/resources/new.html.erb +22 -0
- data/app/views/admin/resources/show.html.erb +18 -0
- data/app/views/admin/shared/_footer.html.erb +1 -0
- data/app/views/admin/shared/_pagination.html.erb +28 -0
- data/app/views/layouts/admin.html.erb +73 -0
- data/app/views/layouts/typus.html.erb +29 -0
- data/app/views/typus/dashboard.html.erb +9 -0
- data/app/views/typus/recover_password.html.erb +7 -0
- data/app/views/typus/reset_password.html.erb +15 -0
- data/app/views/typus/sign_in.html.erb +9 -0
- data/app/views/typus/sign_up.html.erb +7 -0
- data/app/views/typus_mailer/reset_password_link.erb +11 -0
- data/config/locales/typus/de.yml +109 -0
- data/config/locales/typus/es.yml +109 -0
- data/config/locales/typus/language.yml.template +113 -0
- data/config/locales/typus/pt-BR.yml +111 -0
- data/config/locales/typus/ru.yml +111 -0
- data/generators/typus/templates/config/initializers/typus.rb +33 -0
- data/generators/typus/templates/config/typus/README +51 -0
- data/generators/typus/templates/config/typus/application.yml +6 -0
- data/generators/typus/templates/config/typus/application_roles.yml +23 -0
- data/generators/typus/templates/config/typus/typus.yml +14 -0
- data/generators/typus/templates/config/typus/typus_roles.yml +2 -0
- data/generators/typus/templates/db/create_typus_users.rb +21 -0
- data/generators/typus/templates/public/images/admin/arrow_down.gif +0 -0
- data/generators/typus/templates/public/images/admin/arrow_up.gif +0 -0
- data/generators/typus/templates/public/images/admin/spinner.gif +0 -0
- data/generators/typus/templates/public/images/admin/status_false.gif +0 -0
- data/generators/typus/templates/public/images/admin/status_true.gif +0 -0
- data/generators/typus/templates/public/images/admin/trash.gif +0 -0
- data/generators/typus/templates/public/javascripts/admin/application.js +14 -0
- data/generators/typus/templates/public/stylesheets/admin/reset.css +68 -0
- data/generators/typus/templates/public/stylesheets/admin/screen.css +729 -0
- data/generators/typus/typus_generator.rb +122 -0
- data/generators/typus_update_schema_to_01/templates/config/typus.yml +14 -0
- data/generators/typus_update_schema_to_01/templates/migration.rb +11 -0
- data/generators/typus_update_schema_to_01/typus_update_schema_to_01_generator.rb +19 -0
- data/lib/typus.rb +122 -0
- data/lib/typus/active_record.rb +307 -0
- data/lib/typus/authentication.rb +142 -0
- data/lib/typus/configuration.rb +85 -0
- data/lib/typus/extensions/routes.rb +15 -0
- data/lib/typus/format.rb +55 -0
- data/lib/typus/generator.rb +81 -0
- data/lib/typus/hash.rb +8 -0
- data/lib/typus/locale.rb +17 -0
- data/lib/typus/object.rb +21 -0
- data/lib/typus/quick_edit.rb +40 -0
- data/lib/typus/reloader.rb +15 -0
- data/lib/typus/string.rb +11 -0
- data/lib/typus/templates/index.html.erb +11 -0
- data/lib/typus/templates/resource_controller.rb.erb +15 -0
- data/lib/typus/templates/resource_controller_test.rb.erb +10 -0
- data/lib/typus/templates/resources_controller.rb.erb +37 -0
- data/lib/typus/user.rb +134 -0
- data/lib/vendor/active_record.rb +15 -0
- data/lib/vendor/paginator.rb +143 -0
- data/rails/init.rb +3 -0
- data/tasks/typus_tasks.rake +32 -0
- data/test/config/broken/application.yml +68 -0
- data/test/config/broken/application_roles.yml +20 -0
- data/test/config/broken/empty.yml +0 -0
- data/test/config/broken/empty_roles.yml +0 -0
- data/test/config/broken/undefined.yml +3 -0
- data/test/config/broken/undefined_roles.yml +6 -0
- data/test/config/default/typus.yml +14 -0
- data/test/config/default/typus_roles.yml +2 -0
- data/test/config/empty/empty_01.yml +0 -0
- data/test/config/empty/empty_01_roles.yml +0 -0
- data/test/config/empty/empty_02.yml +0 -0
- data/test/config/empty/empty_02_roles.yml +0 -0
- data/test/config/locales/es.yml +10 -0
- data/test/config/ordered/001_roles.yml +2 -0
- data/test/config/ordered/002_roles.yml +2 -0
- data/test/config/unordered/app_one_roles.yml +2 -0
- data/test/config/unordered/app_two_roles.yml +2 -0
- data/test/config/working/application.yml +68 -0
- data/test/config/working/application_roles.yml +22 -0
- data/test/config/working/typus.yml +14 -0
- data/test/config/working/typus_roles.yml +2 -0
- data/test/fixtures/app/controllers/admin/assets_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/categories_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/comments_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/pages_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/posts_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/status_controller.rb +6 -0
- data/test/fixtures/app/controllers/admin/typus_users_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/watch_dog_controller.rb +6 -0
- data/test/fixtures/app/views/admin/comments/_edit.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_index.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_new.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_show.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/dashboard/_content.html.erb +1 -0
- data/test/fixtures/app/views/admin/dashboard/_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/resources/_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/shared/_footer.html.erb +1 -0
- data/test/fixtures/app/views/admin/status/index.html.erb +1 -0
- data/test/fixtures/app/views/admin/templates/_datepicker.html.erb +1 -0
- data/test/fixtures/assets.yml +11 -0
- data/test/fixtures/categories.yml +14 -0
- data/test/fixtures/comments.yml +27 -0
- data/test/fixtures/pages.yml +41 -0
- data/test/fixtures/posts.yml +37 -0
- data/test/fixtures/typus_users.yml +54 -0
- data/test/functional/admin/assets_controller_test.rb +57 -0
- data/test/functional/admin/categories_controller_test.rb +106 -0
- data/test/functional/admin/comments_controller_test.rb +120 -0
- data/test/functional/admin/master_controller_test.rb +5 -0
- data/test/functional/admin/posts_controller_test.rb +261 -0
- data/test/functional/admin/status_controller_test.rb +43 -0
- data/test/functional/admin/typus_users_controller_test.rb +239 -0
- data/test/functional/typus_controller_test.rb +321 -0
- data/test/helper.rb +51 -0
- data/test/helpers/admin/form_helper_test.rb +337 -0
- data/test/helpers/admin/master_helper_test.rb +69 -0
- data/test/helpers/admin/public_helper_test.rb +26 -0
- data/test/helpers/admin/sidebar_helper_test.rb +335 -0
- data/test/helpers/admin/table_helper_test.rb +239 -0
- data/test/helpers/typus_helper_test.rb +117 -0
- data/test/lib/active_record_test.rb +382 -0
- data/test/lib/configuration_test.rb +94 -0
- data/test/lib/hash_test.rb +11 -0
- data/test/lib/routes_test.rb +71 -0
- data/test/lib/string_test.rb +25 -0
- data/test/lib/typus_test.rb +85 -0
- data/test/models.rb +51 -0
- data/test/schema.rb +64 -0
- data/test/unit/typus_mailer_test.rb +33 -0
- data/test/unit/typus_test.rb +17 -0
- data/test/unit/typus_user_roles_test.rb +90 -0
- data/test/unit/typus_user_test.rb +177 -0
- data/test/vendor/active_record_test.rb +18 -0
- data/test/vendor/paginator_test.rb +136 -0
- data/typus.gemspec +228 -0
- metadata +241 -0
@@ -0,0 +1,194 @@
|
|
1
|
+
module TypusHelper
|
2
|
+
|
3
|
+
##
|
4
|
+
# Applications list on the dashboard
|
5
|
+
#
|
6
|
+
def applications
|
7
|
+
|
8
|
+
returning(String.new) do |html|
|
9
|
+
|
10
|
+
Typus.applications.each do |app|
|
11
|
+
|
12
|
+
available = Typus.application(app).map do |resource|
|
13
|
+
resource if @current_user.resources.include?(resource)
|
14
|
+
end
|
15
|
+
next if available.compact.empty?
|
16
|
+
|
17
|
+
html << <<-HTML
|
18
|
+
<table class="typus">
|
19
|
+
<tr>
|
20
|
+
<th colspan="2">#{app}</th>
|
21
|
+
</tr>
|
22
|
+
HTML
|
23
|
+
|
24
|
+
available.compact.each do |model|
|
25
|
+
|
26
|
+
klass = model.constantize
|
27
|
+
klass_resource = klass.name.tableize
|
28
|
+
|
29
|
+
admin_items_path = { :controller => "admin/#{klass_resource}" }
|
30
|
+
new_admin_item_path = { :controller => "admin/#{klass_resource}", :action => 'new'}
|
31
|
+
|
32
|
+
html << <<-HTML
|
33
|
+
<tr class="#{cycle('even', 'odd')}">
|
34
|
+
<td>#{link_to klass.typus_human_name.pluralize, admin_items_path}<br /><small>#{klass.typus_description}</small></td>
|
35
|
+
<td class="right"><small>
|
36
|
+
#{link_to _("Add"), new_admin_item_path if @current_user.can_perform?(klass, 'create')}
|
37
|
+
</small></td>
|
38
|
+
</tr>
|
39
|
+
HTML
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
html << <<-HTML
|
44
|
+
</table>
|
45
|
+
HTML
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Resources (wich are not models) on the dashboard.
|
55
|
+
#
|
56
|
+
def resources
|
57
|
+
|
58
|
+
available = Typus.resources.map do |resource|
|
59
|
+
resource if @current_user.resources.include?(resource)
|
60
|
+
end
|
61
|
+
return if available.compact.empty?
|
62
|
+
|
63
|
+
returning(String.new) do |html|
|
64
|
+
|
65
|
+
html << <<-HTML
|
66
|
+
<table class="typus">
|
67
|
+
<tr>
|
68
|
+
<th colspan="2">#{_("Resources")}</th>
|
69
|
+
</tr>
|
70
|
+
HTML
|
71
|
+
|
72
|
+
available.compact.each do |resource|
|
73
|
+
|
74
|
+
resource_path = { :controller => "admin/#{resource.underscore}" }
|
75
|
+
|
76
|
+
html << <<-HTML
|
77
|
+
<tr class="#{cycle('even', 'odd')}">
|
78
|
+
<td>#{link_to _(resource.humanize), resource_path}</td>
|
79
|
+
<td align="right" style="vertical-align: bottom;"></td>
|
80
|
+
</tr>
|
81
|
+
HTML
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
html << <<-HTML
|
86
|
+
</table>
|
87
|
+
HTML
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
def typus_block(*args)
|
94
|
+
|
95
|
+
options = args.extract_options!
|
96
|
+
|
97
|
+
partials_path = "admin/#{options[:location]}"
|
98
|
+
resources_partials_path = 'admin/resources'
|
99
|
+
|
100
|
+
partials = ActionController::Base.view_paths.map do |view_path|
|
101
|
+
Dir["#{view_path.path}/#{partials_path}/*"].map { |f| File.basename(f, '.html.erb') }
|
102
|
+
end.flatten
|
103
|
+
resources_partials = Dir["#{Rails.root}/app/views/#{resources_partials_path}/*"].map { |f| File.basename(f, '.html.erb') }
|
104
|
+
|
105
|
+
partial = "_#{options[:partial]}"
|
106
|
+
|
107
|
+
path = if partials.include?(partial) then partials_path
|
108
|
+
elsif resources_partials.include?(partial) then resources_partials_path
|
109
|
+
end
|
110
|
+
|
111
|
+
render :partial => "#{path}/#{options[:partial]}" if path
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
def page_title(action = params[:action])
|
116
|
+
crumbs = [ ]
|
117
|
+
crumbs << @resource[:class].typus_human_name.pluralize if @resource
|
118
|
+
crumbs << _(action.humanize) unless %w( index ).include?(action)
|
119
|
+
return "#{Typus::Configuration.options[:app_name]} - " + crumbs.compact.map { |x| x }.join(' › ')
|
120
|
+
end
|
121
|
+
|
122
|
+
def header
|
123
|
+
|
124
|
+
links = []
|
125
|
+
links << "<li>#{link_to_unless_current _("Dashboard"), admin_dashboard_path}</li>"
|
126
|
+
|
127
|
+
Typus.models_on_header.each do |model|
|
128
|
+
links << "<li>#{link_to_unless_current model.constantize.typus_human_name.pluralize, :controller => "/admin/#{model.tableize}"}</li>"
|
129
|
+
end
|
130
|
+
|
131
|
+
if ActionController::Routing::Routes.named_routes.routes.keys.include?(:root)
|
132
|
+
links << "<li>#{link_to _("View site"), root_path, :target => 'blank'}</li>"
|
133
|
+
end
|
134
|
+
|
135
|
+
<<-HTML
|
136
|
+
<h1>#{Typus::Configuration.options[:app_name]}</h1>
|
137
|
+
<ul>
|
138
|
+
#{links.join("\n")}
|
139
|
+
</ul>
|
140
|
+
HTML
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
def login_info(user = @current_user)
|
145
|
+
|
146
|
+
admin_edit_typus_user_path = { :controller => "admin/#{Typus::Configuration.options[:user_class_name].tableize}",
|
147
|
+
:action => 'edit',
|
148
|
+
:id => user.id }
|
149
|
+
|
150
|
+
message = _("Are you sure you want to sign out and end your session?")
|
151
|
+
|
152
|
+
<<-HTML
|
153
|
+
<ul>
|
154
|
+
<li>#{_("Logged as")} #{link_to user.name, admin_edit_typus_user_path, :title => "#{user.email} (#{user.role})"}</li>
|
155
|
+
<li>#{link_to _("Sign out"), admin_sign_out_path, { :confirm => message } }</li>
|
156
|
+
</ul>
|
157
|
+
HTML
|
158
|
+
|
159
|
+
end
|
160
|
+
|
161
|
+
def display_flash_message(message = flash)
|
162
|
+
|
163
|
+
return if message.empty?
|
164
|
+
flash_type = message.keys.first
|
165
|
+
|
166
|
+
<<-HTML
|
167
|
+
<div id="flash" class="#{flash_type}">
|
168
|
+
<p>#{message[flash_type]}</p>
|
169
|
+
</div>
|
170
|
+
HTML
|
171
|
+
|
172
|
+
end
|
173
|
+
|
174
|
+
def typus_message(message, html_class = 'notice')
|
175
|
+
<<-HTML
|
176
|
+
<div id="flash" class="#{html_class}">
|
177
|
+
<p>#{message}</p>
|
178
|
+
</div>
|
179
|
+
HTML
|
180
|
+
end
|
181
|
+
|
182
|
+
def locales(uri = admin_set_locale_path)
|
183
|
+
|
184
|
+
return unless Typus.locales.many?
|
185
|
+
|
186
|
+
locale_links = Typus.locales.map { |l| "<a href=\"#{uri}?locale=#{l.last}\">#{l.first.downcase}</a>" }
|
187
|
+
|
188
|
+
<<-HTML
|
189
|
+
<p>#{_("Set language to")} #{locale_links.join(', ')}.</p>
|
190
|
+
HTML
|
191
|
+
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class TypusMailer < ActionMailer::Base
|
2
|
+
|
3
|
+
self.template_root = "#{File.dirname(__FILE__)}/../views"
|
4
|
+
|
5
|
+
def reset_password_link(user)
|
6
|
+
@subject = "[#{Typus::Configuration.options[:app_name]}] #{_("Reset password")}"
|
7
|
+
@body = { :user => user }
|
8
|
+
@recipients = user.email
|
9
|
+
@from = Typus::Configuration.options[:email]
|
10
|
+
@sent_on = Time.now
|
11
|
+
@headers = {}
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<h2>Welcome to Typus!</h2>
|
2
|
+
|
3
|
+
<p>Documentation is available <%= link_to 'here', 'http://intraducibles.com/projects/typus', :rel => 'external' %>.</p>
|
4
|
+
|
5
|
+
<p>If you need help don't hesitate in joining the <%= link_to 'Typus', 'http://groups.google.com/group/typus', :rel => 'external' %> mailing list.</p>
|
6
|
+
|
7
|
+
<p>Remember you can replace this sidebar adding <code>_sidebar.html.erb</code> file on <code>app/views/admin/dashboard</code> folder.</p>
|
8
|
+
|
9
|
+
<p>Have a nice day!</p>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% content_for :sidebar do %>
|
2
|
+
<%= typus_block :location => @resource[:self], :partial => 'sidebar' %>
|
3
|
+
<%= actions %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<%= display_link_to_previous if params[:back_to] %>
|
7
|
+
|
8
|
+
<h2><%= link_to @resource[:class].typus_human_name.pluralize, :action => 'index' %> ›
|
9
|
+
<%= _("Edit") %></h2>
|
10
|
+
|
11
|
+
<%= typus_block :location => @resource[:self], :partial => 'edit' %>
|
12
|
+
|
13
|
+
<% form_for @item,
|
14
|
+
:url => { :action => 'update',
|
15
|
+
:id => @item.id ,
|
16
|
+
:back_to => params[:back_to],
|
17
|
+
:resource => params[:resource],
|
18
|
+
:resource_id => params[:resource_id]},
|
19
|
+
:html => { :multipart => true } do |f| %>
|
20
|
+
<%= build_form(@fields) %>
|
21
|
+
<p><%= submit_tag _("Update entry"), :class => 'button' %></p>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= typus_relationships %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% content_for :sidebar do %>
|
2
|
+
<%= typus_block :location => @resource[:self], :partial => 'sidebar' %>
|
3
|
+
<%= actions %>
|
4
|
+
<%= search %>
|
5
|
+
<%= filters %>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<h2><%= @resource[:class].typus_human_name.pluralize %> <%= remove_filter_link %></h2>
|
9
|
+
|
10
|
+
<%= typus_block :location => @resource[:self], :partial => 'index' %>
|
11
|
+
|
12
|
+
<% unless @items.count.zero? -%>
|
13
|
+
<%= build_list(@resource[:class], @fields, @items) %>
|
14
|
+
<%= pagination %>
|
15
|
+
<% else %>
|
16
|
+
<div id="flash" class="notice">
|
17
|
+
<% if @resource[:class].count.zero? %>
|
18
|
+
<p><%= _("There are no {{records}}.", :records => @resource[:class].typus_human_name.pluralize.downcase) %></p>
|
19
|
+
<% else %>
|
20
|
+
<p><%= _("There are no {{records}} under this filter.", :records => @resource[:class].typus_human_name.pluralize.downcase) %></p>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% content_for :sidebar do %>
|
2
|
+
<%= typus_block :location => @resource[:self], :partial => 'sidebar' %>
|
3
|
+
<%= actions %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<%= display_link_to_previous if params[:back_to] %>
|
7
|
+
|
8
|
+
<h2><%= link_to @resource[:class].typus_human_name.pluralize, :action => 'index' %> ›
|
9
|
+
<%= _("New") %></h2>
|
10
|
+
|
11
|
+
<%= typus_block :location => @resource[:self], :partial => 'new' %>
|
12
|
+
|
13
|
+
<% form_for @item,
|
14
|
+
:url => { :action => 'create',
|
15
|
+
:back_to => params[:back_to],
|
16
|
+
:selected => params[:selected],
|
17
|
+
:resource => params[:resource],
|
18
|
+
:resource_id => params[:resource_id] },
|
19
|
+
:html => { :multipart => true } do |f| %>
|
20
|
+
<%= build_form(@fields) %>
|
21
|
+
<p><%= submit_tag _("Create entry"), :class => 'button' %></p>
|
22
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% content_for :sidebar do %>
|
2
|
+
<%= typus_block :location => @resource[:self], :partial => 'sidebar' %>
|
3
|
+
<%= actions %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<h2><%= link_to @resource[:class].typus_human_name.pluralize, :action => 'index' %> ›
|
7
|
+
<%= _("Show") %></h2>
|
8
|
+
|
9
|
+
<%= typus_block :location => @resource[:self], :partial => 'show' %>
|
10
|
+
|
11
|
+
<dl>
|
12
|
+
<%- @fields.map { |u| u.first }.each do |column| -%>
|
13
|
+
<dt><%=h @resource[:class].human_attribute_name(column) %></dt>
|
14
|
+
<dd><%=h (!@item.send(column).blank?) ? @item.send(column) : 'nil' %></dd>
|
15
|
+
<%- end -%>
|
16
|
+
</dl>
|
17
|
+
|
18
|
+
<%= typus_relationships %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<p><%= link_to 'Typus', 'http://intraducibles.com/projects/typus', :rel => 'external' %> is the effortless backend interface for <%= link_to 'Ruby on Rails', 'http://rubyonrails.org/', :rel => 'external' %> applications.</p>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div class="pagination">
|
2
|
+
|
3
|
+
<% if @items.prev? %>
|
4
|
+
<%= link_to _("← Previous"), params.merge(:page => @items.prev.number, :anchor => @options[:anchor]) %>
|
5
|
+
<% else %>
|
6
|
+
<span class="disabled"><%= _("← Previous") %></span>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% last_page = 0 -%>
|
10
|
+
|
11
|
+
<% build_pagination(@pager) do |n| -%>
|
12
|
+
<% if @items.number == n -%>
|
13
|
+
<span class="current"><%= n %></span>
|
14
|
+
<% else -%>
|
15
|
+
<%= "..." if last_page + 1 < n %>
|
16
|
+
<%= link_to n, params.merge(:page => n, :anchor => @options[:anchor]) %>
|
17
|
+
<% end -%>
|
18
|
+
<% last_page = n -%>
|
19
|
+
|
20
|
+
<% end -%>
|
21
|
+
|
22
|
+
<% if @items.next? %>
|
23
|
+
<%= link_to _("Next →"), params.merge(:page => @items.next.number, :anchor => @options[:anchor]) %>
|
24
|
+
<% else %>
|
25
|
+
<span class="disabled"><%= _("Next →") %></span>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
</div>
|
@@ -0,0 +1,73 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
|
6
|
+
<head>
|
7
|
+
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
9
|
+
|
10
|
+
<title><%= page_title %></title>
|
11
|
+
|
12
|
+
<%= stylesheet_link_tag 'admin/reset', :media => 'screen' %>
|
13
|
+
<%= stylesheet_link_tag 'admin/screen', :media => 'screen' %>
|
14
|
+
<%= yield :stylesheets -%>
|
15
|
+
|
16
|
+
<%= javascript_include_tag 'admin/application' %>
|
17
|
+
<%= include_tiny_mce_if_needed if defined?(TinyMCE) %>
|
18
|
+
<%= yield :javascripts -%>
|
19
|
+
|
20
|
+
</head>
|
21
|
+
|
22
|
+
<body>
|
23
|
+
|
24
|
+
<div id="header_wrapper">
|
25
|
+
|
26
|
+
<div id="header">
|
27
|
+
<div class="left">
|
28
|
+
<%= header %>
|
29
|
+
</div>
|
30
|
+
<div class="right">
|
31
|
+
<%= login_info %>
|
32
|
+
</div>
|
33
|
+
<div class="clear"></div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="wrapper">
|
39
|
+
|
40
|
+
<div id="content_wrapper">
|
41
|
+
|
42
|
+
<div id="content">
|
43
|
+
<%= display_flash_message %>
|
44
|
+
<%= yield %>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="sidebar">
|
48
|
+
<%= yield :sidebar %>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div class="clear"></div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="footer_wrapper">
|
58
|
+
|
59
|
+
<div id="footer">
|
60
|
+
<div class="left">
|
61
|
+
<%= typus_block :location => 'shared', :partial => 'footer' %>
|
62
|
+
</div>
|
63
|
+
<div class="right">
|
64
|
+
<%= locales %>
|
65
|
+
</div>
|
66
|
+
<div class="clear"></div>
|
67
|
+
</div>
|
68
|
+
|
69
|
+
</div>
|
70
|
+
|
71
|
+
</body>
|
72
|
+
|
73
|
+
</html>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
|
6
|
+
<head>
|
7
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
8
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
9
|
+
<meta name="viewport" content="width=500, initial-scale=0.60, minimum-scale=0.60" />
|
10
|
+
<title><%= page_title %></title>
|
11
|
+
<%= stylesheet_link_tag 'admin/reset', :media => 'screen' %>
|
12
|
+
<%= stylesheet_link_tag 'admin/screen', :media => 'screen' %>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
|
17
|
+
<div id="dialog">
|
18
|
+
<h1><%= link_to Typus::Configuration.options[:app_name], admin_sign_in_path %></h1>
|
19
|
+
<%= display_flash_message %>
|
20
|
+
<%= yield %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div id="bottom_dialog">
|
24
|
+
<%= typus_block :location => 'shared', :partial => 'footer' %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
</body>
|
28
|
+
|
29
|
+
</html>
|