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.
Files changed (137) hide show
  1. data/.gitmodules +3 -0
  2. data/README.md +10 -14
  3. data/Rakefile +7 -5
  4. data/app/assets/javascripts/typus.js +1 -0
  5. data/app/assets/javascripts/typus/jquery.application.js +0 -2
  6. data/app/assets/stylesheets/typus.css +13 -1
  7. data/app/assets/stylesheets/typus/account.css +53 -0
  8. data/app/assets/stylesheets/typus/actions.css +11 -0
  9. data/app/assets/stylesheets/typus/content.css +92 -0
  10. data/app/assets/stylesheets/typus/defaults.css +31 -0
  11. data/app/assets/stylesheets/typus/errors.css +33 -0
  12. data/app/assets/stylesheets/typus/footer.css +8 -0
  13. data/app/assets/stylesheets/typus/forms.css +52 -0
  14. data/app/assets/stylesheets/typus/hacks.css +20 -0
  15. data/app/assets/stylesheets/typus/header.css +55 -0
  16. data/app/assets/stylesheets/typus/layout.css +4 -0
  17. data/app/assets/stylesheets/typus/pagination.css +34 -8
  18. data/app/assets/stylesheets/typus/sidebar.css +23 -0
  19. data/app/assets/stylesheets/typus/tables.css +47 -0
  20. data/app/helpers/admin/base_helper.rb +1 -1
  21. data/app/helpers/admin/resources/data_types/belongs_to_helper.rb +1 -0
  22. data/app/helpers/admin/resources/data_types/tree_helper.rb +1 -0
  23. data/app/helpers/admin/resources/display_helper.rb +1 -1
  24. data/app/helpers/admin/resources/form_helper.rb +1 -0
  25. data/app/helpers/admin/resources_helper.rb +3 -5
  26. data/app/views/admin/account/forgot_password.html.erb +7 -1
  27. data/app/views/admin/base/user_guide.html.erb +61 -57
  28. data/app/views/admin/dashboard/show.html.erb +6 -16
  29. data/app/views/admin/dashboard/widgets/_applications.html.erb +31 -0
  30. data/app/views/admin/dashboard/widgets/_models.html.erb +23 -0
  31. data/app/views/admin/dashboard/widgets/_models_extended.html.erb +25 -0
  32. data/app/views/admin/dashboard/widgets/_resources.html.erb +23 -0
  33. data/app/views/admin/resources/_actions.html.erb +23 -0
  34. data/app/views/admin/resources/edit.html.erb +26 -20
  35. data/app/views/admin/resources/edit/_actions.html.erb +7 -0
  36. data/app/views/admin/resources/edit/_rencently_edited.html.erb +8 -0
  37. data/app/views/admin/resources/index.html.erb +42 -32
  38. data/app/views/admin/resources/new.html.erb +16 -8
  39. data/app/views/admin/resources/show.html.erb +22 -14
  40. data/app/views/admin/session/new.html.erb +9 -1
  41. data/app/views/admin/templates/_belongs_to.html.erb +1 -1
  42. data/app/views/admin/templates/_belongs_to_with_autocomplete.html.erb +1 -1
  43. data/app/views/admin/templates/_boolean.html.erb +1 -1
  44. data/app/views/admin/templates/_date.html.erb +1 -1
  45. data/app/views/admin/templates/_datetime.html.erb +1 -1
  46. data/app/views/admin/templates/_dragonfly.html.erb +1 -1
  47. data/app/views/admin/templates/_paperclip.html.erb +1 -1
  48. data/app/views/admin/templates/_password.html.erb +1 -1
  49. data/app/views/admin/templates/_selector.html.erb +1 -1
  50. data/app/views/admin/templates/_string.html.erb +1 -1
  51. data/app/views/admin/templates/_string_with_preview.html.erb +1 -1
  52. data/app/views/admin/templates/_text.html.erb +1 -1
  53. data/app/views/admin/templates/_text_with_ckeditor.html.erb +16 -2
  54. data/app/views/admin/templates/_text_with_ckeditor_and_assets.html.erb +16 -2
  55. data/app/views/admin/templates/_time.html.erb +1 -1
  56. data/app/views/admin/templates/_tree.html.erb +1 -1
  57. data/app/views/helpers/admin/resources/_sidebar.html.erb +36 -12
  58. data/app/views/helpers/admin/resources/_table.html.erb +5 -3
  59. data/app/views/layouts/admin/base.html.erb +16 -29
  60. data/app/views/layouts/admin/headless.html.erb +1 -1
  61. data/app/views/layouts/admin/session.html.erb +6 -0
  62. data/lib/support/fake_user.rb +2 -8
  63. data/lib/typus.rb +6 -2
  64. data/lib/typus/authentication/devise.rb +19 -0
  65. data/lib/typus/controller/headless.rb +1 -1
  66. data/lib/typus/orm/active_record/admin_user_v1.rb +15 -1
  67. data/lib/typus/orm/active_record/admin_user_v2.rb +16 -2
  68. data/lib/typus/orm/active_record/user/class_methods.rb +2 -3
  69. data/lib/typus/orm/active_record/user/instance_methods.rb +5 -2
  70. data/lib/typus/orm/active_record/user/instance_methods_more.rb +19 -0
  71. data/lib/typus/version.rb +1 -1
  72. data/vendor/assets/adapt/css/1200.css +357 -0
  73. data/vendor/assets/adapt/css/1200.min.css +1 -0
  74. data/vendor/assets/adapt/css/1560.css +357 -0
  75. data/vendor/assets/adapt/css/1560.min.css +1 -0
  76. data/vendor/assets/adapt/css/720.css +357 -0
  77. data/vendor/assets/adapt/css/720.min.css +1 -0
  78. data/vendor/assets/adapt/css/960.css +357 -0
  79. data/vendor/assets/adapt/css/960.min.css +1 -0
  80. data/vendor/assets/adapt/css/fluid.css +345 -0
  81. data/vendor/assets/adapt/css/fluid.min.css +1 -0
  82. data/vendor/assets/adapt/css/master.css +120 -0
  83. data/vendor/assets/adapt/css/mobile.css +20 -0
  84. data/vendor/assets/adapt/css/mobile.min.css +1 -0
  85. data/vendor/assets/adapt/css/reset.css +202 -0
  86. data/vendor/assets/adapt/css/text.css +81 -0
  87. data/vendor/assets/adapt/images/h1.png +0 -0
  88. data/vendor/assets/adapt/js/adapt.js +135 -0
  89. data/vendor/assets/adapt/js/adapt.min.js +1 -0
  90. data/vendor/assets/formalize/.gitignore +1 -0
  91. data/vendor/assets/formalize/css/_formalize.sass +332 -0
  92. data/vendor/assets/formalize/css/demo.css +47 -0
  93. data/vendor/assets/formalize/css/formalize.css +395 -0
  94. data/vendor/assets/formalize/css/reset.css +202 -0
  95. data/vendor/assets/formalize/css/text.css +81 -0
  96. data/vendor/assets/formalize/images/button.png +0 -0
  97. data/vendor/assets/formalize/images/select_arrow.gif +0 -0
  98. data/vendor/assets/formalize/js/dojo.formalize.js +166 -0
  99. data/vendor/assets/formalize/js/dojo.formalize.min.js +1 -0
  100. data/vendor/assets/formalize/js/extjs.formalize.js +163 -0
  101. data/vendor/assets/formalize/js/extjs.formalize.min.js +1 -0
  102. data/vendor/assets/formalize/js/jquery.formalize.js +150 -0
  103. data/vendor/assets/formalize/js/jquery.formalize.min.js +1 -0
  104. data/vendor/assets/formalize/js/mootools.formalize.js +155 -0
  105. data/vendor/assets/formalize/js/mootools.formalize.min.js +1 -0
  106. data/vendor/assets/formalize/js/prototype.formalize.js +163 -0
  107. data/vendor/assets/formalize/js/prototype.formalize.min.js +1 -0
  108. data/vendor/assets/formalize/js/yui.formalize.js +152 -0
  109. data/vendor/assets/formalize/js/yui.formalize.min.js +1 -0
  110. metadata +79 -47
  111. data/app/assets/stylesheets/typus/screen.css +0 -340
  112. data/app/helpers/admin/dashboard_helper.rb +0 -8
  113. data/app/views/admin/dashboard/_applications.html.erb +0 -21
  114. data/config/locales/typus.ca.models.yml +0 -17
  115. data/config/locales/typus.ca.yml +0 -80
  116. data/config/locales/typus.de.models.yml +0 -17
  117. data/config/locales/typus.de.yml +0 -79
  118. data/config/locales/typus.el.models.yml +0 -17
  119. data/config/locales/typus.el.yml +0 -81
  120. data/config/locales/typus.es.models.yml +0 -18
  121. data/config/locales/typus.es.yml +0 -81
  122. data/config/locales/typus.fr.models.yml +0 -18
  123. data/config/locales/typus.fr.yml +0 -85
  124. data/config/locales/typus.hu.models.yml +0 -17
  125. data/config/locales/typus.hu.yml +0 -79
  126. data/config/locales/typus.it.models.yml +0 -18
  127. data/config/locales/typus.it.yml +0 -88
  128. data/config/locales/typus.locale.models.yml.template +0 -17
  129. data/config/locales/typus.locale.yml.template +0 -80
  130. data/config/locales/typus.pt-BR.models.yml +0 -17
  131. data/config/locales/typus.pt-BR.yml +0 -79
  132. data/config/locales/typus.pt-PT.models.yml +0 -17
  133. data/config/locales/typus.pt-PT.yml +0 -83
  134. data/config/locales/typus.ru.models.yml +0 -17
  135. data/config/locales/typus.ru.yml +0 -79
  136. data/config/locales/typus.zh-CN.models.yml +0 -17
  137. 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 :sidebar do %>
7
- <% build_sidebar.present? ? build_sidebar : render("admin/templates/profile_sidebar") %>
8
- <% end %>
6
+ <% content_for :main_grid do %>
7
+ <h2>
8
+ <%= page_title %>
9
+ <small><%= list_actions %></small>
10
+ </h2>
9
11
 
10
- <h2>
11
- <%= page_title %>
12
- <small><%= list_actions %></small>
13
- </h2>
12
+ <% if flash[:notice] && headless_mode? %>
13
+ <script>
14
+ $(document).ready(function() { parent.location.reload(); });
15
+ </script>
16
+ <% end %>
14
17
 
15
- <% if flash[:notice] && headless_mode? %>
16
- <script>
17
- $(document).ready(function() { parent.location.reload(); });
18
- </script>
19
- <% end %>
18
+ <%= display_flash_message %>
19
+ <%= render 'edit' %>
20
20
 
21
- <%= display_flash_message %>
22
- <%= render 'edit' %>
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
- options = params.dup.cleanup.merge!(:action => 'update')
26
- button = Typus::I18n.t("Save %{resource}", :resource => @resource.model_name.human)
27
- %>
26
+ <%= render :partial => 'form', :locals => { :options => options, :button => button } %>
27
+
28
+ <%= typus_relationships unless headless_mode? %>
29
+ <% end %>
28
30
 
29
- <%= render :partial => 'form', :locals => { :options => options, :button => button } %>
31
+ <div class="grid_2">
32
+ <%= build_sidebar.present? ? build_sidebar : render("admin/templates/profile_sidebar") %>
33
+ </div>
30
34
 
31
- <%= typus_relationships unless headless_mode? %>
35
+ <div class="grid_8">
36
+ <%= yield :main_grid %>
37
+ </div>
@@ -0,0 +1,7 @@
1
+ <h3>Actions</h3>
2
+
3
+ <ul>
4
+ <li>Action number one</li>
5
+ <li>Action number two</li>
6
+ <li>Action number three</li>
7
+ </ul>
@@ -0,0 +1,8 @@
1
+ <% if (items = @resource.limit(10)).any? %>
2
+ <h3>Edited Recently</h3>
3
+ <ul>
4
+ <% items.each do |item| %>
5
+ <li><%= link_to item.to_label, :action => 'edit', :id => item %></li>
6
+ <% end %>
7
+ </ul>
8
+ <% end %>
@@ -3,44 +3,54 @@
3
3
  title(page_title)
4
4
  %>
5
5
 
6
- <% content_for :sidebar, build_sidebar %>
6
+ <% content_for :main_grid do %>
7
7
 
8
- <h2>
9
- <%= page_title %>
10
- <small><%= list_actions %></small>
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
- <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>
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
- <div class="filters">
32
- <%= build_filters %>
33
- <%= search %>
34
- </div>
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
- <% if controller.respond_to?(:bulk) %>
39
- <%= build_actions { build_list(@resource, fields, @items) } %>
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
- <%= build_list(@resource, fields, @items) %>
45
+ <p><%= Typus::I18n.t("No %{resources} found.", :resources => @resource.model_name.human.downcase.pluralize) %></p>
42
46
  <% end %>
43
- <%= paginate(@items, Typus.pagination) %>
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 :sidebar, build_sidebar %>
6
+ <% content_for :main_grid do %>
7
+ <h2>
8
+ <%= page_title %>
9
+ <small><%= list_actions %></small>
10
+ </h2>
7
11
 
8
- <h2>
9
- <%= page_title %>
10
- <small><%= list_actions %></small>
11
- </h2>
12
+ <%= render 'new' %>
12
13
 
13
- <%= render 'new' %>
14
+ <%= render :partial => 'form',
15
+ :locals => { :options => params.dup.cleanup.merge(:action => 'create') } %>
16
+ <% end %>
14
17
 
15
- <%= render :partial => 'form',
16
- :locals => { :options => params.dup.cleanup.merge(:action => 'create') } %>
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 :sidebar, build_sidebar %>
6
+ <% content_for :main_grid do %>
7
+ <h2>
8
+ <%= page_title %>
9
+ <small><%= list_actions %></small>
10
+ </h2>
7
11
 
8
- <h2>
9
- <%= page_title %>
10
- <small><%= list_actions %></small>
11
- </h2>
12
+ <%= display_flash_message %>
13
+ <%= render 'show' %>
12
14
 
13
- <%= display_flash_message %>
14
- <%= render 'show' %>
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
- <dl>
17
- <% build_display(@item, fields).each do |attribute, type| %>
18
- <dt><%= attribute %></dt>
19
- <dd><%= type %></dd>
20
- <% end %>
21
- </dl>
22
+ <%= typus_relationships %>
23
+ <% end %>
22
24
 
23
- <%= typus_relationships %>
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 ...") %> <%= link_to Typus::I18n.t("Recover password"), forgot_password_admin_account_index_path if Typus.mailer_sender %>
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 %>
@@ -5,7 +5,7 @@
5
5
  end
6
6
  %>
7
7
 
8
- <li id="<%= attribute %>">
8
+ <li id="<%= attribute_id %>">
9
9
  <%= form.label related_fk, "#{label_text} <small>#{message}</small>".html_safe %>
10
10
  <%= form.select related_fk, values, options, html_options %>
11
11
  </li>
@@ -16,7 +16,7 @@
16
16
  </script>
17
17
  <% end %>
18
18
 
19
- <li id="<%= attribute %>">
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,4 +1,4 @@
1
- <li id="<%= attribute %>">
1
+ <li id="<%= attribute_id %>">
2
2
  <%= form.check_box attribute, options %>
3
3
  <%= form.label attribute, label_text, :class => "inline_label" %>
4
4
  </li>
@@ -3,7 +3,7 @@
3
3
  options.merge!(custom)
4
4
  %>
5
5
 
6
- <li id="<%= attribute %>">
6
+ <li id="<%= attribute_id %>">
7
7
  <%= form.label attribute, label_text %>
8
8
  <%= form.date_select attribute, options, html_options %>
9
9
  </li>
@@ -3,7 +3,7 @@
3
3
  options.merge!(custom)
4
4
  %>
5
5
 
6
- <li id="<%= attribute %>">
6
+ <li id="<%= attribute_id %>">
7
7
  <%= form.label attribute, label_text %>
8
8
  <%= form.datetime_select attribute, options, html_options %>
9
9
  </li>
@@ -1,4 +1,4 @@
1
- <li id="<%= attribute %>">
1
+ <li id="<%= attribute_id %>">
2
2
  <%= form.label attribute, link_to_detach_attribute_for_dragonfly(attribute) %>
3
3
  <%= form.file_field attribute, options %>
4
4
  <%= form.hidden_field "retained_#{attribute}" %>
@@ -1,4 +1,4 @@
1
- <li id="<%= attribute %>">
1
+ <li id="<%= attribute_id %>">
2
2
  <%= form.label attribute, link_to_detach_attribute_for_paperclip(attribute) %>
3
3
  <%= form.file_field attribute, options %>
4
4
  <%= typus_paperclip_preview(@item, attribute) %>
@@ -1,4 +1,4 @@
1
- <li id="<%= attribute %>">
1
+ <li id="<%= attribute_id %>">
2
2
  <%= form.label attribute, label_text %>
3
3
  <%= form.password_field attribute, options %>
4
4
  </li>
@@ -8,7 +8,7 @@
8
8
  end
9
9
  %>
10
10
 
11
- <li id="<%= attribute %>">
11
+ <li id="<%= attribute_id %>">
12
12
  <%= form.label attribute, "#{label_text} <small>#{message}</small>".html_safe %>
13
13
  <%= form.select attribute, @resource.send(attribute), options, html_options %>
14
14
  </li>
@@ -16,7 +16,7 @@
16
16
 
17
17
  %>
18
18
 
19
- <li id="<%= attribute %>">
19
+ <li id="<%= attribute_id %>">
20
20
  <%= form.label attribute, label_text.html_safe %>
21
21
  <%= form.text_field attribute, options %>
22
22
  </li>
@@ -6,7 +6,7 @@
6
6
  end
7
7
  %>
8
8
 
9
- <li id="<%= attribute %>">
9
+ <li id="<%= attribute_id %>">
10
10
  <%= form.label attribute, raw(label_text) %>
11
11
  <%= form.text_field attribute, options %>
12
12
  </li>
@@ -10,7 +10,7 @@
10
10
  options = options.merge!(custom)
11
11
  %>
12
12
 
13
- <li id="<%= attribute %>">
13
+ <li id="<%= attribute_id %>">
14
14
  <%= form.label attribute, label_text.html_safe %>
15
15
  <%= form.text_area attribute, options %>
16
16
  </li>
@@ -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 => "ckeditor" }
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="<%= attribute %>">
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 => "ckeditor" }
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="<%= attribute %>">
35
+ <li id="<%= attribute_id %>">
22
36
  <%= form.label attribute, label_text.html_safe %>
23
37
  <%= form.text_area attribute, options %>
24
38
  </li>