trusty-cms 2.0.2.pre.beta → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +2 -0
  3. data/CONTRIBUTORS.md +3 -1
  4. data/Gemfile +6 -1
  5. data/Gemfile.lock +100 -80
  6. data/INSTALL.md +7 -6
  7. data/README.md +3 -1
  8. data/Rakefile +24 -4
  9. data/app/assets/javascripts/admin/jquery-ui.js +3787 -2339
  10. data/app/assets/javascripts/admin/page-edit.js +3 -3
  11. data/app/assets/javascripts/admin/tabcontrol.js.erb +16 -16
  12. data/app/assets/javascripts/admin/treetable.js +4 -2
  13. data/app/assets/stylesheets/admin/_base.scss +4 -4
  14. data/app/assets/stylesheets/admin/modules/_links.scss +1 -1
  15. data/app/assets/stylesheets/admin/partials/_content.scss +9 -2
  16. data/app/assets/stylesheets/admin/partials/_forms.scss +97 -29
  17. data/app/assets/stylesheets/admin/partials/_header.scss +2 -3
  18. data/app/assets/stylesheets/admin/partials/_index.scss +9 -6
  19. data/app/assets/stylesheets/admin/partials/_layout.scss +1 -2
  20. data/app/assets/stylesheets/admin/partials/_popup.scss +0 -11
  21. data/app/assets/stylesheets/admin/partials/_tabcontrol.scss +4 -4
  22. data/app/assets/stylesheets/admin/partials/_typography.scss +4 -0
  23. data/app/controllers/admin/pages_controller.rb +9 -1
  24. data/app/controllers/admin/references_controller.rb +8 -1
  25. data/app/controllers/admin/users_controller.rb +1 -1
  26. data/app/controllers/admin/welcome_controller.rb +3 -3
  27. data/app/controllers/site_controller.rb +1 -1
  28. data/app/helpers/admin/node_helper.rb +4 -4
  29. data/app/models/trusty_cms/config.rb +2 -1
  30. data/app/views/admin/configuration/edit.html.haml +2 -2
  31. data/app/views/admin/configuration/show.html.haml +1 -1
  32. data/app/views/admin/layouts/_form.html.haml +1 -1
  33. data/app/views/admin/layouts/remove.html.haml +1 -1
  34. data/app/views/admin/pages/_fields.html.haml +1 -1
  35. data/app/views/admin/pages/_node.html.haml +2 -2
  36. data/app/views/admin/pages/edit.html.haml +1 -1
  37. data/app/views/admin/pages/remove.html.haml +2 -2
  38. data/app/views/admin/preferences/edit.html.haml +36 -36
  39. data/app/views/admin/users/_form.html.haml +1 -1
  40. data/app/views/admin/users/_password_fields.html.haml +1 -1
  41. data/app/views/admin/users/remove.html.haml +1 -1
  42. data/app/views/admin/welcome/login.html.haml +1 -1
  43. data/app/views/layouts/application.html.haml +18 -16
  44. data/config/application.rb +2 -1
  45. data/config/boot.rb +0 -1
  46. data/config/database.mysql.yml +3 -3
  47. data/config/environments/development.rb +1 -0
  48. data/config/environments/test.rb +2 -4
  49. data/config/initializers/trusty_cms_config.rb +1 -0
  50. data/config/routes.rb +1 -0
  51. data/db/migrate/001_create_radiant_tables.rb +2 -1
  52. data/db/migrate/20100805155020_convert_page_metas.rb +0 -13
  53. data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +0 -4
  54. data/db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb +0 -1
  55. data/lib/generators/instance/templates/databases/mysql.yml +3 -3
  56. data/lib/generators/instance/templates/instance_gemfile +2 -2
  57. data/lib/generators/trusty_cms/templates/database.yml.erb +4 -4
  58. data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -1
  59. data/lib/login_system.rb +1 -1
  60. data/lib/tasks/database.rake +1 -3
  61. data/lib/tasks/framework.rake +1 -1
  62. data/lib/trusty_cms.rb +1 -1
  63. data/lib/trusty_cms/admin_ui.rb +2 -0
  64. data/lib/trusty_cms/extension_migrator.rb +1 -2
  65. data/lib/trusty_cms/initializer.rb +1 -1
  66. data/lib/trusty_cms/setup.rb +1 -1
  67. data/spec/ci/database.mysql.yml +1 -1
  68. data/spec/dummy/README.rdoc +28 -0
  69. data/spec/dummy/Rakefile +5 -0
  70. data/spec/dummy/bin/bundle +3 -0
  71. data/spec/dummy/bin/rails +4 -0
  72. data/spec/dummy/bin/rake +4 -0
  73. data/spec/dummy/bin/setup +29 -0
  74. data/spec/dummy/config.ru +4 -0
  75. data/spec/dummy/config/application.rb +152 -0
  76. data/spec/dummy/config/boot.rb +6 -0
  77. data/spec/dummy/config/database.yml +28 -0
  78. data/spec/dummy/config/environment.rb +5 -0
  79. data/spec/dummy/config/environments/development.rb +49 -0
  80. data/spec/dummy/config/environments/production.rb +79 -0
  81. data/spec/dummy/config/environments/test.rb +42 -0
  82. data/spec/dummy/config/initializers/assets.rb +11 -0
  83. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  84. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  85. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  86. data/spec/dummy/config/initializers/inflections.rb +16 -0
  87. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  88. data/spec/dummy/config/initializers/session_store.rb +3 -0
  89. data/spec/dummy/config/initializers/trusty_cms_config.rb +20 -0
  90. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  91. data/spec/dummy/config/locales/en.yml +23 -0
  92. data/spec/dummy/config/routes.rb +0 -0
  93. data/spec/dummy/config/secrets.yml +22 -0
  94. data/spec/dummy/db/schema.rb +122 -0
  95. data/spec/dummy/public/404.html +67 -0
  96. data/spec/dummy/public/422.html +67 -0
  97. data/spec/dummy/public/500.html +66 -0
  98. data/spec/dummy/public/favicon.ico +0 -0
  99. data/spec/features/pages_spec.rb +2 -2
  100. data/spec/rails_helper.rb +3 -4
  101. data/spec/spec_helper.rb +13 -77
  102. data/spec/support/custom_actions.rb +1 -0
  103. data/trusty_cms.gemspec +4 -2
  104. metadata +171 -182
  105. data/db/migrate/003_rename_behavior_column.rb +0 -9
  106. data/db/migrate/010_merge_behaviors_and_pages.rb +0 -57
  107. data/db/migrate/011_rename_type_column_on_page_to_class_name.rb +0 -9
  108. data/db/migrate/019_add_salt_to_users.rb +0 -11
  109. data/spec/helpers/regions_helper_spec.rb +0 -16
@@ -11,7 +11,7 @@
11
11
  }
12
12
  )
13
13
  }
14
- }
14
+ };
15
15
 
16
16
  PageEdit.partAdded = function (tabId) {
17
17
  $('#add_part_busy').hide();
@@ -20,12 +20,12 @@
20
20
  $('#part_name_field').val('');
21
21
  TabControl.updateTabsBasedOnPages();
22
22
  TabControl.selectTab($('div#tab_control .tabs .tab').last().attr('id'));
23
- }
23
+ };
24
24
 
25
25
  PageEdit.partLoading = function () {
26
26
  $('#add_part_button').attr('disabled', true);
27
27
  $('#add_part_busy').show();
28
- }
28
+ };
29
29
 
30
30
  PageEdit.validPartName = function () {
31
31
  var partNameField = $('#part_name_field');
@@ -15,32 +15,32 @@
15
15
  TabControl.removeTab($(this).closest('.tab').attr('id'));
16
16
  });
17
17
 
18
- TabControl.selectTab($pages.first().attr('id'));
18
+ TabControl.selectTab($pages.first().attr('id').replace(/-/, "_"));
19
19
  }
20
20
  }
21
21
 
22
+ TabControl.selectTab = function(id) {
23
+ id = id.replace(/^tab_/, '').replace(/^page_/, '');
24
+ var underscored_id = id.replace(/_/g, "-").toLowerCase();
25
+ var $pages = $('div#tab_control .pages .page');
26
+ var $tabs = $('div#tab_control .tabs .tab');
27
+
28
+ $pages.hide();
29
+ $tabs.removeClass('here');
30
+
31
+ $pages.filter('#page_' + underscored_id).show();
32
+ $tabs.filter('#tab_' + id).addClass('here');
33
+ }
34
+
22
35
  TabControl.addTab = function(tabText) {
23
36
  $('div#tab_control .tabs').append("<a id='tab_" + tabText + "' href='#' class='tab'><span>" + tabText + "</span><img src='" + relative_url_root + "<%= asset_path('admin/tab_close.png') %>' class='close' alt='Remove part' title='Remove part' /></a>");
24
37
  var $page_part_index = $('#page_part_index_field');
25
38
  $page_part_index.val(parseInt($page_part_index.val()) + 1);
26
39
  }
27
40
 
28
- TabControl.selectTab = function(id) {
29
- id = id.replace(/^tab_/, '').replace(/^page_/, '');
30
- var underscored_id = id.replace("_", "-");
31
- var $pages = $('div#tab_control .pages .page');
32
- var $tabs = $('div#tab_control .tabs .tab');
33
-
34
- $pages.hide();
35
- $tabs.removeClass('here');
36
-
37
- $pages.filter('#page_' + underscored_id).show();
38
- $tabs.filter('#tab_' + id).addClass('here');
39
- }
40
-
41
41
  TabControl.removeTab = function(id) {
42
- id = id.replace(/^tab_/, '').replace(/^page_/, '');
43
- var underscored_id = id.replace("_", "-");
42
+ id = id.replace(/^tab_/, '').replace(/^page_/, '').toLowerCase();
43
+ var underscored_id = id.replace("_", "-").toLowerCase();
44
44
  if(confirm('Remove the "' + id + '" part?')) {
45
45
  var $pages = $('div#tab_control .pages .page');
46
46
  var $tabs = $('div#tab_control .tabs .tab');
@@ -25,15 +25,16 @@ $(function() {
25
25
  },
26
26
  onNodeExpand: function() {
27
27
  var node = this;
28
+ var spinner = $($(node.row[0]).find(".busy")[0]);
29
+ spinner.show();
28
30
  persistStore.set(node.id, 'expanded');
29
31
  // Render loader/spinner while loading
30
32
  $.ajax({
31
- async: false, // Must be false, otherwise loadBranch happens after showChildren?
33
+ async: true, // Must be false, otherwise loadBranch happens after showChildren?
32
34
  url: "/admin/pages/" + node.row.data('ttPageId') + "/children?index=" + node.id
33
35
  }).done(function(html) {
34
36
  var rows = $(html).filter("tr");
35
37
 
36
-
37
38
  $("#pages").treetable("loadBranch", node, rows);
38
39
  $.each(node.children, function() {
39
40
  var state = persistStore.get(this.id);
@@ -44,6 +45,7 @@ $(function() {
44
45
  $('a.dropdown').each(function(){
45
46
  Dropdown.setup(this);
46
47
  });
48
+ spinner.hide();
47
49
  });
48
50
  }
49
51
  });
@@ -1,14 +1,14 @@
1
1
  // Fonts
2
- $base-font-family: "Lucida Grande", "Bitstream Vera Sans", Helvetica, Verdana, Arial, sans-serif;
2
+ $base-font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
3
3
  $base-font-size: 15px;
4
4
 
5
5
  // Links
6
- $base-link-color: #0066cc;
6
+ $base-link-color:#94BDC3 ;
7
7
  $alt-link-color: red;
8
8
 
9
9
  // Header
10
- $header: #ca0000 !default;
11
- $primary-tab: rgba(white, 0.3);
10
+ $header: #000 !default;
11
+ $primary-tab: rgba(236, 6, 115, 0.6);
12
12
  $primary-tab-current: white;
13
13
 
14
14
  // Modules
@@ -8,7 +8,7 @@
8
8
 
9
9
  @mixin alt-link {
10
10
  color: $alt-link-color;
11
- text-decoration: underline;
11
+ text-decoration: none;
12
12
  &:hover {
13
13
  text-decoration: none;
14
14
  }
@@ -25,9 +25,16 @@ table.fieldset {
25
25
  }
26
26
 
27
27
  body.reversed {
28
+ fieldset h1 {
29
+ font-size: 1.5em;
30
+ }
31
+ #content > h1:first-of-type {
32
+ font-size: 2em;
33
+ }
28
34
  h1 {
29
- border-bottom: 1px solid #ababab;
30
- background: #7e7e7e;
35
+ color: #94BDC3;
36
+ border-bottom: 1px solid #94BDC3;
37
+ background: #fff;
31
38
  font-size: 125%;
32
39
  margin: -20px -20px 20px;
33
40
  padding: 15px 20px;
@@ -16,12 +16,14 @@
16
16
  p {
17
17
  label {
18
18
  display: block;
19
- &.checkbox, &.radio {
19
+ &.checkbox,
20
+ &.radio {
20
21
  display: inline;
21
22
  font-weight: normal;
22
23
  font-size: 95%;
23
24
  text-shadow: none;
24
25
  margin-right: 1em;
26
+ text-align: left;
25
27
  }
26
28
  &.multi_option {
27
29
  margin-bottom: 0.3em;
@@ -32,7 +34,8 @@
32
34
  font-size: 140%;
33
35
  margin-bottom: 0;
34
36
  }
35
- input.checkbox, input.radio {
37
+ input.checkbox,
38
+ input.radio {
36
39
  margin-top: 0.3em;
37
40
  }
38
41
  textarea {
@@ -51,7 +54,6 @@
51
54
  text-shadow: 0px 0px 20px rgba(255, 255, 255, 0.1);
52
55
  }
53
56
  a {
54
- color: white;
55
57
  &.action {
56
58
  background-color: #7e7e7e;
57
59
  font-size: 75%;
@@ -83,17 +85,6 @@
83
85
  margin: 0 1em 0 0;
84
86
  }
85
87
  }
86
- .buttons {
87
- color: #666666;
88
- font-size: 80%;
89
- margin: 2.5em 0 1em;
90
- button, input.button {
91
- font-size: 150%;
92
- }
93
- a {
94
- @include alt-link;
95
- }
96
- }
97
88
  }
98
89
  }
99
90
 
@@ -103,7 +94,7 @@
103
94
  }
104
95
 
105
96
  .drawer_contents {
106
- background: #7e7e7e;
97
+ background: #c9c9c9;
107
98
  @include border-bottom-right-radius(6px);
108
99
  margin: 0;
109
100
  margin-right: 2px;
@@ -121,7 +112,8 @@
121
112
  margin: 0;
122
113
  padding: 0;
123
114
  width: 100%;
124
- th, td {
115
+ th,
116
+ td {
125
117
  border-top: 1px #999999 solid;
126
118
  padding: 6px;
127
119
  }
@@ -153,7 +145,8 @@
153
145
  }
154
146
  }
155
147
  tr:first-child {
156
- td, th {
148
+ td,
149
+ th {
157
150
  border-top: none;
158
151
  }
159
152
  }
@@ -175,7 +168,9 @@
175
168
  text-shadow: #666666 1px 1px 0;
176
169
  text-decoration: none;
177
170
  @include border-bottom-radius(6px);
178
- &:hover, &:active, &:focus {
171
+ &:hover,
172
+ &:active,
173
+ &:focus {
179
174
  text-decoration: underline;
180
175
  }
181
176
  &.more {
@@ -189,7 +184,7 @@
189
184
 
190
185
  .box {
191
186
  color: #333333;
192
- background: #f5f1e2;
187
+ background: #ffffff;
193
188
  font-size: 90%;
194
189
  padding: 1px 15px 10px;
195
190
  position: relative;
@@ -200,7 +195,9 @@
200
195
  position: relative;
201
196
  }
202
197
  &:before {
203
- @include linear-gradient(color-stops(white, #f5f1e2 50%, #f5f1e2));
198
+ @include linear-gradient(color-stops(white,
199
+ #f5f1e2 50%,
200
+ #f5f1e2));
204
201
  @include border-top-radius(10px);
205
202
  content: "\0020";
206
203
  display: block;
@@ -282,9 +279,8 @@ body.reversed {
282
279
  form {
283
280
  p {
284
281
  label {
285
- color: whitesmoke;
282
+ color: #B9B9B9;
286
283
  font-weight: normal;
287
- text-shadow: 1px 1px 0 #888888;
288
284
  .hint {
289
285
  display: inline;
290
286
  }
@@ -298,11 +294,14 @@ body.reversed {
298
294
  @include alt-box;
299
295
  }
300
296
  fieldset {
301
- background: #858585;
297
+ background: #fff;
302
298
  padding: 20px 15px;
303
299
  margin-bottom: 20px;
304
300
  overflow: hidden;
305
- @include single-box-shadow(#ababab, 1px, 1px, 0);
301
+ @include single-box-shadow(#ababab,
302
+ 1px,
303
+ 1px,
304
+ 0);
306
305
  @include border-radius(8px);
307
306
  h3 {
308
307
  font-weight: bold;
@@ -320,10 +319,27 @@ body.reversed {
320
319
  color: #eeeeee;
321
320
  }
322
321
  textarea {
323
- border: 1px solid white;
322
+ border: 1px solid #EAEAEA;
323
+ }
324
+ input:not([type=submit]):focus,
325
+ textarea:focus {
326
+ border: 1px #EC65A5;
327
+ -webkit-box-shadow: 0 0 10px #EC65A5;
328
+ -moz-box-shadow: 0 0 10px #EC65A5;
329
+ box-shadow: 0 0 10px #EC65A5;
330
+ outline: 0;
331
+ }
332
+ input[type=checkbox] {
333
+ border-radius: 5px;
324
334
  }
325
335
  .box {
326
- @include single-box-shadow(rgba(0, 0, 0, 0.15), 2px, 2px, 3px);
336
+ @include single-box-shadow(rgba(0,
337
+ 0,
338
+ 0,
339
+ 0.15),
340
+ 2px,
341
+ 2px,
342
+ 3px);
327
343
  }
328
344
  }
329
345
  }
@@ -332,7 +348,9 @@ body.single_form {
332
348
  #content {
333
349
  #single_form {
334
350
  background: #f5f1e2;
335
- @include linear-gradient(color-stops(#fdfcf9, #f5f1e2 25%, #f5f1e2));
351
+ @include linear-gradient(color-stops(#fdfcf9,
352
+ #f5f1e2 25%,
353
+ #f5f1e2));
336
354
  border: 0.35em solid #efead3;
337
355
  padding: 0.5em 1.5em;
338
356
  padding-right: 22px;
@@ -345,7 +363,8 @@ body.single_form {
345
363
  }
346
364
  p {
347
365
  font-size: 90%;
348
- &.intro, &.error {
366
+ &.intro,
367
+ &.error {
349
368
  font-size: 100%;
350
369
  line-height: 1.4;
351
370
  }
@@ -404,7 +423,8 @@ body.single_form {
404
423
  }
405
424
  }
406
425
 
407
- body.edit_user, body.edit_personal_preferences {
426
+ body.edit_user,
427
+ body.edit_personal_preferences {
408
428
  #avatar {
409
429
  left: 26em;
410
430
  position: absolute;
@@ -417,3 +437,51 @@ body.edit_user, body.edit_personal_preferences {
417
437
  }
418
438
  }
419
439
  }
440
+
441
+ .button,
442
+ button,
443
+ input[type=button],
444
+ input[type=submit],
445
+ input[type=file] {
446
+ .fa {
447
+ color: #f3f3f3;
448
+ }
449
+ -webkit-appearance: none;
450
+ font-size: 1.1em;
451
+ padding: .5em 3em;
452
+ margin: 0.5em;
453
+ color: #f3f3f3;
454
+ background-color: #94BDC3;
455
+ border: 0;
456
+ -webkit-border-radius: 5px;
457
+ -moz-border-radius: 5px;
458
+ border-radius: 5px;
459
+ text-decoration: none;
460
+ &:hover {
461
+ color: #94BDC3;
462
+ background-color: #f3f3f3;
463
+ -webkit-transition: all .2s;
464
+ -moz-transition: all .2s;
465
+ -ms-transition: all .2s;
466
+ -o-transition: all .2s;
467
+ transition: all .2s;
468
+ }
469
+ &:hover > .fa {
470
+ color: #94BDC3;
471
+ -webkit-transition: all .2s;
472
+ -moz-transition: all .2s;
473
+ -ms-transition: all .2s;
474
+ -o-transition: all .2s;
475
+ transition: all .2s;
476
+ }
477
+ }
478
+
479
+ .hover {
480
+ color: #94BDC3;
481
+ background-color: #f3f3f3;
482
+ -webkit-transition: all .2s;
483
+ -moz-transition: all .2s;
484
+ -ms-transition: all .2s;
485
+ -o-transition: all .2s;
486
+ transition: all .2s;
487
+ }
@@ -19,7 +19,7 @@
19
19
  color: mix($header, white, 15%);
20
20
  font-size: 80%;
21
21
  float: right;
22
- padding: 15px 10px 0 5px;
22
+ padding: 12px 10px 0 5px;
23
23
  height: 16px;
24
24
  a {
25
25
  color: white;
@@ -104,8 +104,7 @@ ul#secondary_navigation {
104
104
  li {
105
105
  float: left;
106
106
  display: block;
107
- background: image-url("admin/navigation_secondary_separator.gif") bottom right no-repeat;
108
- padding-right: 2px;
107
+ border-right: 1px solid #d3d3d3;
109
108
  a {
110
109
  color: #555555;
111
110
  display: block;
@@ -35,7 +35,8 @@ table.index {
35
35
  text-align: left;
36
36
  padding: 4px 9px;
37
37
  border-top: 1px solid #f0f0f0;
38
- a.action, span.action.disabled {
38
+ a.action,
39
+ span.action.disabled {
39
40
  padding: 6px;
40
41
  margin: 0 25px 0 1px;
41
42
  img {
@@ -81,7 +82,7 @@ table.index {
81
82
  color: black;
82
83
  text-decoration: none;
83
84
  &:hover {
84
- color: #0066cc;
85
+ color: #EC0673;
85
86
  text-decoration: underline;
86
87
  }
87
88
  }
@@ -95,7 +96,8 @@ table.index {
95
96
  &:first-child {
96
97
  border-top: 1px solid white;
97
98
  }
98
- &.hover, &:hover {
99
+ &.hover,
100
+ &:hover {
99
101
  td {
100
102
  border-top: 1px solid #d5f0ff;
101
103
  border-bottom: 1px solid #c5dff5;
@@ -105,7 +107,8 @@ table.index {
105
107
  }
106
108
  }
107
109
  thead {
108
- tr, tr:first-child {
110
+ tr,
111
+ tr:first-child {
109
112
  border-top: none;
110
113
  }
111
114
  }
@@ -137,7 +140,7 @@ table.index#pages {
137
140
  text-decoration: none;
138
141
  }
139
142
  &:hover .title {
140
- color: #0066cc;
143
+ color: #EC0673;
141
144
  text-decoration: underline;
142
145
  }
143
146
  }
@@ -195,4 +198,4 @@ table.index#users {
195
198
  font-weight: normal;
196
199
  }
197
200
  }
198
- }
201
+ }