caboose-cms 0.9.166 → 0.9.167

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +1 -1
  3. data/app/assets/javascripts/caboose/model/index_table.js +3 -3
  4. data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +20 -1
  5. data/app/assets/stylesheets/caboose/admin_main.css.scss +142 -9
  6. data/app/assets/stylesheets/caboose/message_boxes.css.scss +45 -29
  7. data/app/assets/stylesheets/caboose/modal_inline.css +10 -2
  8. data/app/controllers/caboose/block_type_store_controller.rb +1 -2
  9. data/app/controllers/caboose/login_controller.rb +1 -1
  10. data/app/controllers/caboose/login_logs_controller.rb +9 -1
  11. data/app/controllers/caboose/page_templates_controller.rb +76 -0
  12. data/app/controllers/caboose/pages_controller.rb +76 -42
  13. data/app/controllers/caboose/sites_controller.rb +20 -11
  14. data/app/controllers/caboose/themes_controller.rb +108 -0
  15. data/app/models/caboose/block.rb +7 -3
  16. data/app/models/caboose/block_type.rb +2 -0
  17. data/app/models/caboose/core_plugin.rb +2 -0
  18. data/app/models/caboose/page.rb +1 -0
  19. data/app/models/caboose/page_template.rb +17 -0
  20. data/app/models/caboose/page_template_category.rb +20 -0
  21. data/app/models/caboose/schema.rb +80 -1
  22. data/app/models/caboose/site.rb +15 -2
  23. data/app/models/caboose/theme.rb +146 -0
  24. data/app/models/caboose/user.rb +14 -16
  25. data/app/views/caboose/block_type_sources/admin_edit.html.erb +1 -1
  26. data/app/views/caboose/block_type_sources/admin_index.html.erb +1 -1
  27. data/app/views/caboose/block_type_store/admin_details.html.erb +2 -2
  28. data/app/views/caboose/block_type_store/admin_index.html.erb +3 -3
  29. data/app/views/caboose/fonts/admin_index.html.erb +23 -0
  30. data/app/views/caboose/login_logs/admin_index.html.erb +6 -1
  31. data/app/views/caboose/login_logs/admin_index_for_user.html.erb +36 -0
  32. data/app/views/caboose/page_templates/admin_edit.html.erb +68 -0
  33. data/app/views/caboose/page_templates/admin_index.html.erb +24 -0
  34. data/app/views/caboose/page_templates/admin_new.html.erb +38 -0
  35. data/app/views/caboose/pages/admin_delete_form.html.erb +5 -4
  36. data/app/views/caboose/pages/admin_edit_content.html.erb +0 -9
  37. data/app/views/caboose/pages/admin_new.html.erb +139 -41
  38. data/app/views/caboose/pages/admin_new_old.html.erb +46 -0
  39. data/app/views/caboose/posts/admin_edit_content.html.erb +0 -8
  40. data/app/views/caboose/sites/admin_index.html.erb +2 -1
  41. data/app/views/caboose/themes/admin_edit.html.erb +242 -0
  42. data/app/views/caboose/users/_admin_header.html.erb +2 -2
  43. data/app/views/caboose/users/admin_delete_form.html.erb +0 -2
  44. data/app/views/caboose/users/admin_edit.html.erb +24 -7
  45. data/app/views/caboose/users/admin_edit_password.html.erb +1 -1
  46. data/app/views/caboose/users/admin_edit_roles.html.erb +2 -0
  47. data/app/views/layouts/caboose/application.html.erb +8 -0
  48. data/lib/caboose/version.rb +1 -1
  49. metadata +13 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6cf6c1cb40b04b827d57e33dc840b3f7190e87a
4
- data.tar.gz: a28036e64972406181fbf547186958768d257eab
3
+ metadata.gz: d0cdbb21670c498d32a302546db93e211868402b
4
+ data.tar.gz: 8f312dcd0e59b43826a38592adcc54cc260303c4
5
5
  SHA512:
6
- metadata.gz: 8b85e406522e401ede9b1ad4c437ea7d377eb2fc5399d57e23358dd7d22e6fd19fe876a9ddacd99bca9eae0ea34031bb0a85c444735a623d0f93376dbbba86aa
7
- data.tar.gz: 72dee3bc5c7c02274423cd8e60640b54719e3259c36140b01ecea04861e2d22b5dcf640d7412f36d64ac6c9eb86fc0cbcab6e9d8948bdfd48ba5d111f3973a44
6
+ metadata.gz: a876de2c71a21f0e6acdffdcd803876c9b5f81960b7f319a6369c147b3b381bf386c3b797ea8861959ebc6710d7197fc06ce6beea1c6f9f1b6d778cc0f7b50e5
7
+ data.tar.gz: 42e189883d2042118de765e58b04ef2f2c54c5cfc70ecc7442b5f05cd7520982b3ad8329cc2cde91adbbcfd0a12fd0904cd8aa0c52730c62144a5b7a295286e1
@@ -531,7 +531,7 @@ BlockContentController.prototype = {
531
531
  el.attr('onclick','').unbind('click');
532
532
  if ( el.hasClass('footer-wrapper') && el.prev('.content_wrapper.subpage').length > 0 ) {
533
533
  el.css('position','relative');
534
- var over = $('<div />').attr('id','footer-msg').text('The footer must be edited on the homepage.').css('position','absolute').css('left','0').css('top','0').css('background','rgba(43, 43, 43, 0.9)').css('color','white').css('width','100%').css('height','100%').css('z-index','14').css('padding','40px 3% 40px 3%').css('text-align','center');
534
+ var over = $('<div />').attr('id','footer-msg').text('The footer must be edited on the homepage.');
535
535
  if ( el.find('#footer-msg').length == 0 ) { el.append(over); }
536
536
  }
537
537
  else if ( !el.hasClass('container') ) {
@@ -637,7 +637,7 @@ IndexTable.prototype = {
637
637
  that.show_message(div, 'bulk_import_form');
638
638
  return;
639
639
  }
640
- that.show_message("<p class='loading'>Adding...</p>", 'bulk_import_loading');
640
+ that.show_message("<p class='note loading'>Adding...</p>", 'bulk_import_loading');
641
641
  $.ajax({
642
642
  url: this.bulk_import_url,
643
643
  type: 'post',
@@ -691,7 +691,7 @@ IndexTable.prototype = {
691
691
  that.show_message(div, 'bulk_import_form');
692
692
  return;
693
693
  }
694
- that.show_message("<p class='loading'>Adding...</p>", 'bulk_import_loading');
694
+ that.show_message("<p class='note loading'>Adding...</p>", 'bulk_import_loading');
695
695
 
696
696
  var formData = new FormData();
697
697
  formData.append('file', file);
@@ -1073,7 +1073,7 @@ IndexTable.prototype = {
1073
1073
  add_model: function()
1074
1074
  {
1075
1075
  var that = this;
1076
- $('#' + that.container + '_new_message').html("<p class='loading'>Adding...</p>");
1076
+ $('#' + that.container + '_new_message').html("<p class='note loading'>Adding...</p>");
1077
1077
  $.ajax({
1078
1078
  url: this.add_url,
1079
1079
  type: 'post',
@@ -1,5 +1,21 @@
1
1
  @import url('https://fonts.googleapis.com/css?family=Roboto:300,300i');
2
2
 
3
+ body.editing .footer-wrapper #footer-msg {
4
+ position: absolute;
5
+ left: 0px;
6
+ top: 0px;
7
+ background: rgba(43, 43, 43, 0.9);
8
+ color: rgb(255, 255, 255);
9
+ width: 100%;
10
+ height: 100%;
11
+ z-index: 14;
12
+ padding: 40px 3%;
13
+ text-align: center;
14
+ font-size: 15px;
15
+ font-family: Roboto;
16
+ font-weight: 300;
17
+ }
18
+
3
19
  #cb_block_sidebar {
4
20
  position: fixed;
5
21
  top: 0;
@@ -19,7 +35,7 @@
19
35
  padding: 10px;
20
36
  text-align: center;
21
37
  height: 52px;
22
- margin-bottom: 10px;
38
+ margin-bottom: 20px;
23
39
  color: #252525;
24
40
  }
25
41
  }
@@ -36,6 +52,8 @@
36
52
  text-transform: uppercase;
37
53
  color: #252525;
38
54
  line-height: 16px;
55
+ font-family: "Roboto";
56
+ font-weight: 300;
39
57
  }
40
58
  }
41
59
  li.blocktype {
@@ -149,6 +167,7 @@ body > .ui-draggable-dragging {
149
167
  border: 1px solid #d4d4d4;
150
168
  margin-bottom: 0;
151
169
  border-radius: 8px;
170
+ font-family: 'Roboto'; font-weight: 300;
152
171
  }
153
172
 
154
173
  p.caboose_note.delete {
@@ -207,15 +207,15 @@ p.current_page_editing {
207
207
  padding: 10px 10px 10px 30px;
208
208
  }
209
209
 
210
- #content p.loading {
211
- background-image: url('/assets/caboose/loading_black_on_white.gif');
212
- background-position: 0 center;
213
- background-repeat: no-repeat;
214
- color: #000;
215
- font-weight: normal;
216
- font-size: 16pt;
217
- padding: 10px 10px 10px 40px;
218
- }
210
+ // #content p.loading {
211
+ // background-image: url('/assets/caboose/loading_black_on_white.gif');
212
+ // background-position: 0 center;
213
+ // background-repeat: no-repeat;
214
+ // color: #000;
215
+ // font-weight: normal;
216
+ // font-size: 16pt;
217
+ // padding: 10px 10px 10px 40px;
218
+ // }
219
219
 
220
220
  #content div.yesnobox {
221
221
  position: absolute;
@@ -531,6 +531,139 @@ Page Bar Generator
531
531
  #search_form input[type='submit'] { height: 35px; padding: 0 12px; }
532
532
 
533
533
 
534
+ .new-page-form-wrapper {
535
+ max-width: 950px;
536
+ margin: 0 auto;
537
+ padding: 0 50px 0 20px;
538
+ section {
539
+ padding: 20px 10px 20px 20px;
540
+ border: 1px solid #d6d6d6;
541
+ margin-bottom: 30px;
542
+ h4 {
543
+ margin: 0 0 10px 0;
544
+ font-size: 17px;
545
+ }
546
+ .field {
547
+ margin-bottom: 15px;
548
+ &:last-of-type { margin-bottom: 0; }
549
+ label {
550
+ display: block;
551
+ font-size: 15px;
552
+ margin-bottom: 2px;
553
+ }
554
+ input, select {
555
+ display: block;
556
+ width: 100%;
557
+ margin: 0;
558
+ }
559
+ p.meta {
560
+ font-size: 13px;
561
+ margin: 3px 0 0 0;
562
+ }
563
+ }
564
+ &.buttons {
565
+ .caboose-btn {
566
+ float: right;
567
+ }
568
+ }
569
+ }
570
+ #page-message {
571
+ margin: 30px 0;
572
+ .note {
573
+ text-align: center;
574
+ }
575
+ }
576
+ }
577
+
578
+ .page-templates-wrapper {
579
+ max-width: 912px;
580
+ margin: 0 auto;
581
+ padding: 0 20px;
582
+ .category {
583
+ border-top: 1px solid #d6d6d6;
584
+ padding-top: 20px;
585
+ margin-top: 10px;
586
+ &:first-of-type {
587
+ border-top: 0;
588
+ }
589
+ h3 {
590
+ margin: 0 auto 5px 0;
591
+ font-size: 18px;
592
+ padding-left: 2px;
593
+ }
594
+ p.description {
595
+ font-size: 14px;
596
+ margin: 0 0 20px 0;
597
+ padding-left: 2px;
598
+ }
599
+ .cat-templates {
600
+ display: -webkit-box;
601
+ display: -moz-box;
602
+ display: -ms-flexbox;
603
+ display: -webkit-flex;
604
+ display: flex;
605
+ flex-wrap: wrap;
606
+ .template {
607
+ display: block;
608
+ text-decoration: none;
609
+ -webkit-box-flex: 0 0 23%;
610
+ -moz-box-flex: 0 0 23%;
611
+ -webkit-flex: 0 0 23%;
612
+ -ms-flex: 0 0 23%;
613
+ flex: 0 0 23%;
614
+ text-align: center;
615
+ margin: 0 2% 20px 0;
616
+ color: #2d2d2d;
617
+ position: relative;
618
+ img {
619
+ display: block;
620
+ width: 100%;
621
+ height: auto;
622
+ }
623
+ .text {
624
+ background: #2d2d2d;
625
+ color: #fff;
626
+ padding: 8px;
627
+ .title {
628
+ font-size: 15px;
629
+ margin-bottom: 0;
630
+ display: block;
631
+ }
632
+ .desc {
633
+ font-size: 13px;
634
+ display: block;
635
+ margin-top: 3px;
636
+ }
637
+ }
638
+ &:hover {
639
+ img {
640
+ opacity: 0.6;
641
+ }
642
+ }
643
+ &.selected {
644
+ &::after {
645
+ content: " ";
646
+ background-image: url('https://cabooseit.s3.amazonaws.com/assets/shared/check.png');
647
+ background-size: 24px;
648
+ width: 24px;
649
+ height: 24px;
650
+ background-position: center center;
651
+ background-repeat: no-repeat;
652
+ position: absolute;
653
+ right: -4px;
654
+ top: -4px;
655
+ }
656
+ }
657
+ }
658
+ }
659
+ .btn-holder {
660
+ text-align: right;
661
+ padding-right: 10px;
662
+ }
663
+ }
664
+ }
665
+
666
+
534
667
  /******************************************************************************/
535
668
 
536
669
  #htabs_container {
@@ -3,26 +3,42 @@
3
3
  Message boxes
4
4
  *******************************************************************************/
5
5
 
6
- .loading {
7
- background-image: url('/assets/caboose/loading_black_on_white.gif');
8
- background-position: 0 center;
9
- background-repeat: no-repeat;
10
- color: #000;
11
- font-weight: normal;
12
- font-size: 16pt;
13
- padding: 10px 10px 10px 40px;
14
- }
6
+ // .loading {
7
+ // background-image: url('/assets/caboose/loading_black_on_white.gif');
8
+ // background-position: 0 center;
9
+ // background-repeat: no-repeat;
10
+ // color: #000;
11
+ // font-weight: normal;
12
+ // font-size: 16pt;
13
+ // padding: 10px 10px 10px 40px;
14
+ // }
15
15
 
16
16
  .note {
17
- padding: 20px;
18
- margin-bottom: 10px;
19
- background: #fef49c;
20
- color: #000000;
21
- font-weight: bold;
22
- font-size: 1.4em;
23
- border-radius: 3px;
24
-
25
- h2 { margin: 0 0 10px 0; padding: 0; }
17
+ padding: 15px;
18
+ background: #fff3ac;
19
+ //color: #fff;
20
+ font-size: 15px;
21
+ //text-align: center;
22
+ h2 { margin: 0 0 10px 0; padding: 0; }
23
+ a {
24
+ color: #fff;
25
+ &:hover {
26
+ color: #000;
27
+ }
28
+ }
29
+ &.error {
30
+ background: #bf4448;
31
+ }
32
+ &.success {
33
+ background: #26ae88;
34
+ }
35
+ &.loading {
36
+ background-image: url('https://cabooseit.s3.amazonaws.com/assets/shared/loading_blue.gif');
37
+ background-size: 40px;
38
+ background-position: 0 center;
39
+ background-repeat: no-repeat;
40
+ padding-left: 40px;
41
+ }
26
42
  }
27
43
 
28
44
  .note_small {
@@ -34,16 +50,16 @@ Message boxes
34
50
  border-radius: 3px;
35
51
  }
36
52
 
37
- .error {
38
- background: #9c171b;
39
- color: #ffffff;
40
- a { color: #fff; }
41
- a:hover { color: #000; }
42
- }
53
+ // .error {
54
+ // background: #bf4448;
55
+ // color: #ffffff;
56
+ // a { color: #fff; }
57
+ // a:hover { color: #000; }
58
+ // }
43
59
 
44
- .success {
45
- background: #009900;
46
- color: #ffffff;
47
- a { color: #ffffff; }
48
- }
60
+ // .success {
61
+ // background: #26ae88;
62
+ // color: #ffffff;
63
+ // a { color: #ffffff; }
64
+ // }
49
65
 
@@ -8,8 +8,16 @@
8
8
  #the_modal div.icons a:hover span.icon { color: #000 !important; }
9
9
  #the_modal div.icons a:hover span.name { color: #000 !important; }
10
10
 
11
- #the_modal { box-sizing: border-box; color: #252525; }
12
- #the_modal p { margin-bottom: 10px; }
11
+ #the_modal { box-sizing: border-box; color: #252525; font-family: 'Roboto'; font-weight: 300; }
12
+ #the_modal p { margin-bottom: 10px; font-family: 'Roboto'; font-weight: 300; }
13
+ #the_modal h1,
14
+ #the_modal h2,
15
+ #the_modal h3,
16
+ #the_modal h4,
17
+ #the_modal h5,
18
+ #the_modal h6 {
19
+ font-family: 'Roboto'; font-weight: 300;
20
+ }
13
21
  #the_modal .mb_container input { border: #ccc 1px solid; }
14
22
  #the_modal div.mb_container div.mb_placeholder { top: 9px; }
15
23
  #the_modal div.mb_container div.mb_placeholder span { font-size: 16px; }
@@ -1,8 +1,7 @@
1
-
2
1
  module Caboose
3
2
  class BlockTypeStoreController < ApplicationController
4
3
 
5
- # @route GET /admin/block-types/store
4
+ # @route GET /admin/block-type-store
6
5
  def admin_index
7
6
  return unless user_is_allowed('blocktypestore', 'add')
8
7
  @pager = PageBarGenerator.new(params, {
@@ -85,7 +85,7 @@ module Caboose
85
85
 
86
86
  LoginMailer.configure_for_site(@site.id).forgot_password_email(bob).deliver
87
87
 
88
- resp.success = "We just sent you an email. The reset link inside is good for 3 days."
88
+ resp.success = "We just sent you an email. The reset link inside is good for 3 days."
89
89
  render :json => resp
90
90
  end
91
91
 
@@ -6,11 +6,19 @@ module Caboose
6
6
  def before_action
7
7
  @page = Page.page_with_uri(request.host_with_port, '/admin')
8
8
  end
9
+
10
+ # @route GET /admin/login-logs/user/:userid
11
+ def admin_index_for_user
12
+ return if !user_is_allowed_to 'view', 'loginlogs'
13
+ @pager = self.login_logs_pager
14
+ @edituser = Caboose::User.find(params[:userid]) if !params[:userid].blank?
15
+ render :layout => 'caboose/admin'
16
+ end
9
17
 
10
18
  # @route GET /admin/login-logs
11
19
  def admin_index
12
20
  return if !user_is_allowed_to 'view', 'loginlogs'
13
- @pager = self.login_logs_pager
21
+ @pager = self.login_logs_pager
14
22
  render :layout => 'caboose/admin'
15
23
  end
16
24
 
@@ -0,0 +1,76 @@
1
+ module Caboose
2
+ class PageTemplatesController < ApplicationController
3
+ layout 'caboose/admin'
4
+
5
+ # @route GET /admin/templates
6
+ def admin_index
7
+ return if !user_is_allowed('templates', 'view') || !@site.is_master
8
+ @categories = PageTemplateCategory.order(:sort_order).all
9
+ end
10
+
11
+ # @route GET /admin/templates/new
12
+ def admin_new
13
+ return if !user_is_allowed('templates', 'add') || !@site.is_master
14
+ end
15
+
16
+ # @route POST /admin/templates
17
+ def admin_create
18
+ return unless user_is_allowed('templates', 'add')
19
+ resp = Caboose::StdClass.new({'error' => nil,'redirect' => nil})
20
+ @template = PageTemplate.new
21
+ @template.title = params[:title]
22
+ @template.category_id = params[:category_id]
23
+ @template.save
24
+ resp.redirect = "/admin/templates/#{@template.id}"
25
+ render :json => resp
26
+ end
27
+
28
+ # @route PUT /admin/templates/:id
29
+ def admin_update
30
+ return unless ((user_is_allowed_to 'edit', 'templates') && @site.is_master)
31
+ resp = Caboose::StdClass.new
32
+ templates = params[:id] == 'bulk' ? params[:model_ids].collect{ |rid| PageTemplate.find(rid) } : [PageTemplate.find(params[:id])]
33
+ params.each do |k,v|
34
+ case k
35
+ when "title" then templates.each { |r| r.title = v }
36
+ when "page_id" then templates.each { |r| r.page_id = v }
37
+ when "description" then templates.each { |r| r.description = v }
38
+ when "category_id" then templates.each { |r| r.category_id = v }
39
+ when "sort_order" then templates.each { |r| r.sort_order = v }
40
+ end
41
+ end
42
+ templates.each do |r|
43
+ r.save
44
+ end
45
+ resp.success = true
46
+ render :json => resp
47
+ end
48
+
49
+ # @route POST /admin/templates/:id/screenshot
50
+ def admin_update_screenshot
51
+ render :json => false and return unless user_is_allowed_to 'edit', 'templates'
52
+ resp = Caboose::StdClass.new({ 'attributes' => {} })
53
+ template = PageTemplate.find(params[:id])
54
+ template.screenshot = params[:screenshot]
55
+ template.save
56
+ resp.attributes['image'] = { 'value' => template.screenshot.url(:small) }
57
+ render :text => resp.to_json
58
+ end
59
+
60
+ # @route GET /admin/templates/:id
61
+ def admin_edit
62
+ return if !user_is_allowed('templates', 'edit') || !@site.is_master
63
+ @template = PageTemplate.find(params[:id])
64
+ end
65
+
66
+ # @route DELETE /admin/templates/:id
67
+ def admin_delete
68
+ return if !user_is_allowed('templates', 'delete') || !@site.is_master
69
+ prop = PageTemplate.find(params[:id])
70
+ resp = Caboose::StdClass.new('redirect' => "/admin/templates")
71
+ prop.destroy
72
+ render :json => resp
73
+ end
74
+
75
+ end
76
+ end