caboose-cms 0.9.100 → 0.9.101

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: 1679adede6e539a9e7e39e9c3c339a6eb536a25c
4
- data.tar.gz: 75b38ec8f5e7ae4f8453b0c4e76f3f266c17c36a
3
+ metadata.gz: 23ad7f7c31b8ca09193936375beee638295eb7ee
4
+ data.tar.gz: 78ff33fabda4ec92797cb7b87ed1d8b5747e21ac
5
5
  SHA512:
6
- metadata.gz: d7de69fa6d419f72f8d2611efc426f530eee6dd6817fe74b5ef5e420f1661448689426ddce4f4864524fa75f3e9aeded294a2b893a30d3dc3cdc7e9fd95d8929
7
- data.tar.gz: b22afc388a84540611f3c4cf5a9ddde26babb33d51ebb7231c329fa89ea95432128f89039926f09c05b5105d68b3a0d9de720031dd43d48dd4583ced6be29a49
6
+ metadata.gz: a31de878a90a6839514b8151c89410ed86d0cc806576a2f2a70f9a06ec825c03a82732a00e08e3268dd367e1acb981c19075ac17017404fd49c2012544d55e23
7
+ data.tar.gz: fc2a0f77cc0d3c5759a8f899ad4d808e20420c33bdf40ef94497cdd17fca5fb4e77fc2a9588956f5ebfd8efe7970dc7ccb584a841a8b1e7cb1bb168378fa023a
@@ -337,14 +337,20 @@ select.fake option {
337
337
  width: 20px;
338
338
  }
339
339
 
340
+ #new_form p input[type="text"] {
341
+ padding: 2px 4px 0 8px;
342
+ }
343
+
340
344
  #content .note .label_with_checkbox input[type="checkbox"] {
341
345
  position: relative;
342
- top: 4px;
346
+ top: 5px;
343
347
  margin-right: 5px;
344
348
  height: 20px;
345
349
  }
346
350
  .note .label_with_checkbox label {
347
- font-size: 15px;
351
+ font-weight: 400;
352
+ font-size: 14px;
353
+ cursor: pointer;
348
354
  }
349
355
 
350
356
  #content .search_form {
@@ -543,11 +549,12 @@ Page Bar Generator
543
549
  #tabs a {
544
550
  display: block;
545
551
  margin: 0;
546
- padding: 16px 12px 12px 12px;
552
+ padding: 13px 12px 12px 12px;
547
553
  text-decoration: none;
548
554
  background: #efefef;
549
555
  border-bottom: #ccc 1px solid;
550
556
  color: #000;
557
+ font-size: 15px;
551
558
  }
552
559
  #tabs a:hover {
553
560
  background: #666;
@@ -11,7 +11,6 @@
11
11
  *= require colorbox-rails
12
12
  *= require caboose/fonts
13
13
  *= require caboose/page_bar_generator
14
- *= require caboose/caboose
15
14
  *= require caboose/model_binder
16
15
  */
17
16
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  body {
3
- font-family: Helvetica, Tahoma, Arial;
3
+ font-family: 'Roboto', Tahoma, Arial;
4
4
  }
5
5
 
6
6
  input[type='text'].placeholder_js {
@@ -1,6 +1,6 @@
1
1
  /*
2
- *= require caboose/spectrum
3
- */
2
+ require caboose/spectrum
3
+ */
4
4
 
5
5
  .mb_container {
6
6
  width: 100%;
@@ -1,6 +1,6 @@
1
- @import url('https://fonts.googleapis.com/css?family=Open+Sans');
1
+ @import url('https://fonts.googleapis.com/css?family=Roboto:400');
2
2
 
3
- $font-card: normal 1em "Open Sans", sans-serif;
3
+ $font-card: 400 15px "Roboto", sans-serif;
4
4
  $color-main: #5f5f5f;
5
5
  $color-light: #ececec;
6
6
 
@@ -91,13 +91,6 @@ $color-light: #ececec;
91
91
  text-decoration: none;
92
92
  }
93
93
  }
94
- .mb_placeholder {
95
- top: 7px;
96
- left: 7px;
97
- span {
98
- font-size: 16px;
99
- }
100
- }
101
94
  }
102
95
  }
103
96
  .buttons {
@@ -160,11 +153,12 @@ $color-light: #ececec;
160
153
  display: block;
161
154
  width: 100% !important;
162
155
  font: $font-card;
163
- line-height: 1em;
164
- padding: 6px 6px 6px 6px;
156
+ line-height: 20px;
157
+ padding: 7px 6px 6px 6px;
165
158
  border: 1px solid #dadada;
166
159
  border-radius: 3px;
167
160
  color: #2d2d2d;
161
+ height: 36px;
168
162
  &.placeholder_js {
169
163
  color: #adadad;
170
164
  }
@@ -19,8 +19,24 @@ module Caboose
19
19
  case name
20
20
  when "first_name" then user.first_name = value
21
21
  when "last_name" then user.last_name = value
22
- when "username" then user.username = value
23
- when "email" then user.email = value
22
+ when "username"
23
+ uname = value.strip.downcase
24
+ if uname.length < 3
25
+ resp.error = "Username must be at least three characters."
26
+ elsif Caboose::User.where(:username => uname, :site_id => @site.id).where('id != ?',user.id).exists?
27
+ resp.error = "That username is already taken."
28
+ else
29
+ user.username = uname
30
+ end
31
+ when "email"
32
+ email = value.strip.downcase
33
+ if !email.include?('@')
34
+ resp.error = "Invalid email address."
35
+ elsif Caboose::User.where(:email => email, :site_id => @site.id).where('id != ?',user.id).exists?
36
+ resp.error = "That email address is already in the system."
37
+ else
38
+ user.email = email
39
+ end
24
40
  when "phone" then user.phone = value
25
41
  when "password"
26
42
  confirm = params[:confirm]
@@ -221,8 +221,24 @@ module Caboose
221
221
  when 'site_id' then user.site_id = value
222
222
  when 'first_name' then user.first_name = value
223
223
  when 'last_name' then user.last_name = value
224
- when 'username' then user.username = value
225
- when 'email' then user.email = value
224
+ when "username"
225
+ uname = value.strip.downcase
226
+ if uname.length < 3
227
+ resp.error = "Username must be at least three characters."
228
+ elsif Caboose::User.where(:username => uname, :site_id => @site.id).where('id != ?',user.id).exists?
229
+ resp.error = "That username is already taken."
230
+ else
231
+ user.username = uname
232
+ end
233
+ when "email"
234
+ email = value.strip.downcase
235
+ if !email.include?('@')
236
+ resp.error = "Invalid email address."
237
+ elsif Caboose::User.where(:email => email, :site_id => @site.id).where('id != ?',user.id).exists?
238
+ resp.error = "That email address is already in the system."
239
+ else
240
+ user.email = email
241
+ end
226
242
  when 'address' then user.address = value
227
243
  when 'address2' then user.address2 = value
228
244
  when 'city' then user.city = value
@@ -131,7 +131,7 @@ class Caboose::User < ActiveRecord::Base
131
131
  if value.to_i > 0 # Add to role
132
132
  if role_id == 'all'
133
133
  Caboose::RoleMembership.where(:user_id => self.id).destroy_all
134
- Caboose::Role.where(:site_id => self.site_id).reorder(:name).all.each{ |r| RoleMembership.create(:user_id => self.id, :role_id => r.id) }
134
+ Caboose::Role.where(:site_id => self.site_id).reorder(:name).all.each{ |r| Caboose::RoleMembership.create(:user_id => self.id, :role_id => r.id) }
135
135
  else
136
136
  if !Caboose::RoleMembership.where(:user_id => self.id, :role_id => role_id.to_i).exists?
137
137
  Caboose::RoleMembership.create( :user_id => self.id, :role_id => role_id.to_i)
@@ -11,6 +11,7 @@ u = @logged_in_user
11
11
  <h4 class="title">Account Information</h4>
12
12
  <div class="input-holder"><div id='user_<%= @user.id %>_first_name' ></div></div>
13
13
  <div class="input-holder"><div id='user_<%= @user.id %>_last_name' ></div></div>
14
+ <div class="input-holder"><div id='user_<%= @user.id %>_username' ></div></div>
14
15
  <div class="input-holder"><div id='user_<%= @user.id %>_email' ></div></div>
15
16
  <div class="input-holder"><div id='user_<%= @user.id %>_phone' ></div></div>
16
17
  <div id='message2'></div>
@@ -87,7 +88,8 @@ $(document).ready(function() {
87
88
  authenticity_token: '<%= form_authenticity_token %>',
88
89
  attributes: [
89
90
  { name: 'first_name' , nice_name: 'First name' , type: 'text', value: <%= raw Caboose.json(@user.first_name) %>, width: 400 },
90
- { name: 'last_name' , nice_name: 'Last name' , type: 'text', value: <%= raw Caboose.json(@user.last_name) %>, width: 400 },
91
+ { name: 'last_name' , nice_name: 'Last name' , type: 'text', value: <%= raw Caboose.json(@user.last_name) %>, width: 400 },
92
+ { name: 'username' , nice_name: 'Username' , type: 'text', value: <%= raw Caboose.json(@user.username) %>, width: 400 },
91
93
  { name: 'email' , nice_name: 'Email' , type: 'text', value: <%= raw Caboose.json(@user.email) %>, width: 400 },
92
94
  { name: 'phone' , nice_name: 'Phone Number' , type: 'text', value: <%= raw Caboose.json(@user.phone) %>, width: 400 }
93
95
  ],
@@ -8,6 +8,17 @@
8
8
  <p><div id='page_<%= @page.id %>_custom_css'></div></p>
9
9
 
10
10
  <%= render :partial => 'caboose/pages/admin_footer' %>
11
+
12
+ <% content_for :caboose_js do %>
13
+ <style>
14
+ textarea {
15
+ font-family: monospace;
16
+ font-size: 14px;
17
+ line-height: 22px;
18
+ padding: 5px 15px !important;
19
+ }
20
+ </style>
21
+ <% end %>
11
22
  <% content_for :caboose_js do %>
12
23
  <script type='text/javascript'>
13
24
 
@@ -30,4 +41,4 @@ $(document).ready(function() {
30
41
  });
31
42
 
32
43
  </script>
33
- <% end %>
44
+ <% end %>
@@ -8,6 +8,18 @@
8
8
  <p><div id='page_<%= @page.id %>_custom_js'></div></p>
9
9
 
10
10
  <%= render :partial => 'caboose/pages/admin_footer' %>
11
+
12
+ <% content_for :caboose_js do %>
13
+ <style>
14
+ textarea {
15
+ font-family: monospace;
16
+ font-size: 14px;
17
+ line-height: 22px;
18
+ padding: 5px 15px !important;
19
+ }
20
+ </style>
21
+ <% end %>
22
+
11
23
  <% content_for :caboose_js do %>
12
24
  <script type='text/javascript'>
13
25
 
@@ -26,10 +26,10 @@ $(document).ready(function() {
26
26
  { name: 'seo_title' , nice_name: 'SEO Title' , type: 'text' , value: <%= raw Caboose.json(@page.seo_title) %>, width: 580 },
27
27
  { name: 'meta_robots' , nice_name: 'Meta Robots' , type: 'text' , value: <%= raw Caboose.json(@page.meta_robots) %>, width: 580 },
28
28
  { name: 'canonical_url' , nice_name: 'Canonical URL' , type: 'text' , value: <%= raw Caboose.json(@page.canonical_url) %>, width: 580 },
29
- { name: 'meta_keywords' , nice_name: 'Meta Keywords' , type: 'textarea' , value: <%= raw Caboose.json(@page.meta_keywords) %>, width: 580, height: 80 },
30
- { name: 'meta_description' , nice_name: 'Meta Description' , type: 'textarea' , value: <%= raw Caboose.json(@page.meta_description) %>, width: 580, height: 80 },
31
- { name: 'fb_description' , nice_name: 'Facebook Description' , type: 'textarea' , value: <%= raw Caboose.json(@page.fb_description) %>, width: 580, height: 80 },
32
- { name: 'gp_description' , nice_name: 'Google+ Description' , type: 'textarea' , value: <%= raw Caboose.json(@page.gp_description) %>, width: 580, height: 80 }
29
+ { name: 'meta_keywords' , nice_name: 'Meta Keywords' , type: 'textarea' , value: <%= raw Caboose.json(@page.meta_keywords) %>, width: 580, height: 150 },
30
+ { name: 'meta_description' , nice_name: 'Meta Description' , type: 'textarea' , value: <%= raw Caboose.json(@page.meta_description) %>, width: 580, height: 150 },
31
+ { name: 'fb_description' , nice_name: 'Facebook Description' , type: 'textarea' , value: <%= raw Caboose.json(@page.fb_description) %>, width: 580, height: 150 },
32
+ { name: 'gp_description' , nice_name: 'Google+ Description' , type: 'textarea' , value: <%= raw Caboose.json(@page.gp_description) %>, width: 580, height: 150 }
33
33
  ],
34
34
  on_load: function() {
35
35
  $('#page_<%= @page.id %>_meta_description').keyup(function() {
@@ -9,15 +9,16 @@
9
9
  <%
10
10
  tabs = {
11
11
  'General' => "/admin/users/#{@edituser.id}",
12
- 'Invoices' => "/admin/users/#{@edituser.id}/invoices",
13
12
  'Login Logs' => "/admin/login-logs?user_id=#{@edituser.id}",
14
13
  'Password' => "/admin/users/#{@edituser.id}/password",
15
14
  'Roles' => "/admin/users/#{@edituser.id}/roles",
16
15
  'Delete' => "/admin/users/#{@edituser.id}/delete"
17
16
  }
18
- if @site.use_store
17
+ if @site.use_store || @site.is_master
19
18
  arr = tabs.to_a.insert(1, ['Payment Method', "/admin/users/#{@edituser.id}/payment-method"])
20
19
  tabs = Hash[arr]
20
+ arr = tabs.to_a.insert(2, ['Invoices', "/admin/users/#{@edituser.id}/invoices"])
21
+ tabs = Hash[arr]
21
22
  arr = tabs.to_a.insert(5, ['Variant Limits', "/admin/users/#{@edituser.id}/variant-limits"])
22
23
  tabs = Hash[arr]
23
24
  end
@@ -5,12 +5,19 @@ pic = "http://gravatar.com/avatar/#{gravatar_id}.png?s=150" #&d=/assets/caboose/
5
5
 
6
6
  <%= render :partial => 'caboose/users/admin_header' %>
7
7
 
8
- <p id='gravatar'><img src='<%= pic %>' /><a href='http://gravatar.com'>Update on gravatar</a></p>
9
- <p><div id='user_<%= @edituser.id %>_first_name' ></div></p>
10
- <p><div id='user_<%= @edituser.id %>_last_name' ></div></p>
11
- <p><div id='user_<%= @edituser.id %>_username' ></div></p>
12
- <p><div id='user_<%= @edituser.id %>_email' ></div></p>
13
- <p><div id='user_<%= @edituser.id %>_locked' ></div></p>
8
+ <div class="user-details-wrapper clearfix">
9
+ <div class="gravatar-holder">
10
+ <p id='gravatar'><img src='<%= pic %>' /><a href='http://gravatar.com'>Update on gravatar</a></p>
11
+ </div>
12
+ <div class="mb-holder">
13
+ <p><div id='user_<%= @edituser.id %>_first_name' ></div></p>
14
+ <p><div id='user_<%= @edituser.id %>_last_name' ></div></p>
15
+ <p><div id='user_<%= @edituser.id %>_username' ></div></p>
16
+ <p><div id='user_<%= @edituser.id %>_email' ></div></p>
17
+ <p><div id='user_<%= @edituser.id %>_locked' ></div></p>
18
+ </div>
19
+ </div>
20
+
14
21
 
15
22
  <%= render :partial => 'caboose/users/admin_footer' %>
16
23
 
@@ -18,6 +25,18 @@ pic = "http://gravatar.com/avatar/#{gravatar_id}.png?s=150" #&d=/assets/caboose/
18
25
  <style type='text/css'>
19
26
  #content input[type=checkbox] { position: relative; }
20
27
  #roles { height: 200px; overflow-y: scroll; margin-bottom: 20px; }
28
+ .user-details-wrapper .gravatar-holder {
29
+ width: 25%;
30
+ float: right;
31
+ }
32
+ .user-details-wrapper .mb-holder {
33
+ width: 72%;
34
+ float: left;
35
+ padding-right: 2%;
36
+ }
37
+ #content2 {
38
+ max-width: 800px;
39
+ }
21
40
  </style>
22
41
  <% end %>
23
42
  <% content_for :caboose_js do %>
@@ -31,11 +50,11 @@ $(document).ready(function() {
31
50
  update_url: '/admin/users/<%= @edituser.id %>',
32
51
  authenticity_token: '<%= form_authenticity_token %>',
33
52
  attributes: [
34
- { name: 'first_name' , nice_name: 'First name', type: 'text' , value: <%= raw Caboose.json(@edituser.first_name) %>, width: 280 },
35
- { name: 'last_name' , nice_name: 'Last name' , type: 'text' , value: <%= raw Caboose.json(@edituser.last_name) %>, width: 280 },
36
- { name: 'username' , nice_name: 'Username' , type: 'text' , value: <%= raw Caboose.json(@edituser.username) %>, width: 280 },
37
- { name: 'email' , nice_name: 'Email' , type: 'text' , value: <%= raw Caboose.json(@edituser.email) %>, width: 280 },
38
- { name: 'locked' , nice_name: 'Locked' , type: 'checkbox' , value: <%= @edituser.locked ? 1 : 0 %>, width: 280 }
53
+ { name: 'first_name' , nice_name: 'First name', type: 'text' , value: <%= raw Caboose.json(@edituser.first_name) %>, width: 350 },
54
+ { name: 'last_name' , nice_name: 'Last name' , type: 'text' , value: <%= raw Caboose.json(@edituser.last_name) %>, width: 350 },
55
+ { name: 'username' , nice_name: 'Username' , type: 'text' , value: <%= raw Caboose.json(@edituser.username) %>, width: 350 },
56
+ { name: 'email' , nice_name: 'Email' , type: 'text' , value: <%= raw Caboose.json(@edituser.email) %>, width: 350 },
57
+ { name: 'locked' , nice_name: 'Locked' , type: 'checkbox' , value: <%= @edituser.locked ? 1 : 0 %>, width: 350 }
39
58
  ]
40
59
  });
41
60
  });
@@ -40,8 +40,13 @@ $(document).ready(function() {
40
40
  });
41
41
  });
42
42
 
43
- function get_role_ids(u) { return $(u.roles).map(function(i, r) { return r.id }).get(); }
44
- function get_role_names(u) { return $(u.roles).map(function(i, r) { return r.name }).get(); }
43
+ function get_role_ids(u) { console.dir(u.roles); return $(u.roles).map(function(i, r) { return r.id }).get(); }
44
+ function get_role_names(u) {
45
+ seen_roles = [];
46
+ role_names = [];
47
+ $(u.roles).map(function(i, r) { if (seen_roles.indexOf(r.id) >= 0) { } else { role_names.push(r.name); seen_roles.push(r.id); } });
48
+ return role_names.join(', ');
49
+ }
45
50
 
46
51
  </script>
47
52
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.100'
2
+ VERSION = '0.9.101'
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.100
4
+ version: 0.9.101
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry