caboose-cms 0.9.126 → 0.9.127

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: f9bf5887a3f73dd1aed90d4ea955ac899efda074
4
- data.tar.gz: 55b69803d9d987c89ae323bb88ac3d43e3095835
3
+ metadata.gz: 0c52ed0bef3b6735142b18ed9ce8d5f0bf0bd785
4
+ data.tar.gz: 070ff920e3b9e0b19746b122c3f0092eca0c093b
5
5
  SHA512:
6
- metadata.gz: afd78ad9a54002508fd0da16c048105350f0e9fbabec71c6548881ef7900da34bbed291d31d736be122fb4587157f00a62db84ffbdc74018573d078add98f7d7
7
- data.tar.gz: 0bd464afa9619ed553b80919784cf36472f148d5e7679df82f7c4b8ce0f272f7dfb851ed6ebeb0ffebe60f9b2217d498c4151f442e6adb99826d0de99817c183
6
+ metadata.gz: 25a26685d4f12e08baf7860ca5c40b26f106255ecc89adbed78498db086ed519173a4805f20a0d54c91f203c09e42f91d2706c0562a32beaa6c1b82c2e0a8d7a
7
+ data.tar.gz: b3317776db0ada91193934531c4ceba05da282478ac13e0dd62233662876c0cc1624b8b9de0e2c53e2e02e4f33ce61b9cdf40327d0d97acbcfa9c387a5a472d0
@@ -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.126'
2
+ VERSION = '0.9.127'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.126
4
+ version: 0.9.127
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -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