caboose-cms 0.9.104 → 0.9.105

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: 294843f8b9534fe9e135c55a88dc94445b156903
4
- data.tar.gz: 68170c056570399180addfa83ac541a464032546
3
+ metadata.gz: c91b1719a19dc633fe8e4487e7f367d37667a76c
4
+ data.tar.gz: af5a3af76d2670ea0b1c8b629f8d0ab4ee014883
5
5
  SHA512:
6
- metadata.gz: 8d27d700b0862b7de7e30e148e326cd46999561dc0f4e5c1ac5a6b32401a6965f24d1fea3ea3e6abbd095d041c596a61f687a61be65e07221c3344f380282a86
7
- data.tar.gz: 0c4a7d1ebaa5088200068acb16532c48d5cc0621f575899d8243ff42549f3c1ffb8738872898ded5f45fe6509d21a1ee9aa00e8a4dd06dc90aeb43dba8071457
6
+ metadata.gz: c180fba3f360817124a39cece4cf35864314217adaf9699abb0399780bc58cef59f9ebe961c38269b5399ed3cae3aaffd6634c601beb7f8ed326508998ae25de
7
+ data.tar.gz: b9085bc03d7cecf21126fc5d3361b7cce059acbc93e8645ae6e7f9ff1522aad52d0c0cdc8a4768ca5914058076d8ea033346be925c424723d05730a3f9574439
@@ -121,6 +121,147 @@ $current-text-color: #ccc;
121
121
  }
122
122
  }
123
123
  }
124
+
125
+ #page-list {
126
+ max-width: 640px;
127
+ margin: 0 auto;
128
+ padding: 0 20px 100px 20px;
129
+ .top {
130
+ margin-bottom: 20px;
131
+ p {
132
+ margin: 0;
133
+ float: left;
134
+ }
135
+ input {
136
+ border: 1px solid #c5c5c5;
137
+ border-radius: 8px;
138
+ padding: 8px 8px 8px 8px;
139
+ font-size: 14px;
140
+ height: 33px;
141
+ float: right;
142
+ }
143
+ }
144
+ ul {
145
+ list-style-type: none;
146
+ padding: 0;
147
+ margin: 0;
148
+ padding-left: 15px;
149
+ overflow: hidden;
150
+ position: relative;
151
+ &::before {
152
+ content: " ";
153
+ display: block;
154
+ position: absolute;
155
+ left: 0;
156
+ top: -21px;
157
+ width: 1px;
158
+ height: 100%;
159
+ background-color: #dadada;
160
+ }
161
+ li {
162
+ display: block;
163
+ position: relative;
164
+ a.icon3-settings {
165
+ position: absolute;
166
+ right: 4px;
167
+ top: 8px;
168
+ font-size: 0;
169
+ color: transparent;
170
+ width: 23px;
171
+ height: 23px;
172
+ display: inline-block;
173
+ text-decoration: none;
174
+ z-index: 2;
175
+ &::before {
176
+ font-size: 20px;
177
+ color: #2d2d2d;
178
+ }
179
+ &:hover {
180
+ &::before {
181
+ color: #1c1ccc;
182
+ }
183
+ }
184
+ }
185
+ a.content {
186
+ text-decoration: none;
187
+ color: #2d2d2d;
188
+ display: block;
189
+ margin-bottom: 5px;
190
+ border: 1px solid #c5c5c5;
191
+ border-radius: 8px;
192
+ padding: 8px 8px 8px 30px;
193
+ font-size: 14px;
194
+ &:hover {
195
+ background-color: #e7e7ff;
196
+ border-color: #a6a6af;
197
+ }
198
+ &::before {
199
+ content: "\70";
200
+ font-family: "caboose-admin-menu" !important;
201
+ font-size: 20px;
202
+ position: absolute;
203
+ left: 5px;
204
+ top: 7px;
205
+ }
206
+ }
207
+ span.disabled {
208
+ text-decoration: line-through;
209
+ color: #888888;
210
+ }
211
+ &::before {
212
+ content: " ";
213
+ display: block;
214
+ position: absolute;
215
+ right: 100%;
216
+ top: 17px;
217
+ width: 50px;
218
+ height: 1px;
219
+ background-color: #dadada;
220
+ }
221
+ &.hidden {
222
+ & > a.content, & > a.icon3-settings {
223
+ display: none;
224
+ }
225
+ &::before {
226
+ display: none;
227
+ }
228
+ }
229
+ &.shown {
230
+ & > a.content {
231
+ display: block;
232
+ }
233
+ & > a.icon3-settings {
234
+ display: inline-block;
235
+ }
236
+ }
237
+ &.small {
238
+ &::before {
239
+ top: 11px;
240
+ }
241
+ & > a.content {
242
+ font-size: 11px;
243
+ padding: 4px 8px 3px 8px;
244
+ background-color: #eaeaea;
245
+ &::before {
246
+ display: none;
247
+ }
248
+ }
249
+ & > a.icon3-settings {
250
+ display: none;
251
+ }
252
+ }
253
+ }
254
+ }
255
+ & > ul {
256
+ border-left: 0;
257
+ padding-left: 0;
258
+ &::before {
259
+ top: 10px;
260
+ height: calc(100% - 31px);
261
+ }
262
+ }
263
+ }
264
+
124
265
 
125
266
  ul#crumbtrail {
126
267
  position: absolute;
@@ -158,7 +158,7 @@ body * {
158
158
  position: relative;
159
159
  }
160
160
  #content {
161
- padding: 0 0 0 30px;
161
+ padding: 0 0 100px 30px;
162
162
  }
163
163
 
164
164
  h1,h2,h3,h4,h5,h6 {
@@ -23,7 +23,6 @@
23
23
  border-radius: 0;
24
24
  border-width: 1px;
25
25
  color: #565656;
26
- font: 1em "Klinic Slab",serif;
27
26
  padding: 8px 6px 6px;
28
27
  text-align: right !important;
29
28
  }
@@ -38,7 +37,6 @@
38
37
  color: #fff;
39
38
  cursor: pointer;
40
39
  display: block-inline;
41
- font: 20px/1em "Klinic Slab",serif;
42
40
  margin-top: 20px;
43
41
  padding: 8px 15px 6px 15px;
44
42
  text-align: center;
@@ -1,23 +1,24 @@
1
1
  module Caboose
2
2
  module PagesHelper
3
3
  def pages_list(page)
4
+ is_admin = @logged_in_user && @logged_in_user.is_allowed('all', 'all')
4
5
  str = "<ul>"
5
- str << pages_list_helper(page)
6
+ str << pages_list_helper(page, is_admin)
6
7
  str << "</ul>"
7
8
  return str
8
9
  end
9
10
 
10
- def pages_list_helper(page)
11
- can_edit = (@logged_in_user && (@logged_in_user.is_allowed('all', 'all') || Page.permissible_actions(@logged_in_user, page.id).include?('edit'))) ? true : false
12
- if can_edit
13
- str = "<li><a href='/admin/pages/#{page.id}/content'>#{page.title}</a>"
11
+ def pages_list_helper(page, is_admin)
12
+ if is_admin || ((@logged_in_user && Page.permissible_actions(@logged_in_user, page.id).include?('edit')) ? true : false)
13
+ str = "<li><a class='content' href='/admin/pages/#{page.id}/content'>#{page.title}</a><a class='icon3-settings' href='/admin/pages/#{page.id}'>Settings</a>"
14
14
  else
15
15
  str = "<li><span class='disabled'>#{page.title}</span>"
16
16
  end
17
- if page.children && page.children.count > 0
17
+ pchildren = page.children.select([:id, :title])
18
+ if pchildren && pchildren.count > 0
18
19
  str << "<ul>"
19
- page.children.each do |p|
20
- str << pages_list_helper(p)
20
+ pchildren.each do |p|
21
+ str << pages_list_helper(p, is_admin)
21
22
  end
22
23
  str << "</ul>"
23
24
  end
@@ -15,10 +15,6 @@ width = 200
15
15
  <p>For assistance, please email <a href="mailto:support@nine.is">support@nine.is</a>.</p>
16
16
  </div>
17
17
  <ul>
18
- <!--
19
- <li id='nav_item_logout'><a href='/logout'><span class='icon'></span><span class='text'>Logout</span></a>
20
- <li id='nav_item_myaccount'><a href='/my-account'><span class='icon'></span><span class='text'>My Account</span></a>
21
- -->
22
18
  <% i = 0 %>
23
19
  <% @nav.each do |item| %>
24
20
  <% id = item['id'].nil? ? i.to_s : item['id'] %>
@@ -4,12 +4,13 @@
4
4
  p.uri {
5
5
  background: #efefef;
6
6
  border: #999 1px solid;
7
- padding: 10px;
7
+ padding: 9px 10px;
8
8
  position: absolute;
9
- top: 8px;
9
+ top: 9px;
10
10
  left: 251px;
11
- height: 17px;
11
+ height: 36px;
12
12
  margin: 0;
13
+ font-size: 14px;
13
14
  }
14
15
 
15
16
  </style>
@@ -20,17 +20,6 @@
20
20
  <% content_for :caboose_css do %>
21
21
  <style type='text/css'>
22
22
 
23
- p.uri {
24
- background: #efefef;
25
- border: #999 1px solid;
26
- padding: 10px;
27
- position: absolute;
28
- top: 8px;
29
- left: 251px;
30
- height: 17px;
31
- margin: 0;
32
- }
33
-
34
23
  div.field_with_explanation {
35
24
  width: 420px;
36
25
  background: #efefef;
@@ -1,35 +1,58 @@
1
1
  <h1>Pages</h1>
2
2
 
3
3
  <% if @domain %>
4
- <% if @user.is_allowed('pages','add') %>
5
- <p><a href='/admin/pages/new' class="caboose-btn-white">New Page</a></p>
6
- <% end %>
7
4
  <div id="page-list">
8
- <%= raw pages_list(@home_page) %>
5
+ <div class="clearfix top">
6
+ <% if @user.is_allowed('pages','add') %>
7
+ <p><a href='/admin/pages/new' class="caboose-btn-white">New Page</a></p>
8
+ <% end %>
9
+ <input type="text" id="pages-filter" placeholder="Filter" />
10
+ </div>
11
+ <%= raw pages_list(@home_page) %>
12
+ <p id="no-results"></p>
9
13
  </div>
10
14
  <% else %>
11
15
  <p>It doesn't look like this site is configured for the current domain. Please <a href='/admin/sites'>configure your sites</a>.</p>
12
- <% end %>
16
+ <% end %>
13
17
 
14
18
  <% content_for :caboose_css do %>
15
- <style>
16
- #page-list ul li {
17
- line-height: 26px;
18
- }
19
- #page-list ul li a {
20
- color: #2424b1;
21
- text-decoration: none;
22
- }
23
- #page-list ul li a:visited {
24
- color: #824daf;
25
- }
26
- #page-list ul li a:hover {
27
- color: #24b14b;
28
- text-decoration: underline;
29
- }
30
- #page-list ul li span.disabled {
31
- text-decoration: line-through;
32
- color: #888888;
19
+ <%= stylesheet_link_tag 'caboose/admin_menu_icons' %>
20
+ <% end %>
21
+
22
+ <% content_for :caboose_js do %>
23
+ <script>
24
+ jQuery.expr[":"].Contains = jQuery.expr.createPseudo(function(arg) {
25
+ return function( elem ) {
26
+ return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
27
+ };
28
+ });
29
+ function filter_pages() {
30
+ var results = 0;
31
+ var q = $("#pages-filter").val().toUpperCase();
32
+ if ( !q || q == '' || q == 'FILTER' ) {
33
+ $("#page-list li").removeClass('small').addClass('shown').removeClass('hidden');
34
+ $("#no-results").text('');
35
+ }
36
+ else {
37
+ $("#page-list li").addClass('hidden').removeClass('small').removeClass('shown');
38
+ $("#no-results").text('');
39
+ $.each($("a.content:Contains(" + q + ")"), function(k,v) {
40
+ $(v).closest('li').addClass('shown').removeClass('hidden');
41
+ $.each($(v).parents("li"), function(a,b) {
42
+ var t1 = $(b).children("a.content").text().toUpperCase();
43
+ if ( $(b).children("a.content").text().toUpperCase().indexOf(q) < 0 )
44
+ $(b).addClass('small');
45
+ $(b).addClass('shown').removeClass('hidden');
46
+ });
47
+ $(v).closest("li").removeClass('small');
48
+ results += 1;
49
+ });
50
+ if ( results == 0 )
51
+ $("#no-results").text("Sorry, no matching pages were found.");
52
+ }
33
53
  }
34
- </style>
54
+ $("#pages-filter").keyup(function() {
55
+ filter_pages();
56
+ });
57
+ </script>
35
58
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.104'
2
+ VERSION = '0.9.105'
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.104
4
+ version: 0.9.105
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-01-11 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg