radiant 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of radiant might be problematic. Click here for more details.

Files changed (208) hide show
  1. data/CHANGELOG +15 -0
  2. data/CONTRIBUTORS +8 -0
  3. data/app/controllers/admin/page_controller.rb +1 -11
  4. data/app/controllers/admin/welcome_controller.rb +5 -6
  5. data/app/controllers/application.rb +2 -0
  6. data/app/controllers/site_controller.rb +1 -0
  7. data/app/helpers/admin/page_helper.rb +36 -0
  8. data/app/helpers/admin/regions_helper.rb +28 -0
  9. data/app/helpers/admin/user_helper.rb +6 -0
  10. data/app/helpers/application_helper.rb +2 -1
  11. data/app/models/user.rb +7 -8
  12. data/app/views/admin/extension/index.html.haml +28 -0
  13. data/app/views/admin/layout/edit.html.haml +44 -0
  14. data/app/views/admin/layout/index.html.haml +25 -0
  15. data/app/views/admin/layout/remove.html.haml +16 -0
  16. data/app/views/admin/page/_meta_row.html.haml +6 -0
  17. data/app/views/admin/page/_node.html.haml +25 -0
  18. data/app/views/admin/page/_part.html.haml +17 -0
  19. data/app/views/admin/page/_tag_reference.html.haml +3 -0
  20. data/app/views/admin/page/children.html.haml +2 -0
  21. data/app/views/admin/page/edit.html.haml +114 -0
  22. data/app/views/admin/page/index.html.haml +28 -0
  23. data/app/views/admin/page/remove.html.haml +20 -0
  24. data/app/views/admin/snippet/edit.html.haml +36 -0
  25. data/app/views/admin/snippet/index.html.haml +20 -0
  26. data/app/views/admin/snippet/remove.html.haml +19 -0
  27. data/app/views/admin/user/edit.html.haml +80 -0
  28. data/app/views/admin/user/index.html.haml +23 -0
  29. data/app/views/admin/user/preferences.html.haml +28 -0
  30. data/app/views/admin/user/remove.html.haml +18 -0
  31. data/app/views/admin/welcome/login.html.haml +44 -0
  32. data/app/views/layouts/application.html.haml +54 -0
  33. data/app/views/site/not_found.html.haml +3 -0
  34. data/db/migrate/019_add_salt_to_users.rb +11 -0
  35. data/db/schema.rb +2 -1
  36. data/lib/login_system.rb +1 -0
  37. data/lib/radiant.rb +1 -1
  38. data/lib/radiant/admin_ui.rb +65 -0
  39. data/lib/radiant/admin_ui/region_partials.rb +18 -0
  40. data/lib/radiant/admin_ui/region_set.rb +35 -0
  41. data/lib/tasks/extensions.rake +33 -0
  42. data/public/javascripts/admin/admin.js +8 -2
  43. data/public/javascripts/admin/sitemap.js +2 -1
  44. data/public/stylesheets/admin/main.css +4 -0
  45. data/spec/controllers/admin/abstract_model_controller_spec.rb +2 -0
  46. data/spec/controllers/admin/page_controller_spec.rb +3 -28
  47. data/spec/controllers/admin/user_controller_spec.rb +1 -1
  48. data/spec/controllers/admin/welcome_controller_spec.rb +26 -0
  49. data/spec/helpers/admin/page_helper_spec.rb +4 -0
  50. data/spec/helpers/admin/regions_helper_spec.rb +47 -0
  51. data/spec/helpers/admin/user_helper_spec.rb +7 -0
  52. data/spec/helpers/application_helper_spec.rb +7 -3
  53. data/spec/lib/login_system_spec.rb +5 -0
  54. data/spec/lib/radiant/admin_ui/region_partials_spec.rb +35 -0
  55. data/spec/lib/radiant/admin_ui/region_set_spec.rb +61 -0
  56. data/spec/lib/radiant/admin_ui_spec.rb +74 -18
  57. data/spec/models/user_spec.rb +11 -4
  58. data/spec/scenarios/users_scenario.rb +2 -2
  59. data/vendor/plugins/haml/MIT-LICENSE +20 -0
  60. data/vendor/plugins/haml/README.rdoc +319 -0
  61. data/vendor/plugins/haml/Rakefile +158 -0
  62. data/vendor/plugins/haml/TODO +9 -0
  63. data/vendor/plugins/haml/VERSION +1 -0
  64. data/vendor/plugins/haml/bin/css2sass +7 -0
  65. data/vendor/plugins/haml/bin/haml +8 -0
  66. data/vendor/plugins/haml/bin/html2haml +7 -0
  67. data/vendor/plugins/haml/bin/sass +8 -0
  68. data/vendor/plugins/haml/extra/haml-mode.el +328 -0
  69. data/vendor/plugins/haml/extra/sass-mode.el +88 -0
  70. data/vendor/plugins/haml/init.rb +2 -0
  71. data/vendor/plugins/haml/lib/haml.rb +977 -0
  72. data/vendor/plugins/haml/lib/haml/buffer.rb +229 -0
  73. data/vendor/plugins/haml/lib/haml/engine.rb +274 -0
  74. data/vendor/plugins/haml/lib/haml/error.rb +23 -0
  75. data/vendor/plugins/haml/lib/haml/exec.rb +347 -0
  76. data/vendor/plugins/haml/lib/haml/filters.rb +249 -0
  77. data/vendor/plugins/haml/lib/haml/helpers.rb +413 -0
  78. data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb +45 -0
  79. data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +122 -0
  80. data/vendor/plugins/haml/lib/haml/html.rb +188 -0
  81. data/vendor/plugins/haml/lib/haml/precompiler.rb +757 -0
  82. data/vendor/plugins/haml/lib/haml/template.rb +43 -0
  83. data/vendor/plugins/haml/lib/haml/template/patch.rb +58 -0
  84. data/vendor/plugins/haml/lib/haml/template/plugin.rb +72 -0
  85. data/vendor/plugins/haml/lib/sass.rb +833 -0
  86. data/vendor/plugins/haml/lib/sass/constant.rb +245 -0
  87. data/vendor/plugins/haml/lib/sass/constant/color.rb +101 -0
  88. data/vendor/plugins/haml/lib/sass/constant/literal.rb +53 -0
  89. data/vendor/plugins/haml/lib/sass/constant/number.rb +87 -0
  90. data/vendor/plugins/haml/lib/sass/constant/operation.rb +30 -0
  91. data/vendor/plugins/haml/lib/sass/constant/string.rb +22 -0
  92. data/vendor/plugins/haml/lib/sass/css.rb +378 -0
  93. data/vendor/plugins/haml/lib/sass/engine.rb +459 -0
  94. data/vendor/plugins/haml/lib/sass/error.rb +35 -0
  95. data/vendor/plugins/haml/lib/sass/plugin.rb +165 -0
  96. data/vendor/plugins/haml/lib/sass/plugin/merb.rb +56 -0
  97. data/vendor/plugins/haml/lib/sass/plugin/rails.rb +24 -0
  98. data/vendor/plugins/haml/lib/sass/tree/attr_node.rb +53 -0
  99. data/vendor/plugins/haml/lib/sass/tree/comment_node.rb +20 -0
  100. data/vendor/plugins/haml/lib/sass/tree/directive_node.rb +46 -0
  101. data/vendor/plugins/haml/lib/sass/tree/node.rb +42 -0
  102. data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +89 -0
  103. data/vendor/plugins/haml/lib/sass/tree/value_node.rb +16 -0
  104. data/vendor/plugins/haml/test/benchmark.rb +82 -0
  105. data/vendor/plugins/haml/test/haml/engine_test.rb +587 -0
  106. data/vendor/plugins/haml/test/haml/helper_test.rb +187 -0
  107. data/vendor/plugins/haml/test/haml/html2haml_test.rb +60 -0
  108. data/vendor/plugins/haml/test/haml/markaby/standard.mab +52 -0
  109. data/vendor/plugins/haml/test/haml/mocks/article.rb +6 -0
  110. data/vendor/plugins/haml/test/haml/results/content_for_layout.xhtml +16 -0
  111. data/vendor/plugins/haml/test/haml/results/eval_suppressed.xhtml +11 -0
  112. data/vendor/plugins/haml/test/haml/results/filters.xhtml +82 -0
  113. data/vendor/plugins/haml/test/haml/results/helpers.xhtml +94 -0
  114. data/vendor/plugins/haml/test/haml/results/helpful.xhtml +10 -0
  115. data/vendor/plugins/haml/test/haml/results/just_stuff.xhtml +64 -0
  116. data/vendor/plugins/haml/test/haml/results/list.xhtml +12 -0
  117. data/vendor/plugins/haml/test/haml/results/original_engine.xhtml +22 -0
  118. data/vendor/plugins/haml/test/haml/results/partials.xhtml +21 -0
  119. data/vendor/plugins/haml/test/haml/results/silent_script.xhtml +74 -0
  120. data/vendor/plugins/haml/test/haml/results/standard.xhtml +42 -0
  121. data/vendor/plugins/haml/test/haml/results/tag_parsing.xhtml +28 -0
  122. data/vendor/plugins/haml/test/haml/results/very_basic.xhtml +7 -0
  123. data/vendor/plugins/haml/test/haml/results/whitespace_handling.xhtml +94 -0
  124. data/vendor/plugins/haml/test/haml/rhtml/_av_partial_1.rhtml +12 -0
  125. data/vendor/plugins/haml/test/haml/rhtml/_av_partial_2.rhtml +8 -0
  126. data/vendor/plugins/haml/test/haml/rhtml/action_view.rhtml +62 -0
  127. data/vendor/plugins/haml/test/haml/rhtml/standard.rhtml +54 -0
  128. data/vendor/plugins/haml/test/haml/template_test.rb +168 -0
  129. data/vendor/plugins/haml/test/haml/templates/_av_partial_1.haml +9 -0
  130. data/vendor/plugins/haml/test/haml/templates/_av_partial_2.haml +5 -0
  131. data/vendor/plugins/haml/test/haml/templates/_partial.haml +8 -0
  132. data/vendor/plugins/haml/test/haml/templates/_text_area.haml +3 -0
  133. data/vendor/plugins/haml/test/haml/templates/action_view.haml +47 -0
  134. data/vendor/plugins/haml/test/haml/templates/breakage.haml +8 -0
  135. data/vendor/plugins/haml/test/haml/templates/content_for_layout.haml +10 -0
  136. data/vendor/plugins/haml/test/haml/templates/eval_suppressed.haml +11 -0
  137. data/vendor/plugins/haml/test/haml/templates/filters.haml +81 -0
  138. data/vendor/plugins/haml/test/haml/templates/helpers.haml +69 -0
  139. data/vendor/plugins/haml/test/haml/templates/helpful.haml +11 -0
  140. data/vendor/plugins/haml/test/haml/templates/just_stuff.haml +77 -0
  141. data/vendor/plugins/haml/test/haml/templates/list.haml +12 -0
  142. data/vendor/plugins/haml/test/haml/templates/original_engine.haml +17 -0
  143. data/vendor/plugins/haml/test/haml/templates/partialize.haml +1 -0
  144. data/vendor/plugins/haml/test/haml/templates/partials.haml +12 -0
  145. data/vendor/plugins/haml/test/haml/templates/silent_script.haml +40 -0
  146. data/vendor/plugins/haml/test/haml/templates/standard.haml +42 -0
  147. data/vendor/plugins/haml/test/haml/templates/tag_parsing.haml +24 -0
  148. data/vendor/plugins/haml/test/haml/templates/very_basic.haml +4 -0
  149. data/vendor/plugins/haml/test/haml/templates/whitespace_handling.haml +87 -0
  150. data/vendor/plugins/haml/test/haml/test_helper.rb +15 -0
  151. data/vendor/plugins/haml/test/profile.rb +65 -0
  152. data/vendor/plugins/haml/test/sass/engine_test.rb +276 -0
  153. data/vendor/plugins/haml/test/sass/plugin_test.rb +159 -0
  154. data/vendor/plugins/haml/test/sass/results/alt.css +4 -0
  155. data/vendor/plugins/haml/test/sass/results/basic.css +9 -0
  156. data/vendor/plugins/haml/test/sass/results/compact.css +5 -0
  157. data/vendor/plugins/haml/test/sass/results/complex.css +87 -0
  158. data/vendor/plugins/haml/test/sass/results/compressed.css +1 -0
  159. data/vendor/plugins/haml/test/sass/results/constants.css +14 -0
  160. data/vendor/plugins/haml/test/sass/results/expanded.css +19 -0
  161. data/vendor/plugins/haml/test/sass/results/import.css +29 -0
  162. data/vendor/plugins/haml/test/sass/results/mixins.css +95 -0
  163. data/vendor/plugins/haml/test/sass/results/multiline.css +24 -0
  164. data/vendor/plugins/haml/test/sass/results/nested.css +22 -0
  165. data/vendor/plugins/haml/test/sass/results/parent_ref.css +13 -0
  166. data/vendor/plugins/haml/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
  167. data/vendor/plugins/haml/test/sass/results/subdir/subdir.css +1 -0
  168. data/vendor/plugins/haml/test/sass/templates/_partial.sass +2 -0
  169. data/vendor/plugins/haml/test/sass/templates/alt.sass +16 -0
  170. data/vendor/plugins/haml/test/sass/templates/basic.sass +23 -0
  171. data/vendor/plugins/haml/test/sass/templates/bork.sass +2 -0
  172. data/vendor/plugins/haml/test/sass/templates/bork2.sass +2 -0
  173. data/vendor/plugins/haml/test/sass/templates/compact.sass +17 -0
  174. data/vendor/plugins/haml/test/sass/templates/complex.sass +310 -0
  175. data/vendor/plugins/haml/test/sass/templates/compressed.sass +15 -0
  176. data/vendor/plugins/haml/test/sass/templates/constants.sass +97 -0
  177. data/vendor/plugins/haml/test/sass/templates/expanded.sass +17 -0
  178. data/vendor/plugins/haml/test/sass/templates/import.sass +11 -0
  179. data/vendor/plugins/haml/test/sass/templates/importee.sass +14 -0
  180. data/vendor/plugins/haml/test/sass/templates/mixins.sass +76 -0
  181. data/vendor/plugins/haml/test/sass/templates/multiline.sass +20 -0
  182. data/vendor/plugins/haml/test/sass/templates/nested.sass +25 -0
  183. data/vendor/plugins/haml/test/sass/templates/parent_ref.sass +25 -0
  184. data/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
  185. data/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass +6 -0
  186. metadata +185 -24
  187. data/app/views/admin/extension/index.html.erb +0 -40
  188. data/app/views/admin/layout/edit.html.erb +0 -39
  189. data/app/views/admin/layout/index.html.erb +0 -38
  190. data/app/views/admin/layout/remove.html.erb +0 -17
  191. data/app/views/admin/page/_meta_row.html.erb +0 -4
  192. data/app/views/admin/page/_node.html.erb +0 -28
  193. data/app/views/admin/page/_part.html.erb +0 -13
  194. data/app/views/admin/page/_tag_reference.html.erb +0 -4
  195. data/app/views/admin/page/children.html.erb +0 -4
  196. data/app/views/admin/page/edit.html.erb +0 -140
  197. data/app/views/admin/page/index.html.erb +0 -31
  198. data/app/views/admin/page/remove.html.erb +0 -14
  199. data/app/views/admin/snippet/edit.html.erb +0 -29
  200. data/app/views/admin/snippet/index.html.erb +0 -36
  201. data/app/views/admin/snippet/remove.html.erb +0 -16
  202. data/app/views/admin/user/edit.html.erb +0 -54
  203. data/app/views/admin/user/index.html.erb +0 -43
  204. data/app/views/admin/user/preferences.html.erb +0 -29
  205. data/app/views/admin/user/remove.html.erb +0 -16
  206. data/app/views/admin/welcome/login.html.erb +0 -51
  207. data/app/views/layouts/application.html.erb +0 -83
  208. data/app/views/site/not_found.html.erb +0 -3
@@ -0,0 +1,28 @@
1
+ - include_javascript 'admin/sitemap'
2
+
3
+ %h1 Pages
4
+
5
+ = render_region :top
6
+
7
+ %table#site-map.index{:summary=>"Page hierarchy of the current site"}
8
+ %thead
9
+ %tr
10
+ - render_region :sitemap_head do |sitemap_head|
11
+ - sitemap_head.title_column_header do
12
+ %th.page Page
13
+ - sitemap_head.status_column_header do
14
+ %th.status Status
15
+ - sitemap_head.modify_column_header do
16
+ %th.modify{:colspan=>"2"} Modify
17
+ %tbody
18
+ - if @homepage
19
+ = render_node @homepage
20
+ - else
21
+ %tr
22
+ %td.note{:colspan => 4} No Pages
23
+
24
+ = render_region :bottom
25
+
26
+ - unless @homepage
27
+ %p
28
+ = link_to image('new-homepage', :alt => 'New Homepage'), homepage_new_url
@@ -0,0 +1,20 @@
1
+ - pages = pluralize(@page.children.count + 1, 'Page')
2
+ %h1
3
+ Remove
4
+ = pages
5
+
6
+ %p
7
+ Are you sure you want to
8
+ %strong.warning permanently remove
9
+ the following
10
+ = pages.downcase + "?"
11
+
12
+ %table.index#site-map{:cellpadding=>0, :cellspacing=>0, :border=>0}
13
+ %tbody
14
+ = render_node @page, :simple => true
15
+
16
+ - form_tag do
17
+ %p.buttons
18
+ %input.button{:type=>"submit", :value=>"Delete Pages"}/
19
+ or
20
+ = link_to 'Cancel', page_index_url
@@ -0,0 +1,36 @@
1
+ - render_region :main do |main|
2
+ - main.edit_header do
3
+ - if @snippet.new_record?
4
+ %h1 New Snippet
5
+ - else
6
+ %h1 Edit Snippet
7
+ - main.edit_form do
8
+ - form_tag do
9
+ = hidden_field 'snippet', 'lock_version'
10
+ = render_region :form_top
11
+ .form-area
12
+ - render_region :form do |form|
13
+ - form.edit_title do
14
+ %p.title
15
+ %label{:for=>"snippet_name"} Name
16
+ = text_field "snippet", "name", :class => 'textbox', :maxlength => 100
17
+ - form.edit_content do
18
+ %p.content
19
+ %label{:for=>"snippet_content"} Body
20
+ ~ text_area "snippet", "content", :class => "textarea", :style => "width: 100%"
21
+ - form.edit_filter do
22
+ %p
23
+ %label{:for=>"snippet_filter"} Filter
24
+ = select_tag "snippet[filter_id]", options_for_select([['none', '']] + TextFilter.descendants.map { |f| f.filter_name }.sort, @snippet.filter_id), :id => 'snippet_filter'
25
+ - form.edit_timestamp do
26
+ = updated_stamp @snippet
27
+
28
+ = javascript_tag "$('snippet_name').activate()"
29
+
30
+ - render_region :form_bottom do |form_bottom|
31
+ - form_bottom.edit_buttons do
32
+ %p.buttons
33
+ = save_model_button(@snippet)
34
+ = save_model_and_continue_editing_button(@snippet)
35
+ or
36
+ = link_to 'Cancel', snippet_index_url
@@ -0,0 +1,20 @@
1
+ %h1 Snippets
2
+
3
+ %p Snippets are generally small pieces of content which are included in other pages or layouts.
4
+
5
+ %table#snippets.index{:cellspacing=>"0", :border=>"0", :cellpadding=>"0"}
6
+ %thead
7
+ %tr
8
+ %th.snippet Snippet
9
+ %th.modify Modify
10
+ %tbody
11
+ - @snippets.each do |snippet|
12
+ %tr.node.level-1
13
+ %td.snippet
14
+ = image('snippet', :alt => 'snippet-icon')
15
+ %span= link_to snippet.name, snippet_edit_url(:id => snippet)
16
+ %td.remove
17
+ = link_to image('remove', :alt => 'Remove Snippet'), snippet_remove_url(:id => snippet)
18
+
19
+ %p
20
+ = link_to image('new-snippet', :alt => 'New Snippet'), snippet_new_url
@@ -0,0 +1,19 @@
1
+ %h1 Remove Snippet
2
+
3
+ %p
4
+ Are you sure you want to
5
+ %strong.warning permanently remove
6
+ the following snippet?
7
+
8
+ %table.index#snippets{:cellpadding=>0, :cellspacing=>0, :border=>0}
9
+ %tbody
10
+ %tr.node.level-1
11
+ %td.snippet
12
+ = image('snippet', :alt => "snippet-icon")
13
+ %span.title= @snippet.name
14
+
15
+ - form_tag do
16
+ %p.buttons
17
+ %input.button{:type=>"submit", :value=>"Delete Snippet"}/
18
+ or
19
+ = link_to 'Cancel', snippet_index_url
@@ -0,0 +1,80 @@
1
+ - render_region :main do |main|
2
+ - main.edit_header do
3
+ - if @user.new_record?
4
+ %h1 New User
5
+ - else
6
+ %h1 Edit User
7
+ - main.edit_form do
8
+ - form_tag do
9
+ = hidden_field 'user', 'lock_version'
10
+ = render_region :form_top
11
+ %table.fieldset{:cellpadding=>0, :cellspacing=>0, :border=>0}
12
+ - render_region :form do |form|
13
+ - form.edit_name do
14
+ %tr
15
+ %th.label
16
+ %label{:for=>"user_name"} Name
17
+ %td.field
18
+ = text_field "user", "name", :class => 'textbox', :maxlength => 100
19
+ %td.help Required.
20
+ - form.edit_email do
21
+ %tr
22
+ %th.label
23
+ %label.optional{:for=>"user_email"} E-mail
24
+ %td.field
25
+ = text_field "user", "email", :class => 'textbox', :maxlength => 255
26
+ %td.help
27
+ Optional. Please use a valid e-mail address.
28
+ - form.edit_username do
29
+ %tr
30
+ %th.label
31
+ %label{:for=>"user_login"} Username
32
+ %td.field
33
+ = text_field "user", "login", :class => 'textbox', :maxlength => 40
34
+ %td.help
35
+ At least 3 characters. Must be unique.
36
+ - form.edit_password do
37
+ %tr
38
+ %th.label
39
+ %label{:for=>"user_password"} Password
40
+ %td.field
41
+ = password_field "user", "password", :class => 'textbox', :value => '', :maxlength => 40
42
+ %td.help{:rowspan=>2}
43
+ At least 5 characters.
44
+ - unless @user.new_record?
45
+ Leave password blank for it to remain unchanged.
46
+ %tr
47
+ %th.label
48
+ %label{:for=>"user_password_confirmation"} Confirm Password
49
+ %td.field
50
+ = password_field "user", "password_confirmation", :class => 'textbox', :value => '', :maxlength => 40
51
+ - form.edit_roles do
52
+ %tr
53
+ %th.label
54
+ %label{:for=>"user_admin"} Roles
55
+ %td.field
56
+ %span.checkbox
57
+ = check_box "user", "admin"
58
+ %label{:for=> "user_admin"} Administrator
59
+ %span.checkbox
60
+ = check_box "user", "developer"
61
+ %label{:for=> "user_developer"} Developer
62
+ %td.help
63
+ Roles restrict user privileges and turn parts of the administrative interface on or off.
64
+ - form.edit_notes do
65
+ %tr
66
+ %th.label
67
+ %label.optional{:for=>"user_notes"} Notes
68
+ %td.field
69
+ ~ text_area "user", "notes", :size => '40x4', :class => "textarea"
70
+ %td.help
71
+ Optional.
72
+ - render_region :form_bottom do |form_bottom|
73
+ - form_bottom.edit_timestamp do
74
+ = updated_stamp @user
75
+ - form_bottom.edit_buttons do
76
+ %p.buttons
77
+ = save_model_button(@user)
78
+ = save_model_and_continue_editing_button(@user)
79
+ or
80
+ = link_to "Cancel", user_index_url
@@ -0,0 +1,23 @@
1
+ %h1 Users
2
+
3
+ %table#users.index{:cellspacing=>"0", :border=>"0", :cellpadding=>"0"}
4
+ %thead
5
+ %tr
6
+ %th.user Name / Login
7
+ %th.roles Roles
8
+ %th.modify Modify
9
+ %tbody
10
+ - @users.each do |user|
11
+ %tr.node.level-1
12
+ %td.user
13
+ = link_to user.name, user_edit_url(:id => user)
14
+ %small.login= h user.login
15
+ %td.roles= roles(user)
16
+ %td.remove
17
+ - if user == current_user
18
+ = image('remove-disabled', :alt => 'Remove')
19
+ - else
20
+ = link_to(image('remove', :alt => 'Remove User'), user_remove_url(:id => user))
21
+
22
+ %p
23
+ = link_to image('new-user', :alt => 'New User'), user_new_url, :title => "New User"
@@ -0,0 +1,28 @@
1
+ %h1 User Preferences
2
+
3
+ - form_tag do
4
+ %table.fieldset{:cellpadding=>0, :cellspacing=>0, :border=>0}
5
+ %tr
6
+ %th.label
7
+ %label{:for=>"user_password"} Password
8
+ %td.field
9
+ = password_field "user", "password", :class => 'textbox', :value => '', :maxlength => 40
10
+ %td.help{:rowspan=>2}
11
+ At least 5 characters. Leave password blank for it to remain unchanged.
12
+ %tr
13
+ %th.label
14
+ %label{:for=>"user_password_confirmation"} Confirm Password
15
+ %td.field
16
+ = password_field "user", "password_confirmation", :class => 'textbox', :value => '', :maxlength => 40
17
+ %tr
18
+ %th.label
19
+ %label{:for=>"user_email"} E-mail
20
+ %td.field
21
+ = text_field "user", "email", :class => 'textbox', :maxlength => 255
22
+ %td.help Optional.
23
+ %p.buttons
24
+ = save_model_button @user
25
+ or
26
+ = link_to 'Cancel', admin_url
27
+
28
+ = javascript_tag "$('user_password').activate();"
@@ -0,0 +1,18 @@
1
+ %h1 Remove User
2
+
3
+ %p
4
+ Are you sure you want to
5
+ %strong.warning permanently remove
6
+ the following user?
7
+
8
+ %table.index#users{:cellpadding=>0, :cellspacing=>0, :border=>0}
9
+ %tbody
10
+ %tr.node.level-1
11
+ %td.user
12
+ %span.title= @user.name
13
+
14
+ - form_tag do
15
+ %p.buttons
16
+ %input.button{:type=>"submit", :value=>"Delete User"}/
17
+ or
18
+ = link_to 'Cancel', user_index_url
@@ -0,0 +1,44 @@
1
+ - content_for 'page_css' do
2
+ :sass
3
+ #content
4
+ text-align: center
5
+ #login
6
+ background-color: #f5f1e2
7
+ border: 5px solid #efead3
8
+ text-align: left
9
+ margin: 2em
10
+ margin-left: auto
11
+ margin-right: auto
12
+ padding-left: 20px
13
+ width: 23.5em
14
+ h1
15
+ font-size: 140%
16
+ margin: 0
17
+ margin-top: 18px
18
+ margin-bottom: 18px
19
+ label
20
+ float: left
21
+ clear: left
22
+ margin-top: 4px
23
+ width: 6em
24
+ input.textbox
25
+ font-size: 100%
26
+ width: 16em
27
+ .buttons
28
+ margin-top: 15px
29
+ margin-bottom: 20px
30
+
31
+ #login
32
+ %h1 Please Login
33
+
34
+ - form_tag login_url do
35
+ %p
36
+ %label{:for=>"user_login"} Username
37
+ = text_field "user", "login", :class => 'textbox', :value => '', :maxlength => 40
38
+ %p
39
+ %label{:for=>"user_password"} Password
40
+ = password_field "user", "password", :class => 'textbox', :value => '', :maxlength => 40
41
+ %p.buttons
42
+ %input.button{:type=>"submit", :value=>"Login"}/
43
+
44
+ = javascript_tag "$('user_login').activate();"
@@ -0,0 +1,54 @@
1
+ !!!
2
+ %html{html_attrs}
3
+ %head
4
+ %meta{"http-equiv"=>"Content-type", :content=>"text/html; charset=utf-8"}/
5
+ %title= @page_title || default_page_title
6
+ - @stylesheets.uniq.each do |stylesheet|
7
+ = stylesheet_link_tag stylesheet
8
+ - @javascripts.uniq.each do |javascript|
9
+ = javascript_include_tag javascript
10
+ /[if lt IE 7]
11
+ %script{:type=>"text/javascript", :src=>"/admin/javascripts/pngfix.js"}
12
+ - if @content_for_page_scripts
13
+ = javascript_tag @content_for_page_scripts
14
+ - if @content_for_page_css
15
+ %style{:type => "text/css"}= @content_for_page_css
16
+ %body
17
+ #page
18
+ #header
19
+ #site-title= link_to_unless_current title, admin_url
20
+ #site-subtitle= subtitle
21
+ - if logged_in?
22
+ #navigation= links_for_navigation
23
+ %hr{:class=>"hidden"}/
24
+ #main
25
+ - if flash[:notice]
26
+ #notice
27
+ %p= flash[:notice]
28
+ - if flash[:error]
29
+ #error
30
+ %p= flash[:error]
31
+ #content
32
+ = yield
33
+ %hr{:class=>"hidden"}/
34
+ #footer
35
+ %p
36
+ This site was made with Ruby and is powered by
37
+ %a{:href=>"http://radiantcms.org"} Radiant CMS
38
+ version
39
+ = Radiant.loaded_via_gem? ? "#{Radiant::Version} (gem)." : "#{Radiant::Version}."
40
+ %p#site-links
41
+ - if logged_in?
42
+ - if admin?
43
+ = nav_link_to 'Users', user_index_url
44
+ %span.separator=" | "
45
+ = nav_link_to 'Extensions', extension_index_url
46
+ - else
47
+ = nav_link_to 'Preferences', user_preferences_url
48
+ %span.separator=" | "
49
+ = nav_link_to 'Log Out', logout_url
50
+ %span.separator=" | "
51
+ = link_to image('view-site.gif', :alt => "View Site", :title => ''), homepage_url
52
+ - if @content_for_popups
53
+ #popups
54
+ = yield :popups
@@ -0,0 +1,3 @@
1
+ - @page_title = 'Page Not Found'
2
+ %h1=@page_title
3
+ %p The page you were looking for could not be located on this site.
@@ -0,0 +1,11 @@
1
+ class AddSaltToUsers < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :salt, :string
4
+ User.reset_column_information
5
+ User.update_all :salt => "sweet harmonious biscuits"
6
+ end
7
+
8
+ def self.down
9
+ remove_column :users, :salt
10
+ end
11
+ end
@@ -9,7 +9,7 @@
9
9
  #
10
10
  # It's strongly recommended to check this file into your version control system.
11
11
 
12
- ActiveRecord::Schema.define(:version => 18) do
12
+ ActiveRecord::Schema.define(:version => 19) do
13
13
 
14
14
  create_table "config", :force => true do |t|
15
15
  t.string "key", :limit => 40, :default => "", :null => false
@@ -96,6 +96,7 @@ ActiveRecord::Schema.define(:version => 18) do
96
96
  t.boolean "developer", :default => false, :null => false
97
97
  t.text "notes"
98
98
  t.integer "lock_version", :default => 0
99
+ t.string "salt"
99
100
  end
100
101
 
101
102
  add_index "users", ["login"], :name => "login", :unique => true
@@ -38,6 +38,7 @@ module LoginSystem
38
38
  flash[:error] = permissions[:denied_message] || 'Access denied.'
39
39
  redirect_to permissions[:denied_url] || { :action => :index }
40
40
  else
41
+ session[:return_to] = request.request_uri
41
42
  redirect_to login_url
42
43
  end
43
44
  false
@@ -5,7 +5,7 @@ unless defined? Radiant::Version
5
5
  module Version
6
6
  Major = '0'
7
7
  Minor = '6'
8
- Tiny = '6'
8
+ Tiny = '7'
9
9
 
10
10
  class << self
11
11
  def to_s
@@ -1,7 +1,10 @@
1
1
  require 'simpleton'
2
+ require 'ostruct'
2
3
 
3
4
  module Radiant
4
5
  class AdminUI
6
+ # This may be loaded before ActiveSupport, so do an explicit require
7
+ require 'radiant/admin_ui/region_set'
5
8
 
6
9
  class DuplicateTabNameError < StandardError; end
7
10
 
@@ -74,9 +77,71 @@ module Radiant
74
77
 
75
78
  attr_accessor :tabs
76
79
 
80
+ # Region sets
81
+ attr_accessor :page, :snippet, :layout, :user
82
+
77
83
  def initialize
78
84
  @tabs = TabSet.new
85
+ load_default_regions
79
86
  end
80
87
 
88
+ private
89
+
90
+ def load_default_regions
91
+ @page = load_default_page_regions
92
+ @snippet = load_default_snippet_regions
93
+ @layout = load_default_layout_regions
94
+ @user = load_default_user_regions
95
+ end
96
+
97
+ def load_default_page_regions
98
+ returning OpenStruct.new do |page|
99
+ page.edit = RegionSet.new do |edit|
100
+ edit.main.concat %w{edit_header edit_form edit_popups}
101
+ edit.form.concat %w{edit_title edit_extended_metadata
102
+ edit_page_parts}
103
+ edit.form_bottom.concat %w{edit_buttons}
104
+ edit.parts_bottom.concat %w{edit_layout_and_type edit_timestamp}
105
+ end
106
+ page.index = RegionSet.new do |index|
107
+ index.sitemap_head.concat %w{title_column_header status_column_header
108
+ modify_column_header}
109
+ index.node.concat %w{title_column status_column add_child_column remove_column}
110
+ end
111
+ page.remove = page.children = page.index
112
+ page._part = page.edit
113
+ end
114
+ end
115
+
116
+ def load_default_user_regions
117
+ returning OpenStruct.new do |user|
118
+ user.edit = RegionSet.new do |edit|
119
+ edit.main.concat %w{edit_header edit_form}
120
+ edit.form.concat %w{edit_name edit_email edit_username edit_password
121
+ edit_roles edit_notes}
122
+ edit.form_bottom.concat %w{edit_timestamp edit_buttons}
123
+ end
124
+ end
125
+ end
126
+
127
+ def load_default_snippet_regions
128
+ returning OpenStruct.new do |snippet|
129
+ snippet.edit = RegionSet.new do |edit|
130
+ edit.main.concat %w{edit_header edit_form}
131
+ edit.form.concat %w{edit_title edit_content edit_filter edit_timestamp}
132
+ edit.form_bottom.concat %w{edit_buttons}
133
+ end
134
+ end
135
+ end
136
+
137
+ def load_default_layout_regions
138
+ returning OpenStruct.new do |layout|
139
+ layout.edit = RegionSet.new do |edit|
140
+ edit.main.concat %w{edit_header edit_form}
141
+ edit.form.concat %w{edit_title edit_extended_metadata edit_content edit_timestamp}
142
+ edit.form_bottom.concat %w{edit_buttons}
143
+ end
144
+ end
145
+ end
81
146
  end
82
147
  end