alchemy_cms 2.5.0.b9 → 2.5.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/alchemy_cms.gemspec +2 -1
  2. data/app/assets/javascripts/alchemy/alchemy.base.js +0 -27
  3. data/app/assets/javascripts/alchemy/alchemy.growler.js +1 -1
  4. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +0 -1
  5. data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +0 -4
  6. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +0 -1
  7. data/app/assets/stylesheets/alchemy/admin.css.scss +1 -0
  8. data/app/assets/stylesheets/alchemy/archive.scss +8 -6
  9. data/app/assets/stylesheets/alchemy/base.scss +3 -92
  10. data/app/assets/stylesheets/alchemy/elements.scss +2 -2
  11. data/app/assets/stylesheets/alchemy/flash.scss +16 -12
  12. data/app/assets/stylesheets/alchemy/frame.scss +10 -5
  13. data/app/assets/stylesheets/alchemy/icons.scss +2 -2
  14. data/app/assets/stylesheets/alchemy/pagination.scss +5 -5
  15. data/app/assets/stylesheets/alchemy/tables.scss +2 -2
  16. data/app/assets/stylesheets/alchemy/toolbar.scss +79 -0
  17. data/app/controllers/alchemy/admin/base_controller.rb +3 -2
  18. data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
  19. data/app/controllers/alchemy/admin/pictures_controller.rb +1 -1
  20. data/app/controllers/alchemy/admin/users_controller.rb +8 -2
  21. data/app/controllers/alchemy/attachments_controller.rb +1 -1
  22. data/app/controllers/alchemy/base_controller.rb +8 -0
  23. data/app/controllers/alchemy/pages_controller.rb +4 -0
  24. data/app/controllers/alchemy/passwords_controller.rb +23 -0
  25. data/app/controllers/alchemy/user_sessions_controller.rb +20 -49
  26. data/app/controllers/alchemy/users_controller.rb +49 -0
  27. data/app/mailers/alchemy/notifications.rb +5 -0
  28. data/app/models/alchemy/content.rb +6 -2
  29. data/app/models/alchemy/element.rb +9 -5
  30. data/app/models/alchemy/essence_richtext.rb +28 -16
  31. data/app/models/alchemy/essence_text.rb +22 -13
  32. data/app/models/alchemy/message.rb +1 -1
  33. data/app/models/alchemy/page.rb +7 -2
  34. data/app/models/alchemy/user.rb +66 -24
  35. data/app/views/alchemy/admin/dashboard/index.html.erb +1 -1
  36. data/app/views/alchemy/admin/essence_files/edit.html.erb +1 -0
  37. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +8 -1
  38. data/app/views/alchemy/admin/partials/_flash.html.erb +1 -1
  39. data/app/views/alchemy/admin/users/_table.html.erb +2 -2
  40. data/app/views/alchemy/admin/users/_user.html.erb +1 -1
  41. data/app/views/alchemy/admin/users/index.html.erb +1 -1
  42. data/app/views/alchemy/notifications/admin_user_created.de.text.erb +11 -0
  43. data/app/views/alchemy/notifications/admin_user_created.en.text.erb +11 -0
  44. data/app/views/alchemy/notifications/registered_user_created.text.erb +2 -1
  45. data/app/views/alchemy/notifications/reset_password_instructions.de.text.erb +8 -0
  46. data/app/views/alchemy/notifications/reset_password_instructions.en.text.erb +8 -0
  47. data/app/views/alchemy/passwords/edit.html.erb +35 -0
  48. data/app/views/alchemy/passwords/new.html.erb +30 -0
  49. data/app/views/alchemy/user_sessions/leave.html.erb +3 -3
  50. data/app/views/alchemy/user_sessions/{login.html.erb → new.html.erb} +5 -2
  51. data/app/views/alchemy/{user_sessions/signup.html.erb → users/new.html.erb} +0 -0
  52. data/config/alchemy/config.yml +12 -0
  53. data/config/initializers/devise.rb +242 -0
  54. data/config/locales/alchemy.de.yml +12 -39
  55. data/config/locales/alchemy.en.yml +4 -31
  56. data/config/locales/devise.de.yml +57 -0
  57. data/config/locales/devise.en.yml +60 -0
  58. data/config/routes.rb +37 -21
  59. data/db/migrate/20130121092645_migrate_to_devise.rb +24 -0
  60. data/lib/alchemy/authentication_helpers.rb +0 -13
  61. data/lib/alchemy/engine.rb +2 -2
  62. data/lib/alchemy/essence.rb +2 -2
  63. data/lib/alchemy/upgrader.rb +33 -0
  64. data/lib/alchemy/version.rb +1 -1
  65. data/lib/alchemy_cms.rb +2 -1
  66. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
  67. data/lib/rails/generators/alchemy/devise/devise_generator.rb +24 -0
  68. data/lib/rails/generators/alchemy/scaffold/files/elements.yml +1 -111
  69. data/lib/rails/generators/alchemy/scaffold/templates/page_layouts.yml.tt +1 -27
  70. data/lib/tasks/ferret.rake +6 -6
  71. data/spec/controllers/admin/clipboard_controller_spec.rb +2 -3
  72. data/spec/controllers/admin/contents_controller_spec.rb +1 -2
  73. data/spec/controllers/admin/elements_controller_spec.rb +1 -2
  74. data/spec/controllers/admin/languages_controller_spec.rb +2 -3
  75. data/spec/controllers/admin/pages_controller_spec.rb +2 -3
  76. data/spec/controllers/admin/trash_controller_spec.rb +1 -2
  77. data/spec/controllers/admin/users_controller_spec.rb +36 -5
  78. data/spec/controllers/attachments_controller_spec.rb +2 -4
  79. data/spec/controllers/base_controller_spec.rb +25 -0
  80. data/spec/controllers/elements_controller_spec.rb +1 -2
  81. data/spec/controllers/passwords_controller_spec.rb +16 -0
  82. data/spec/controllers/pictures_controller_spec.rb +1 -2
  83. data/spec/controllers/user_sessions_controller_spec.rb +21 -0
  84. data/spec/controllers/users_controller_spec.rb +67 -0
  85. data/spec/dummy/db/migrate/20130121092645_migrate_to_devise.rb +24 -0
  86. data/spec/dummy/db/schema.rb +17 -16
  87. data/spec/factories.rb +2 -0
  88. data/spec/integration/pages_controller_spec.rb +9 -1
  89. data/spec/models/content_spec.rb +11 -0
  90. data/spec/models/element_spec.rb +11 -2
  91. data/spec/models/essence_richtext_spec.rb +42 -6
  92. data/spec/models/essence_text_spec.rb +41 -0
  93. data/spec/models/page_spec.rb +39 -0
  94. data/spec/models/user_spec.rb +95 -6
  95. data/spec/spec_helper.rb +2 -3
  96. data/spec/support/alchemy/controller_hacks.rb +1 -1
  97. data/spec/support/alchemy/specs_helpers.rb +4 -4
  98. metadata +47 -10
  99. data/app/models/alchemy/user_session.rb +0 -14
  100. data/app/views/alchemy/notifications/admin_user_created.text.erb +0 -13
  101. data/app/views/alchemy/user_sessions/logout.html.erb +0 -3
data/alchemy_cms.gemspec CHANGED
@@ -33,7 +33,8 @@ POST_INSTALL
33
33
  s.require_paths = ["lib"]
34
34
 
35
35
  s.add_runtime_dependency %q<rails>, ["~> 3.2.11"]
36
- s.add_runtime_dependency %q<authlogic>, ["~> 3.1.3"]
36
+ s.add_runtime_dependency %q<devise>, ["~> 2.2.3"]
37
+ s.add_runtime_dependency %q<devise-encryptable>, ["~> 0.1.1"]
37
38
  s.add_runtime_dependency %q<awesome_nested_set>, ["~> 2.0"]
38
39
  s.add_runtime_dependency %q<acts-as-taggable-on>, ["~> 2.1"]
39
40
  s.add_runtime_dependency %q<declarative_authorization>, ["= 0.5.5"]
@@ -114,33 +114,6 @@ if (typeof(Alchemy) === 'undefined') {
114
114
  Alchemy.Buttons.enable($element);
115
115
  },
116
116
 
117
- resizeFrame: function() {
118
- var options = {
119
- left: 65,
120
- right: 0
121
- };
122
- var $mainFrame = $('#main_content');
123
- var $topFrame = $('#top_menu');
124
- var view_height = $(window).height();
125
- var view_width = $(window).width();
126
- var topFrameHeight = $topFrame.height();
127
- var mainFrameHeight = view_height - topFrameHeight;
128
- var width = view_width - options.left - options.right;
129
- if ($mainFrame.length > 0) {
130
- $mainFrame.css({
131
- top: topFrameHeight,
132
- width: width,
133
- height: mainFrameHeight
134
- });
135
- }
136
- if ($topFrame.length > 0) {
137
- $topFrame.css({
138
- width: width,
139
- height: topFrameHeight
140
- });
141
- }
142
- },
143
-
144
117
  SelectBox: function(scope) {
145
118
  $('select.alchemy_selectbox', scope).selectBoxIt();
146
119
  },
@@ -20,7 +20,7 @@ if (typeof(Alchemy) === 'undefined') {
20
20
  },
21
21
 
22
22
  fade: function() {
23
- $('.flash.notice, .flash.warn', '#flash_notices').delay(5000).hide('drop', {
23
+ $('.flash.notice, .flash.warn, .flash.alert', '#flash_notices').delay(5000).hide('drop', {
24
24
  direction: "up"
25
25
  }, 400, function() {
26
26
  $(this).remove();
@@ -6,7 +6,6 @@ Alchemy.GUI =
6
6
  Alchemy.SelectBox()
7
7
  Alchemy.Datepicker()
8
8
  Alchemy.Buttons.observe()
9
- Alchemy.resizeFrame()
10
9
 
11
10
  initElement: ($el) ->
12
11
  Alchemy.ElementDirtyObserver($el)
@@ -26,7 +26,3 @@ $ ->
26
26
  url = Alchemy.current_url
27
27
  delimiter = if url.match(/\?/) then '&' else '?'
28
28
  window.location = url + delimiter + 'locale=' + $(this).val()
29
-
30
- # Resize the Alchemy frame on every browser resize.
31
- jQuery(window).resize ->
32
- Alchemy.resizeFrame()
@@ -34,7 +34,6 @@ if (typeof(Alchemy) === 'undefined') {
34
34
  });
35
35
  $('#sort_panel .button').click(Alchemy.pleaseWaitOverlay);
36
36
  Alchemy.PageSorter.disableButton();
37
- Alchemy.resizeFrame();
38
37
  },
39
38
 
40
39
  disableButton: function() {
@@ -4,6 +4,7 @@
4
4
  */
5
5
  @import "alchemy/defaults";
6
6
  @import "alchemy/base";
7
+ @import "alchemy/toolbar";
7
8
  @import "alchemy/archive";
8
9
  @import "alchemy/dashboard";
9
10
  @import "alchemy/elements";
@@ -4,7 +4,6 @@ div#image_assign_filter_and_image_sizing {
4
4
  }
5
5
 
6
6
  #picture_archive {
7
- padding: 4 * $default-padding;
8
7
 
9
8
  .selected_item_tools {
10
9
  margin: -4*$default-padding;
@@ -133,7 +132,7 @@ div#image_assign_filter_and_image_sizing {
133
132
  }
134
133
 
135
134
  #pictures {
136
- padding-right: 232px;
135
+ margin-right: 232px;
137
136
 
138
137
  .picture_thumbnail {
139
138
  margin: 0 8px 8px 0;
@@ -243,11 +242,13 @@ div.image_spinner {
243
242
  }
244
243
 
245
244
  div#library_sidebar {
245
+ @include box-sizing(border-box);
246
246
  position: absolute;
247
247
  border-left: 1px solid $default-border-color;
248
248
  top: 0;
249
249
  right: 0;
250
- width: 200px;
250
+ width: 232px;
251
+ padding-top: 96px;
251
252
  padding: 0 4*$default-padding;
252
253
  height: 100%;
253
254
  z-index: 1;
@@ -266,7 +267,8 @@ div#filter_bar {
266
267
  }
267
268
 
268
269
  div#tag_list {
269
- height: 90%;
270
+ @include box-sizing(border-box);
271
+ height: 85%;
270
272
 
271
273
  .js_filter_field_box {
272
274
 
@@ -277,8 +279,8 @@ div#tag_list {
277
279
  ul {
278
280
  list-style-type: none;
279
281
  padding: 0;
280
- margin: $default-margin 0 3*$default-margin 0;
281
- height: inherit;
282
+ margin: $default-margin 0;
283
+ height: 95%;
282
284
  width: 204px;
283
285
  overflow-x: hidden;
284
286
  overflow-y: auto;
@@ -215,71 +215,6 @@ div#user_list_legend {
215
215
  width: 370px;
216
216
  }
217
217
 
218
- #toolbar {
219
- z-index: 10;
220
- padding: 4px;
221
- height: 44px;
222
- background: $medium-gray url('shading.png') repeat-x 0 -40px;
223
- margin-right: 0px;
224
- border: $default-border;
225
- border-top-style: none;
226
- border-right-style: none;
227
- @include bottom-left-rounded-border;
228
- position: relative;
229
- margin-left: 5px;
230
- }
231
-
232
- #toolbar form {
233
- margin: 0 0 0 8px;
234
- float: right;
235
- text-align: center;
236
- }
237
-
238
- #toolbar div.button_with_label form {
239
- float: none;
240
- margin: 0;
241
- @include inline-block;
242
- line-height: 5px;
243
- }
244
-
245
- #toolbar div.button_with_label form label {
246
- margin-top: $default-margin;
247
- }
248
-
249
- #toolbar div p {
250
- float: right;
251
- margin: 3px $default-margin 0 0;
252
- padding: 0;
253
- }
254
-
255
- div#toolbar div.toolbar_spacer {
256
- float: left;
257
- width: 1px;
258
- height: 37px;
259
- border-right-style: dotted;
260
- border-right-width: 1px;
261
- margin-right: 2*$default-margin;
262
- margin-left: $default-margin;
263
- }
264
-
265
- div#toolbar a.button {
266
- width: 25px;
267
- height: 21px;
268
- text-decoration: none;
269
- float: right;
270
- border-width: 0;
271
- border-style: none;
272
- font-size: 0;
273
- padding: 0;
274
- background-repeat: no-repeat;
275
- background-position: 0 0;
276
- }
277
-
278
- div#toolbar a.button:active {
279
- text-decoration: none;
280
- background-position: 0 -21px;
281
- }
282
-
283
218
  #page_sorting_panel p {
284
219
  margin-top: 1em;
285
220
  }
@@ -303,7 +238,7 @@ li.odd {
303
238
 
304
239
  ul.list {
305
240
  margin: 0;
306
- padding: 2*$default-padding;
241
+ padding: 0;
307
242
  list-style-type: none;
308
243
  }
309
244
 
@@ -361,15 +296,6 @@ table td.tools .icon, table td.icon .icon {
361
296
  margin-right: 4px;
362
297
  }
363
298
 
364
- #archive_all {
365
- padding: 4*$default-padding;
366
-
367
- .padding_left_right {
368
- padding-right: 8px;
369
- padding-left: 8px;
370
- }
371
- }
372
-
373
299
  div.spinner {
374
300
  background-color: #ffffff;
375
301
  width: 100%;
@@ -519,22 +445,6 @@ div#images {
519
445
  overflow: visible;
520
446
  }
521
447
 
522
- #toolbar_links {
523
- line-height: 21px;
524
- margin-left: 8px;
525
- float: left;
526
- }
527
-
528
- div#toolbar_buttons {
529
- float: left;
530
- margin-right: 6px;
531
- }
532
-
533
- div#toolbar_buttons_right {
534
- float: right;
535
- margin-left: 8px;
536
- }
537
-
538
448
  p.foot_note {
539
449
  font-size: 10px;
540
450
  line-height: 1.5em;
@@ -889,9 +799,10 @@ select#url_protocol.medium {
889
799
  width: 76px;
890
800
  }
891
801
 
892
- #alchemy .ui-dialog-content p.buttons {
802
+ #alchemy .ui-dialog .ui-dialog-content .buttons {
893
803
  text-align: right;
894
804
  margin: 0;
805
+ padding: 0;
895
806
 
896
807
  label {
897
808
  float: left;
@@ -710,12 +710,12 @@ div.content_editor {
710
710
  label { margin-bottom: 4px }
711
711
 
712
712
  .selectboxit-container {
713
- box-sizing: border-box;
713
+ @include box-sizing(border-box);
714
714
  width: 100%;
715
715
  }
716
716
 
717
717
  .selectboxit {
718
- box-sizing: border-box;
718
+ @include box-sizing(border-box);
719
719
  width: 100% !important;
720
720
  height: 100%;
721
721
  }
@@ -4,6 +4,21 @@ div#flash_notices {
4
4
  z-index: 400000;
5
5
  width: 348px;
6
6
  top: 0;
7
+
8
+ .flash.error {
9
+ cursor: pointer;
10
+ padding-right: 24px;
11
+
12
+ &:after {
13
+ content: '';
14
+ position: absolute;
15
+ right: 2*$default-padding;
16
+ top: 2*$default-padding;
17
+ width: 16px;
18
+ height: 16px;
19
+ background: url(ui-icons_666666_256x240.png) -96px -128px no-repeat;
20
+ }
21
+ }
7
22
  }
8
23
 
9
24
  div.flash {
@@ -34,17 +49,6 @@ div.flash {
34
49
  border-color: $error_border_color;
35
50
  color: $error_text_color;
36
51
  background-color: $error_background_color;
37
- cursor: pointer;
38
-
39
- &:after {
40
- content: '';
41
- position: absolute;
42
- right: 2*$default-padding;
43
- top: 2*$default-padding;
44
- width: 16px;
45
- height: 16px;
46
- background: url(ui-icons_666666_256x240.png) -96px -128px no-repeat;
47
- }
48
52
  }
49
53
 
50
54
  &.info {
@@ -53,7 +57,7 @@ div.flash {
53
57
  background-color: #cadbf3;
54
58
  }
55
59
 
56
- &.warn, &.warning {
60
+ &.warn, &.warning, &.alert {
57
61
  border-color: #c4c19c;
58
62
  color: #726d23;
59
63
  background-color: #f3f0c1;
@@ -1,7 +1,9 @@
1
1
  #top_menu {
2
+ @include box-sizing(border-box);
2
3
  position: fixed;
3
4
  top: 0;
4
- left: 65px;
5
+ margin-left: 65px;
6
+ padding-right: 65px;
5
7
  z-index: 5;
6
8
  width: 100%;
7
9
  @include disable-user-select;
@@ -135,11 +137,14 @@ div#overlay_text_box {
135
137
  }
136
138
 
137
139
  #main_content {
140
+ @include box-sizing(border-box);
138
141
  background-color: $light-gray;
139
- position: absolute;
140
- left: 65px;
142
+ padding-top: 96px;
143
+ padding-right: 4 * $default-padding;
144
+ padding-bottom: 4 * $default-padding;
145
+ padding-left: 82px;
141
146
  z-index: 0;
142
- width: 93%;
147
+ width: 100%;
143
148
  height: 100%;
144
149
  }
145
150
 
@@ -149,7 +154,7 @@ div#user_info {
149
154
  line-height: 27px;
150
155
  height: 29px;
151
156
  font-size: 11px;
152
- right: 0;
157
+ right: 65px;
153
158
  top: -3px;
154
159
  padding: 0 8px;
155
160
  background-color: $light-blue;
@@ -235,7 +235,7 @@
235
235
  background-position: -448px -136px;
236
236
  }
237
237
 
238
- &.tick, &.true {
238
+ &.tick, &.true, &.notice {
239
239
  background-position: -32px -73px;
240
240
  }
241
241
 
@@ -295,7 +295,7 @@
295
295
  background-position: -31px -137px;
296
296
  }
297
297
 
298
- &.warning, &.warn {
298
+ &.warning, &.warn, &.alert {
299
299
  background-position: 0 -168px;
300
300
  }
301
301
 
@@ -1,11 +1,11 @@
1
1
  div.pagination {
2
- clear: both;
3
- zoom: 1;
4
- text-align: right;
2
+ background: $light_gray;
3
+ width: 100%;
4
+ left: 82px;
5
5
  line-height: 24px;
6
6
  height: 24px;
7
- width: 100%;
8
- margin-top: 4*$default-padding;
7
+ padding: 2 * $default-padding 0;
8
+ text-align: right;
9
9
 
10
10
  a, span, em {
11
11
  font-size: $default-font-size;
@@ -42,12 +42,12 @@ td.label, td.input, td.submit, td.select, td.value, td.note {
42
42
  td.select {
43
43
 
44
44
  .selectboxit-container {
45
- box-sizing: border-box;
45
+ @include box-sizing(border-box);
46
46
  width: 100%;
47
47
  }
48
48
 
49
49
  .selectboxit {
50
- box-sizing: border-box;
50
+ @include box-sizing(border-box);
51
51
  width: 100% !important;
52
52
  height: 100%;
53
53
  }
@@ -0,0 +1,79 @@
1
+ #toolbar {
2
+ z-index: 10;
3
+ padding: 4px;
4
+ height: 44px;
5
+ background: $medium-gray url('shading.png') repeat-x 0 -40px;
6
+ margin-right: 0px;
7
+ border: $default-border;
8
+ border-top-style: none;
9
+ border-right-style: none;
10
+ @include bottom-left-rounded-border;
11
+ position: relative;
12
+ margin-left: 5px;
13
+
14
+ form {
15
+ margin: 0 8px;
16
+ float: right;
17
+ text-align: center;
18
+ }
19
+
20
+ div.button_with_label {
21
+
22
+ form {
23
+ float: none;
24
+ margin: 0;
25
+ @include inline-block;
26
+ line-height: 5px;
27
+
28
+ select { margin: 0 }
29
+
30
+ label {
31
+ margin-top: $default-margin;
32
+ }
33
+ }
34
+ }
35
+
36
+ div p {
37
+ float: right;
38
+ margin: 3px $default-margin 0 0;
39
+ padding: 0;
40
+ }
41
+
42
+ div.toolbar_spacer {
43
+ float: left;
44
+ width: 1px;
45
+ height: 37px;
46
+ border-right-style: dotted;
47
+ border-right-width: 1px;
48
+ margin-right: 2*$default-margin;
49
+ margin-left: $default-margin;
50
+ }
51
+
52
+ a.button {
53
+ width: 25px;
54
+ height: 21px;
55
+ text-decoration: none;
56
+ float: right;
57
+ border-width: 0;
58
+ border-style: none;
59
+ font-size: 0;
60
+ padding: 0;
61
+ background-repeat: no-repeat;
62
+ background-position: 0 0;
63
+
64
+ &:active {
65
+ text-decoration: none;
66
+ background-position: 0 -21px;
67
+ }
68
+ }
69
+ }
70
+
71
+ div#toolbar_buttons {
72
+ float: left;
73
+ margin-right: 6px;
74
+ }
75
+
76
+ div#toolbar_buttons_right {
77
+ float: right;
78
+ margin-left: 8px;
79
+ }