caboose-cms 0.9.128 → 0.9.129

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00714c7e4b29382dbf0175688b0f91c777c491e1
4
- data.tar.gz: 267ef264798e8bda7e1aa017728a3fa06234df9b
3
+ metadata.gz: 396cb910ba3f3f038bbcc3cb47dfe3c04dd2914b
4
+ data.tar.gz: 71b16c4d9eb8a34970c6e626cb7fc1a5f4e14e72
5
5
  SHA512:
6
- metadata.gz: 36c366a8f32bfb3ea7833ade86e18a374941a330c58cfaf5e40e49957067f611bd90c3b65f30dd1012c1222773d5641c74b751f0d61c6c472faf11fbc5d112f9
7
- data.tar.gz: d7366bfb7fe70e36f3e954d3625283ab3e88d7360910a41f6dabf44247f3ab22a1504a799da8af7ed24d66b13734dafb4909e4905acf56f715fb3413609848e7
6
+ metadata.gz: c8d44f1617dcb9730dce70458ccca60bc613d072f545e74f68b02fa08a3d4d96c17b1a2748e1db3828b0febf6f8ef5160100f7e60f551b7ecee6df7db73b6861
7
+ data.tar.gz: 41ef098f6215bc06f857d45da7235d86f50e25d87fe14d804570d59be7cf370067a86e559440db5b7dc52c83b907c249a620b84d7d0f934131dda96820315a50
@@ -669,6 +669,84 @@ Page Bar Generator
669
669
  text-decoration: none !important;
670
670
  }
671
671
 
672
+ .inbox-table {
673
+ width: 100%;
674
+ max-width: 1200px;
675
+ padding: 10px 0 20px 0;
676
+ margin: 0 auto;
677
+ border: 1px solid gainsboro;
678
+ tr {
679
+ cursor: pointer;
680
+ &:hover {
681
+ background: #ffffc4;
682
+ }
683
+ th, td {
684
+ padding: 10px;
685
+ vertical-align: middle;
686
+ font-size: 15px;
687
+ text-align: left;
688
+ border-bottom: 1px solid #ececec;
689
+ }
690
+ &:first-of-type:hover {
691
+ cursor: default;
692
+ background: transparent;
693
+ }
694
+ }
695
+ }
696
+
697
+ .inbox-btns {
698
+ max-width: 1200px;
699
+ margin: 0 auto;
700
+ padding: 0 30px 10px 0;
701
+ margin-bottom: 10px;
702
+ }
703
+
704
+ .inbox-message {
705
+ width: 600px;
706
+ margin: 0 auto;
707
+ padding: 20px;
708
+ border: 1px solid #d6d6d6;
709
+ border-radius: 5px;
710
+ overflow: hidden;
711
+ p.spam {
712
+ background: #b33b3b;
713
+ color: #fff;
714
+ display: inline-block;
715
+ font-size: 14px;
716
+ padding: 5px 10px;
717
+ margin: 0 0 15px 10px;
718
+ }
719
+ table {
720
+ width: 100%;
721
+ margin-bottom: 30px;
722
+ tr {
723
+ th, td {
724
+ padding: 10px;
725
+ vertical-align: middle;
726
+ font-size: 15px;
727
+ text-align: left;
728
+ border-bottom: 1px solid #ececec;
729
+ a {
730
+ text-decoration: none;
731
+ color: #5d5dd0;
732
+ &:hover {
733
+ color: #5dd062;
734
+ }
735
+ }
736
+ }
737
+ }
738
+ }
739
+ .buttons {
740
+ padding-left: 10px;
741
+ .caboose-btn {
742
+ margin-right: 10px;
743
+ }
744
+ .caboose-btn-white {
745
+ margin-top: 15px;
746
+ }
747
+ }
748
+ }
749
+
672
750
  .caboose-btn:focus {
673
751
  outline-width: 0;
674
752
  }
@@ -0,0 +1,52 @@
1
+ module Caboose
2
+ class InboxController < ApplicationController
3
+ layout 'caboose/admin'
4
+
5
+ # @route GET /admin/inbox
6
+ def admin_index
7
+ has_inbox = "Contact".constantize rescue false
8
+ if has_inbox
9
+ @contacts = Contact.where(:site_id => @site.id, :captcha_valid => true, :deleted => false).order('date_submitted desc').all
10
+ end
11
+ end
12
+
13
+ # @route GET /admin/inbox/spam
14
+ def admin_spam
15
+ has_inbox = "Contact".constantize rescue false
16
+ if has_inbox
17
+ @contacts = Contact.where(:site_id => @site.id, :captcha_valid => false, :deleted => false).order('date_submitted desc').all
18
+ end
19
+ end
20
+
21
+ # @route GET /admin/inbox/:id
22
+ def admin_show
23
+ has_inbox = "Contact".constantize rescue false
24
+ if has_inbox
25
+ @contact = Contact.where(:site_id => @site.id, :id => params[:id], :deleted => false).first
26
+ end
27
+ end
28
+
29
+ # @route GET /admin/inbox/:id/delete
30
+ def admin_delete
31
+ has_inbox = "Contact".constantize rescue false
32
+ if has_inbox
33
+ @contact = Contact.where(:site_id => @site.id, :id => params[:id]).first
34
+ @contact.deleted = true
35
+ @contact.save
36
+ redirect_to '/admin/inbox'
37
+ end
38
+ end
39
+
40
+ # @route GET /admin/inbox/:id/spam
41
+ def admin_update
42
+ has_inbox = "Contact".constantize rescue false
43
+ if has_inbox
44
+ @contact = Contact.where(:site_id => @site.id, :id => params[:id]).first
45
+ @contact.captcha_valid = !@contact.captcha_valid
46
+ @contact.save
47
+ redirect_to '/admin/inbox/' + params[:id]
48
+ end
49
+ end
50
+
51
+ end
52
+ end
@@ -5,12 +5,13 @@ class Caboose::CorePlugin < Caboose::CaboosePlugin
5
5
 
6
6
  # nav << { 'id' => 'logout' , 'text' => 'Logout' , 'href' => '/logout' , 'modal' => false }
7
7
  # nav << { 'id' => 'my-account' , 'text' => 'My Account' , 'href' => '/my-account' , 'modal' => true }
8
-
8
+ has_inbox = "Contact".constantize rescue false
9
9
  item = { 'id' => 'content', 'text' => 'Content', 'children' => [] }
10
10
  item['children'] << { 'id' => 'media' , 'text' => 'Media' , 'href' => '/admin/media' , 'modal' => false } if user.is_allowed('media' , 'view')
11
11
  item['children'] << { 'id' => 'pages' , 'text' => 'Pages' , 'href' => '/admin/pages' , 'modal' => false } if user.is_allowed('pages' , 'view')
12
12
  item['children'] << { 'id' => 'posts' , 'text' => 'Posts' , 'href' => '/admin/posts' , 'modal' => false } if user.is_allowed('posts' , 'view')
13
- item['children'] << { 'id' => 'calendars' , 'text' => 'Calendars' , 'href' => '/admin/calendars' , 'modal' => false } if user.is_allowed('calendars' , 'view')
13
+ item['children'] << { 'id' => 'calendars' , 'text' => 'Calendars' , 'href' => '/admin/calendars' , 'modal' => false } if user.is_allowed('calendars' , 'view')
14
+ item['children'] << { 'icon' => 'box', 'id' => 'inbox' , 'text' => 'Inbox' , 'href' => '/admin/inbox' , 'modal' => false } if user.is_allowed('contacts' , 'view') && has_inbox && Contact.where(:site_id => site.id).count > 0
14
15
  nav << item if item['children'].count > 0
15
16
 
16
17
  item = { 'id' => 'core', 'text' => 'Settings', 'children' => [] }
@@ -26,7 +27,7 @@ class Caboose::CorePlugin < Caboose::CaboosePlugin
26
27
  item['children'] << { 'id' => 'sites' , 'text' => 'Sites' , 'href' => '/admin/sites' , 'modal' => false } if user.is_allowed('sites' , 'view') && site.is_master == true
27
28
  item['children'] << { 'id' => 'smtp' , 'text' => 'SMTP (Mail)' , 'href' => '/admin/smtp' , 'modal' => false } if user.is_allowed('smtp' , 'view')
28
29
  item['children'] << { 'id' => 'social' , 'text' => 'Social Media' , 'href' => '/admin/social' , 'modal' => false } if user.is_allowed('social' , 'view')
29
- item['children'] << { 'id' => 'users' , 'text' => 'Users' , 'href' => '/admin/users' , 'modal' => false } if user.is_allowed('users' , 'view')
30
+ item['children'] << { 'id' => 'users' , 'text' => 'Users' , 'href' => '/admin/users' , 'modal' => false } if user.is_allowed('users' , 'view')
30
31
  # item['children'] << { 'id' => 'variables' , 'text' => 'Variables' , 'href' => '/admin/settings' , 'modal' => false } if user.is_allowed('settings' , 'view')
31
32
  item['children'] << { 'id' => 'my-account' , 'text' => 'My Account' , 'href' => '/my-account' , 'modal' => false }
32
33
  nav << item if item['children'].count > 0
@@ -0,0 +1,31 @@
1
+ <h1>Inbox</h1>
2
+
3
+ <div class="constrain clearfix" style="padding:0 40px 0 10px;">
4
+ <div class="inbox-btns constrain">
5
+ <a href="/admin/inbox/spam" class="caboose-btn">View Spam</a>
6
+ </div>
7
+ <table class="inbox-table" cellpadding="0" cellspacing="0">
8
+ <tr>
9
+ <th>From</th>
10
+ <th>Subject</th>
11
+ <th>Message</th>
12
+ <th>Date</th>
13
+ </tr>
14
+ <% @contacts.each do |c| %>
15
+ <tr data-id="<%= c.id %>">
16
+ <td><%= c.name %></td>
17
+ <td><%= c.subject %></td>
18
+ <td><%= c.message ? c.message.truncate(60) : '' %></td>
19
+ <td><%= c.date_submitted.strftime('%-m/%-d/%Y') %></td>
20
+ </tr>
21
+ <% end %>
22
+ </table>
23
+ </div>
24
+
25
+ <% content_for :caboose_js do %>
26
+ <script>
27
+ $(".inbox-table tr").click(function() {
28
+ window.location = "/admin/inbox/" + $(this).data("id");
29
+ });
30
+ </script>
31
+ <% end %>
@@ -0,0 +1,46 @@
1
+ <h1>Inbox - Message</h1>
2
+
3
+ <div class="constrain">
4
+ <div class="inbox-message">
5
+ <% if !@contact.captcha_valid %>
6
+ <p class="spam">SPAM</p>
7
+ <% end %>
8
+ <table cellspacing="0" cellpadding="0">
9
+ <tr>
10
+ <td>Name</td>
11
+ <td><%= @contact.name %></td>
12
+ </tr>
13
+ <tr>
14
+ <td>Email</td>
15
+ <td><a href="mailto:<%= @contact.email %>?subject=Re: <%= @contact.subject %>"><%= @contact.email %></a></td>
16
+ </tr>
17
+ <tr>
18
+ <td>Sent To</td>
19
+ <td><a href="mailto:<%= @contact.sent_to %>?subject=Re: <%= @contact.subject %>"><%= @contact.sent_to %></a></td>
20
+ </tr>
21
+ <tr>
22
+ <td>Date Submitted</td>
23
+ <td><%= @contact.date_submitted.strftime('%-m/%-d/%Y') %></td>
24
+ </tr>
25
+ <tr>
26
+ <td>Subject</td>
27
+ <td><%= @contact.subject %></td>
28
+ </tr>
29
+ <tr>
30
+ <td>Message</td>
31
+ <td><%= @contact.message %></td>
32
+ </tr>
33
+ </table>
34
+ <div class="buttons">
35
+ <a href="mailto:<%= @contact.email %>?subject=Re: <%= @contact.subject %>" class="caboose-btn">Reply</a>
36
+ <a href="/admin/inbox/<%= @contact.id %>/delete" class="caboose-btn">Delete</a>
37
+ <% if @contact.captcha_valid %>
38
+ <a href="/admin/inbox/<%= @contact.id %>/spam" class="caboose-btn">Mark as Spam</a>
39
+ <% else %>
40
+ <a href="/admin/inbox/<%= @contact.id %>/spam" class="caboose-btn">Mark as Not Spam</a>
41
+ <% end %>
42
+ <br />
43
+ <a class="caboose-btn-white" href="/admin/inbox">Back to Inbox</a>
44
+ </div>
45
+ </div>
46
+ </div>
@@ -0,0 +1,31 @@
1
+ <h1>Inbox - Spam</h1>
2
+
3
+ <div class="constrain clearfix" style="padding:0 40px 0 10px;">
4
+ <div class="inbox-btns constrain">
5
+ <a href="/admin/inbox" class="caboose-btn">View Inbox</a>
6
+ </div>
7
+ <table class="inbox-table" cellpadding="0" cellspacing="0">
8
+ <tr>
9
+ <th>From</th>
10
+ <th>Subject</th>
11
+ <th>Message</th>
12
+ <th>Date</th>
13
+ </tr>
14
+ <% @contacts.each do |c| %>
15
+ <tr data-id="<%= c.id %>">
16
+ <td><%= c.name %></td>
17
+ <td><%= c.subject %></td>
18
+ <td><%= c.message ? c.message.truncate(60) : '' %></td>
19
+ <td><%= c.date_submitted.strftime('%-m/%-d/%Y') %></td>
20
+ </tr>
21
+ <% end %>
22
+ </table>
23
+ </div>
24
+
25
+ <% content_for :caboose_js do %>
26
+ <script>
27
+ $(".inbox-table tr").click(function() {
28
+ window.location = "/admin/inbox/" + $(this).data("id");
29
+ });
30
+ </script>
31
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.128'
2
+ VERSION = '0.9.129'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.128
4
+ version: 0.9.129
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
@@ -627,7 +627,7 @@ files:
627
627
  - app/assets/stylesheets/caboose/admin_crumbtrail.css.scss
628
628
  - app/assets/stylesheets/caboose/admin_edit_page_content.scss
629
629
  - app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss
630
- - app/assets/stylesheets/caboose/admin_main.css
630
+ - app/assets/stylesheets/caboose/admin_main.css.scss
631
631
  - app/assets/stylesheets/caboose/admin_media_index.css.scss
632
632
  - app/assets/stylesheets/caboose/admin_menu_icons.css
633
633
  - app/assets/stylesheets/caboose/admin_new_block.css
@@ -699,6 +699,7 @@ files:
699
699
  - app/controllers/caboose/fonts_controller.rb
700
700
  - app/controllers/caboose/gift_cards_controller.rb
701
701
  - app/controllers/caboose/google_spreadsheets_controller.rb
702
+ - app/controllers/caboose/inbox_controller.rb
702
703
  - app/controllers/caboose/invoice_packages_controller.rb
703
704
  - app/controllers/caboose/invoice_reports_controller.rb
704
705
  - app/controllers/caboose/invoice_transactions_controller.rb
@@ -1005,6 +1006,9 @@ files:
1005
1006
  - app/views/caboose/fonts/admin_index.html.erb
1006
1007
  - app/views/caboose/gift_cards/admin_edit.html.erb
1007
1008
  - app/views/caboose/gift_cards/admin_index.html.erb
1009
+ - app/views/caboose/inbox/admin_index.html.erb
1010
+ - app/views/caboose/inbox/admin_show.html.erb
1011
+ - app/views/caboose/inbox/admin_spam.html.erb
1008
1012
  - app/views/caboose/invoices/_admin_footer.html.erb
1009
1013
  - app/views/caboose/invoices/_admin_header.html.erb
1010
1014
  - app/views/caboose/invoices/_quickbooks_invoice.html.erb