typus 3.1.0.rc14 → 3.1.0.rc15
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +3 -0
- data/README.md +10 -14
- data/Rakefile +7 -5
- data/app/assets/javascripts/typus.js +1 -0
- data/app/assets/javascripts/typus/jquery.application.js +0 -2
- data/app/assets/stylesheets/typus.css +13 -1
- data/app/assets/stylesheets/typus/account.css +53 -0
- data/app/assets/stylesheets/typus/actions.css +11 -0
- data/app/assets/stylesheets/typus/content.css +92 -0
- data/app/assets/stylesheets/typus/defaults.css +31 -0
- data/app/assets/stylesheets/typus/errors.css +33 -0
- data/app/assets/stylesheets/typus/footer.css +8 -0
- data/app/assets/stylesheets/typus/forms.css +52 -0
- data/app/assets/stylesheets/typus/hacks.css +20 -0
- data/app/assets/stylesheets/typus/header.css +55 -0
- data/app/assets/stylesheets/typus/layout.css +4 -0
- data/app/assets/stylesheets/typus/pagination.css +34 -8
- data/app/assets/stylesheets/typus/sidebar.css +23 -0
- data/app/assets/stylesheets/typus/tables.css +47 -0
- data/app/helpers/admin/base_helper.rb +1 -1
- data/app/helpers/admin/resources/data_types/belongs_to_helper.rb +1 -0
- data/app/helpers/admin/resources/data_types/tree_helper.rb +1 -0
- data/app/helpers/admin/resources/display_helper.rb +1 -1
- data/app/helpers/admin/resources/form_helper.rb +1 -0
- data/app/helpers/admin/resources_helper.rb +3 -5
- data/app/views/admin/account/forgot_password.html.erb +7 -1
- data/app/views/admin/base/user_guide.html.erb +61 -57
- data/app/views/admin/dashboard/show.html.erb +6 -16
- data/app/views/admin/dashboard/widgets/_applications.html.erb +31 -0
- data/app/views/admin/dashboard/widgets/_models.html.erb +23 -0
- data/app/views/admin/dashboard/widgets/_models_extended.html.erb +25 -0
- data/app/views/admin/dashboard/widgets/_resources.html.erb +23 -0
- data/app/views/admin/resources/_actions.html.erb +23 -0
- data/app/views/admin/resources/edit.html.erb +26 -20
- data/app/views/admin/resources/edit/_actions.html.erb +7 -0
- data/app/views/admin/resources/edit/_rencently_edited.html.erb +8 -0
- data/app/views/admin/resources/index.html.erb +42 -32
- data/app/views/admin/resources/new.html.erb +16 -8
- data/app/views/admin/resources/show.html.erb +22 -14
- data/app/views/admin/session/new.html.erb +9 -1
- data/app/views/admin/templates/_belongs_to.html.erb +1 -1
- data/app/views/admin/templates/_belongs_to_with_autocomplete.html.erb +1 -1
- data/app/views/admin/templates/_boolean.html.erb +1 -1
- data/app/views/admin/templates/_date.html.erb +1 -1
- data/app/views/admin/templates/_datetime.html.erb +1 -1
- data/app/views/admin/templates/_dragonfly.html.erb +1 -1
- data/app/views/admin/templates/_paperclip.html.erb +1 -1
- data/app/views/admin/templates/_password.html.erb +1 -1
- data/app/views/admin/templates/_selector.html.erb +1 -1
- data/app/views/admin/templates/_string.html.erb +1 -1
- data/app/views/admin/templates/_string_with_preview.html.erb +1 -1
- data/app/views/admin/templates/_text.html.erb +1 -1
- data/app/views/admin/templates/_text_with_ckeditor.html.erb +16 -2
- data/app/views/admin/templates/_text_with_ckeditor_and_assets.html.erb +16 -2
- data/app/views/admin/templates/_time.html.erb +1 -1
- data/app/views/admin/templates/_tree.html.erb +1 -1
- data/app/views/helpers/admin/resources/_sidebar.html.erb +36 -12
- data/app/views/helpers/admin/resources/_table.html.erb +5 -3
- data/app/views/layouts/admin/base.html.erb +16 -29
- data/app/views/layouts/admin/headless.html.erb +1 -1
- data/app/views/layouts/admin/session.html.erb +6 -0
- data/lib/support/fake_user.rb +2 -8
- data/lib/typus.rb +6 -2
- data/lib/typus/authentication/devise.rb +19 -0
- data/lib/typus/controller/headless.rb +1 -1
- data/lib/typus/orm/active_record/admin_user_v1.rb +15 -1
- data/lib/typus/orm/active_record/admin_user_v2.rb +16 -2
- data/lib/typus/orm/active_record/user/class_methods.rb +2 -3
- data/lib/typus/orm/active_record/user/instance_methods.rb +5 -2
- data/lib/typus/orm/active_record/user/instance_methods_more.rb +19 -0
- data/lib/typus/version.rb +1 -1
- data/vendor/assets/adapt/css/1200.css +357 -0
- data/vendor/assets/adapt/css/1200.min.css +1 -0
- data/vendor/assets/adapt/css/1560.css +357 -0
- data/vendor/assets/adapt/css/1560.min.css +1 -0
- data/vendor/assets/adapt/css/720.css +357 -0
- data/vendor/assets/adapt/css/720.min.css +1 -0
- data/vendor/assets/adapt/css/960.css +357 -0
- data/vendor/assets/adapt/css/960.min.css +1 -0
- data/vendor/assets/adapt/css/fluid.css +345 -0
- data/vendor/assets/adapt/css/fluid.min.css +1 -0
- data/vendor/assets/adapt/css/master.css +120 -0
- data/vendor/assets/adapt/css/mobile.css +20 -0
- data/vendor/assets/adapt/css/mobile.min.css +1 -0
- data/vendor/assets/adapt/css/reset.css +202 -0
- data/vendor/assets/adapt/css/text.css +81 -0
- data/vendor/assets/adapt/images/h1.png +0 -0
- data/vendor/assets/adapt/js/adapt.js +135 -0
- data/vendor/assets/adapt/js/adapt.min.js +1 -0
- data/vendor/assets/formalize/.gitignore +1 -0
- data/vendor/assets/formalize/css/_formalize.sass +332 -0
- data/vendor/assets/formalize/css/demo.css +47 -0
- data/vendor/assets/formalize/css/formalize.css +395 -0
- data/vendor/assets/formalize/css/reset.css +202 -0
- data/vendor/assets/formalize/css/text.css +81 -0
- data/vendor/assets/formalize/images/button.png +0 -0
- data/vendor/assets/formalize/images/select_arrow.gif +0 -0
- data/vendor/assets/formalize/js/dojo.formalize.js +166 -0
- data/vendor/assets/formalize/js/dojo.formalize.min.js +1 -0
- data/vendor/assets/formalize/js/extjs.formalize.js +163 -0
- data/vendor/assets/formalize/js/extjs.formalize.min.js +1 -0
- data/vendor/assets/formalize/js/jquery.formalize.js +150 -0
- data/vendor/assets/formalize/js/jquery.formalize.min.js +1 -0
- data/vendor/assets/formalize/js/mootools.formalize.js +155 -0
- data/vendor/assets/formalize/js/mootools.formalize.min.js +1 -0
- data/vendor/assets/formalize/js/prototype.formalize.js +163 -0
- data/vendor/assets/formalize/js/prototype.formalize.min.js +1 -0
- data/vendor/assets/formalize/js/yui.formalize.js +152 -0
- data/vendor/assets/formalize/js/yui.formalize.min.js +1 -0
- metadata +79 -47
- data/app/assets/stylesheets/typus/screen.css +0 -340
- data/app/helpers/admin/dashboard_helper.rb +0 -8
- data/app/views/admin/dashboard/_applications.html.erb +0 -21
- data/config/locales/typus.ca.models.yml +0 -17
- data/config/locales/typus.ca.yml +0 -80
- data/config/locales/typus.de.models.yml +0 -17
- data/config/locales/typus.de.yml +0 -79
- data/config/locales/typus.el.models.yml +0 -17
- data/config/locales/typus.el.yml +0 -81
- data/config/locales/typus.es.models.yml +0 -18
- data/config/locales/typus.es.yml +0 -81
- data/config/locales/typus.fr.models.yml +0 -18
- data/config/locales/typus.fr.yml +0 -85
- data/config/locales/typus.hu.models.yml +0 -17
- data/config/locales/typus.hu.yml +0 -79
- data/config/locales/typus.it.models.yml +0 -18
- data/config/locales/typus.it.yml +0 -88
- data/config/locales/typus.locale.models.yml.template +0 -17
- data/config/locales/typus.locale.yml.template +0 -80
- data/config/locales/typus.pt-BR.models.yml +0 -17
- data/config/locales/typus.pt-BR.yml +0 -79
- data/config/locales/typus.pt-PT.models.yml +0 -17
- data/config/locales/typus.pt-PT.yml +0 -83
- data/config/locales/typus.ru.models.yml +0 -17
- data/config/locales/typus.ru.yml +0 -79
- data/config/locales/typus.zh-CN.models.yml +0 -17
- data/config/locales/typus.zh-CN.yml +0 -78
@@ -0,0 +1,23 @@
|
|
1
|
+
<!-- This probably needs a rename, but for the moment is ok -->
|
2
|
+
|
3
|
+
<% if (resources = Typus.resources.delete_if { |r| !(admin_user.is_a?(FakeUser) || admin_user.resources.include?(r)) }).any? %>
|
4
|
+
|
5
|
+
<h2><%= Typus::I18n.t("Resources") %></h2>
|
6
|
+
|
7
|
+
<table>
|
8
|
+
|
9
|
+
<thead>
|
10
|
+
<tr>
|
11
|
+
<th><%= Typus::I18n.t("Name") %></th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
|
15
|
+
<% resources.each do |resource| %>
|
16
|
+
<tr class="<%= cycle("even", "odd") %>">
|
17
|
+
<td><%= link_to Typus::I18n.t(resource.titleize.capitalize), :controller => "/admin/#{resource.underscore}" %></td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
</table>
|
22
|
+
|
23
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="actions">
|
2
|
+
<div class="left">
|
3
|
+
<ul>
|
4
|
+
<li><%= link_to Typus::I18n.t("All"), params.dup.cleanup.merge(:action => 'index') %> (<%= resource.count %>)</li>
|
5
|
+
<% predefined_filters.each do |filter, action, scope| %>
|
6
|
+
<% url = action.is_a?(String) ? params.dup.cleanup.merge(:action => action) : action %>
|
7
|
+
<li><%= link_to Typus::I18n.t(filter), url %> <%= "(#{@resource.send(scope).count})" if scope && @resource.respond_to?(scope) %></li>
|
8
|
+
<% end %>
|
9
|
+
</ul>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="right">
|
13
|
+
<% unless resource.count.zero? %>
|
14
|
+
<ul>
|
15
|
+
<li><%= Typus::I18n.t("Export as") %></li>
|
16
|
+
<ul>
|
17
|
+
<li><%= link_to "CSV", :format => 'csv' %></li>
|
18
|
+
<li><%= link_to "XML", :format => 'xml' %></li>
|
19
|
+
</ul>
|
20
|
+
</ul>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -3,29 +3,35 @@
|
|
3
3
|
title(page_title)
|
4
4
|
%>
|
5
5
|
|
6
|
-
<% content_for :
|
7
|
-
|
8
|
-
|
6
|
+
<% content_for :main_grid do %>
|
7
|
+
<h2>
|
8
|
+
<%= page_title %>
|
9
|
+
<small><%= list_actions %></small>
|
10
|
+
</h2>
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
</
|
12
|
+
<% if flash[:notice] && headless_mode? %>
|
13
|
+
<script>
|
14
|
+
$(document).ready(function() { parent.location.reload(); });
|
15
|
+
</script>
|
16
|
+
<% end %>
|
14
17
|
|
15
|
-
|
16
|
-
|
17
|
-
$(document).ready(function() { parent.location.reload(); });
|
18
|
-
</script>
|
19
|
-
<% end %>
|
18
|
+
<%= display_flash_message %>
|
19
|
+
<%= render 'edit' %>
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
<%
|
22
|
+
options = params.dup.cleanup.merge!(:action => 'update')
|
23
|
+
button = Typus::I18n.t("Save %{resource}", :resource => @resource.model_name.human)
|
24
|
+
%>
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
%>
|
26
|
+
<%= render :partial => 'form', :locals => { :options => options, :button => button } %>
|
27
|
+
|
28
|
+
<%= typus_relationships unless headless_mode? %>
|
29
|
+
<% end %>
|
28
30
|
|
29
|
-
|
31
|
+
<div class="grid_2">
|
32
|
+
<%= build_sidebar.present? ? build_sidebar : render("admin/templates/profile_sidebar") %>
|
33
|
+
</div>
|
30
34
|
|
31
|
-
|
35
|
+
<div class="grid_8">
|
36
|
+
<%= yield :main_grid %>
|
37
|
+
</div>
|
@@ -3,44 +3,54 @@
|
|
3
3
|
title(page_title)
|
4
4
|
%>
|
5
5
|
|
6
|
-
<% content_for :
|
6
|
+
<% content_for :main_grid do %>
|
7
7
|
|
8
|
-
<h2>
|
9
|
-
|
10
|
-
|
11
|
-
</h2>
|
8
|
+
<h2>
|
9
|
+
<%= page_title %>
|
10
|
+
<small><%= list_actions %></small>
|
11
|
+
</h2>
|
12
12
|
|
13
|
-
<%= display_flash_message %>
|
13
|
+
<%= display_flash_message %>
|
14
14
|
|
15
|
-
<%= render 'index' %>
|
15
|
+
<%= render 'index' %>
|
16
16
|
|
17
|
-
<ul class="predefined_filters">
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
</ul>
|
17
|
+
<ul class="predefined_filters">
|
18
|
+
<li><%= link_to Typus::I18n.t("All"), params.dup.cleanup.merge(:action => 'index') %> (<%= resource.count %>)</li>
|
19
|
+
<% predefined_filters.each do |filter, action, scope| %>
|
20
|
+
<% url = action.is_a?(String) ? params.dup.cleanup.merge(:action => action) : action %>
|
21
|
+
<li><%= link_to Typus::I18n.t(filter), url %> <%= "(#{@resource.send(scope).count})" if scope && @resource.respond_to?(scope) %></li>
|
22
|
+
<% end %>
|
23
|
+
<% unless resource.count.zero? %>
|
24
|
+
<li>|</li>
|
25
|
+
<li><%= link_to "CSV", :format => 'csv' %></li>
|
26
|
+
<li><%= link_to "XML", :format => 'xml' %></li>
|
27
|
+
<% end %>
|
28
|
+
</ul>
|
29
29
|
|
30
|
-
<% if (build_filters || search) %>
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
<% end %>
|
30
|
+
<% if (build_filters || search) %>
|
31
|
+
<div class="filters">
|
32
|
+
<%= build_filters %>
|
33
|
+
<%= search %>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
36
36
|
|
37
|
-
<% if @items.any? -%>
|
38
|
-
|
39
|
-
|
37
|
+
<% if @items.any? -%>
|
38
|
+
<% if controller.respond_to?(:bulk) %>
|
39
|
+
<%= build_actions { build_list(@resource, fields, @items) } %>
|
40
|
+
<% else %>
|
41
|
+
<%= build_list(@resource, fields, @items) %>
|
42
|
+
<% end %>
|
43
|
+
<%= paginate(@items, Typus.pagination) %>
|
40
44
|
<% else %>
|
41
|
-
|
45
|
+
<p><%= Typus::I18n.t("No %{resources} found.", :resources => @resource.model_name.human.downcase.pluralize) %></p>
|
42
46
|
<% end %>
|
43
|
-
|
44
|
-
<% else %>
|
45
|
-
<p><%= Typus::I18n.t("No %{resources} found.", :resources => @resource.model_name.human.downcase.pluralize) %></p>
|
47
|
+
|
46
48
|
<% end %>
|
49
|
+
|
50
|
+
<div class="grid_2">
|
51
|
+
<%= build_sidebar %>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div class="grid_10">
|
55
|
+
<%= yield :main_grid %>
|
56
|
+
</div>
|
@@ -3,14 +3,22 @@
|
|
3
3
|
title(page_title)
|
4
4
|
%>
|
5
5
|
|
6
|
-
<% content_for :
|
6
|
+
<% content_for :main_grid do %>
|
7
|
+
<h2>
|
8
|
+
<%= page_title %>
|
9
|
+
<small><%= list_actions %></small>
|
10
|
+
</h2>
|
7
11
|
|
8
|
-
|
9
|
-
<%= page_title %>
|
10
|
-
<small><%= list_actions %></small>
|
11
|
-
</h2>
|
12
|
+
<%= render 'new' %>
|
12
13
|
|
13
|
-
<%= render '
|
14
|
+
<%= render :partial => 'form',
|
15
|
+
:locals => { :options => params.dup.cleanup.merge(:action => 'create') } %>
|
16
|
+
<% end %>
|
14
17
|
|
15
|
-
|
16
|
-
|
18
|
+
<div class="grid_2">
|
19
|
+
<%= build_sidebar %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="grid_8">
|
23
|
+
<%= yield :main_grid %>
|
24
|
+
</div>
|
@@ -3,21 +3,29 @@
|
|
3
3
|
title(page_title)
|
4
4
|
%>
|
5
5
|
|
6
|
-
<% content_for :
|
6
|
+
<% content_for :main_grid do %>
|
7
|
+
<h2>
|
8
|
+
<%= page_title %>
|
9
|
+
<small><%= list_actions %></small>
|
10
|
+
</h2>
|
7
11
|
|
8
|
-
|
9
|
-
<%=
|
10
|
-
<small><%= list_actions %></small>
|
11
|
-
</h2>
|
12
|
+
<%= display_flash_message %>
|
13
|
+
<%= render 'show' %>
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
<dl>
|
16
|
+
<% build_display(@item, fields).each do |attribute, type| %>
|
17
|
+
<dt><%= attribute %></dt>
|
18
|
+
<dd><%= type %></dd>
|
19
|
+
<% end %>
|
20
|
+
</dl>
|
15
21
|
|
16
|
-
|
17
|
-
|
18
|
-
<dt><%= attribute %></dt>
|
19
|
-
<dd><%= type %></dd>
|
20
|
-
<% end %>
|
21
|
-
</dl>
|
22
|
+
<%= typus_relationships %>
|
23
|
+
<% end %>
|
22
24
|
|
23
|
-
|
25
|
+
<div class="grid_2">
|
26
|
+
<%= build_sidebar %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="grid_8">
|
30
|
+
<%= yield :main_grid %>
|
31
|
+
</div>
|
@@ -18,9 +18,17 @@
|
|
18
18
|
</li>
|
19
19
|
|
20
20
|
<li>
|
21
|
-
<%= submit_tag Typus::I18n.t("Sign in"), :class => "button", :disable_with => Typus::I18n.t("Sending data ...") %>
|
21
|
+
<%= submit_tag Typus::I18n.t("Sign in"), :class => "button", :disable_with => Typus::I18n.t("Sending data ...") %>
|
22
22
|
</li>
|
23
23
|
|
24
24
|
</ul>
|
25
25
|
|
26
26
|
<% end %>
|
27
|
+
|
28
|
+
<% if Typus.mailer_sender %>
|
29
|
+
<% content_for :actions do %>
|
30
|
+
<ul>
|
31
|
+
<li><%= link_to Typus::I18n.t("Recover password"), forgot_password_admin_account_index_path %></li>
|
32
|
+
</ul>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</script>
|
17
17
|
<% end %>
|
18
18
|
|
19
|
-
<li id="<%=
|
19
|
+
<li id="<%= attribute_id %>">
|
20
20
|
<%= form.label related_fk, "#{label_text} <small>#{message}</small>".html_safe %>
|
21
21
|
<%= form.hidden_field related_fk %>
|
22
22
|
<input id="tokenInput_for_<%= related_fk %>"
|
@@ -1,13 +1,27 @@
|
|
1
1
|
<% content_for :javascripts do %>
|
2
|
+
<script type="text/javascript">
|
3
|
+
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
|
4
|
+
</script>
|
5
|
+
|
2
6
|
<%= javascript_include_tag 'ckeditor/ckeditor' %>
|
7
|
+
<%= javascript_include_tag 'ckeditor/adapters/jquery' %>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
$(document).ready(function() {
|
11
|
+
// var config = { toolbar: 'Basic', };
|
12
|
+
// var config = { toolbar: 'Full', };
|
13
|
+
var config = { toolbar: [['Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Undo', 'Redo', '-', 'SelectAll']] };
|
14
|
+
$(".rich_text").ckeditor(config);
|
15
|
+
});
|
16
|
+
</script>
|
3
17
|
<% end %>
|
4
18
|
|
5
19
|
<%
|
6
|
-
custom = { :rows => @resource.typus_options_for(:form_rows), :class => "
|
20
|
+
custom = { :rows => @resource.typus_options_for(:form_rows), :class => "rich_text" }
|
7
21
|
options = options.merge!(custom)
|
8
22
|
%>
|
9
23
|
|
10
|
-
<li id="<%=
|
24
|
+
<li id="<%= attribute_id %>">
|
11
25
|
<%= form.label attribute, label_text %>
|
12
26
|
<%= form.text_area attribute, options %>
|
13
27
|
</li>
|
@@ -1,9 +1,23 @@
|
|
1
1
|
<% content_for :javascripts do %>
|
2
|
+
<script type="text/javascript">
|
3
|
+
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
|
4
|
+
</script>
|
5
|
+
|
2
6
|
<%= javascript_include_tag 'ckeditor/ckeditor' %>
|
7
|
+
<%= javascript_include_tag 'ckeditor/adapters/jquery' %>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
$(document).ready(function() {
|
11
|
+
// var config = { toolbar: 'Basic', };
|
12
|
+
// var config = { toolbar: 'Full', };
|
13
|
+
var config = { toolbar: [['Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Undo', 'Redo', '-', 'SelectAll']] };
|
14
|
+
$(".rich_text").ckeditor(config);
|
15
|
+
});
|
16
|
+
</script>
|
3
17
|
<% end %>
|
4
18
|
|
5
19
|
<%
|
6
|
-
custom = { :rows => @resource.typus_options_for(:form_rows), :class => "
|
20
|
+
custom = { :rows => @resource.typus_options_for(:form_rows), :class => "rich_text" }
|
7
21
|
options = options.merge!(custom)
|
8
22
|
%>
|
9
23
|
|
@@ -18,7 +32,7 @@
|
|
18
32
|
DATA
|
19
33
|
%>
|
20
34
|
|
21
|
-
<li id="<%=
|
35
|
+
<li id="<%= attribute_id %>">
|
22
36
|
<%= form.label attribute, label_text.html_safe %>
|
23
37
|
<%= form.text_area attribute, options %>
|
24
38
|
</li>
|