caboose-cms 0.1.78 → 0.1.91

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,7 +43,10 @@ CabooseStation = Class.extend({
43
43
  this2.open_tabs[this2.open_tabs.length] = id;
44
44
  });
45
45
 
46
- $('#caboose_conductor').click(function() { this2.right(); });
46
+ $('#caboose_conductor').click(function(event) {
47
+ event.preventDefault();
48
+ this2.right();
49
+ });
47
50
  $('#caboose_station ul.hidden').hide();
48
51
  $('#caboose_station li a.top_level').click(function() {
49
52
  ul = $(this).parent().children("ul.hidden:first");
@@ -78,6 +81,11 @@ CabooseStation = Class.extend({
78
81
  else if (this2.state == 'right')
79
82
  this2.min();
80
83
  });
84
+
85
+ $('#caboose_station li.my_account a').click(function(event) {
86
+ event.preventDefault();
87
+ this2.open_url($(this).attr('href'));
88
+ });
81
89
  },
82
90
 
83
91
  min: function(func_after)
@@ -126,7 +134,7 @@ CabooseStation = Class.extend({
126
134
  },
127
135
 
128
136
  open_url: function(url)
129
- {
137
+ {
130
138
  // Send the station settings first
131
139
  var this2 = this;
132
140
  $.ajax({
@@ -9,7 +9,8 @@
9
9
  * compiled file, but it's generally better to create a new file per style scope.
10
10
  *
11
11
  *= require modeljs
12
- *= require caboose/caboose
12
+ *= require caboose/fonts
13
+ *= require caboose/caboose
13
14
  */
14
15
 
15
16
  body {
@@ -9,6 +9,7 @@
9
9
  * compiled file, but it's generally better to create a new file per style scope.
10
10
  *
11
11
  *= require modeljs
12
- *= require caboose/caboose
12
+ *= require caboose/fonts
13
+ *= require caboose/caboose
13
14
  *= require application
14
15
  */
@@ -62,20 +62,43 @@ body {
62
62
  height: 100%;
63
63
  background: #e1e1e1;
64
64
  border: #aaa 1px solid;
65
+ font-family: BigNoodleTitling, Tahoma;
65
66
  }
66
67
 
67
- #caboose_station h2 {
68
- height: 86px;
68
+ #caboose_station .caboose_logo {
69
+ height: 100px;
69
70
  background-image: url('/assets/caboose/caboose_nav.png');
70
- background-position: 0 -33px;
71
+ background-position: 64px 0;
71
72
  margin: 0;
72
73
  padding: 0;
73
74
  border-bottom: #aaa 1px solid;
75
+ }
76
+
77
+ #caboose_station h2 {
78
+ display: none;
79
+ height: 40px;
80
+ background-image: url('/assets/caboose/caboose_nav.png');
81
+ background-position: 64px 0;
82
+ margin: 0;
83
+ padding: 80px 0 0 0;
84
+ border-bottom: #aaa 1px solid;
74
85
 
75
86
  /* Hide the text. */
87
+ /*
76
88
  text-indent: 100%;
77
89
  white-space: nowrap;
78
90
  overflow: hidden;
91
+ */
92
+ }
93
+
94
+ #caboose_station h2 span {
95
+ display: block;
96
+ color: #941403;
97
+ text-align: center;
98
+ font-size: 20px;
99
+ font-weight: normal;
100
+ background: #e1e1e1;
101
+ height: 40px;
79
102
  }
80
103
 
81
104
  #caboose_station ul.account {
@@ -99,21 +122,27 @@ body {
99
122
  margin: 0;
100
123
  padding: 0;
101
124
  height: 33px;
102
- background-image: url(/assets/caboose/caboose_nav.png);
103
- background-repeat: no-repeat;
104
- background-position: 0 0;
105
-
125
+
106
126
  /* Hide the text. */
127
+ /*
107
128
  text-indent: 100%;
108
129
  white-space: nowrap;
109
130
  overflow: hidden;
131
+ */
132
+ font-family: BigNoodleTitling, Tahoma;
133
+ font-size: 16px;
134
+ color: #505050;
135
+ background: #aaa;
136
+ text-decoration: none;
137
+ text-align: center;
138
+ border-bottom: #cecece 1px solid;
139
+ }
140
+ #caboose_station ul.account li a span {
141
+ padding-top: 8px;
110
142
  }
111
143
 
112
- #caboose_station ul.account li.my_account a { width: 103px; background-position: 0px 0px; border-right: #828181 1px solid; }
113
- #caboose_station ul.account li.logout a { width: 103px; background-position: -106px 0px; border-left: #cecece 1px solid; }
114
-
115
- #caboose_station ul.account li.my_account a:hover { background-position: -212px 0px; }
116
- #caboose_station ul.account li.logout a:hover { background-position: -318px 0px; }
144
+ #caboose_station ul.account li.my_account a { width: 103px; border-right: #828181 1px solid; }
145
+ #caboose_station ul.account li.logout a { width: 103px; border-left: #cecece 1px solid; }
117
146
 
118
147
  #caboose_station ul.account li a:hover {
119
148
  color: #941403;
@@ -138,7 +167,7 @@ body {
138
167
  }
139
168
 
140
169
  #caboose_station ul.admin a {
141
- display: block;
170
+ display: block !important;
142
171
  margin: 1px 0 0 0;
143
172
  padding: 8px 10px;
144
173
  color: #505050;
@@ -149,40 +178,65 @@ body {
149
178
  color: #941403;
150
179
  }
151
180
 
152
- #caboose_station ul.admin a.top_level {
181
+ #caboose_station ul.admin li a.top_level {
153
182
  background-image: url('/assets/caboose/caboose_nav.png');
154
183
  background-repeat: no-repeat;
155
184
  background-position: 0 0;
185
+
156
186
  width: 208px;
157
187
  height: 50px;
158
188
  margin: 0;
159
189
  padding: 0;
160
190
  border-top: #f7f7f7 1px solid;
161
191
  border-bottom: #aaa 1px solid;
192
+ position: relative;
162
193
 
163
194
  /* Hide the text. */
195
+ /*
164
196
  text-indent: 100%;
165
197
  white-space: nowrap;
166
198
  overflow: hidden;
199
+ */
200
+ font-family: BigNoodleTitling, Tahoma;
201
+ font-size: 16px;
167
202
  }
168
203
 
169
- #caboose_station ul.admin li#nav_item_users a.top_level { background-position: 0px -119px; }
170
- #caboose_station ul.admin li#nav_item_roles a.top_level { background-position: 0px -171px; }
171
- #caboose_station ul.admin li#nav_item_permissions a.top_level { background-position: 0px -222px; }
172
- #caboose_station ul.admin li#nav_item_pages a.top_level { background-position: 0px -275px; }
173
- #caboose_station ul.admin li#nav_item_settings a.top_level { background-position: 0px -328px; }
204
+ #caboose_station ul.admin li a.top_level span {
205
+ display: block !important;
206
+ margin: 0 0 0 60px;
207
+ padding: 16px 0 0 0;
208
+ height: 34px;
209
+ background: #e1e1e1;
210
+ vertical-align: middle;
211
+ font-family: BigNoodleTitling, Tahoma;
212
+ font-size: 16px;
213
+ }
214
+ #caboose_station ul.admin li a.top_level:hover span { color: #941403; }
215
+ #caboose_station ul.admin li a.top_level:active span { color: #941403; }
174
216
 
175
- #caboose_station ul.admin li#nav_item_users a.top_level:hover { background-position: -212px -119px; }
176
- #caboose_station ul.admin li#nav_item_roles a.top_level:hover { background-position: -212px -171px; }
177
- #caboose_station ul.admin li#nav_item_permissions a.top_level:hover { background-position: -212px -222px; }
178
- #caboose_station ul.admin li#nav_item_pages a.top_level:hover { background-position: -212px -275px; }
179
- #caboose_station ul.admin li#nav_item_settings a.top_level:hover { background-position: -212px -328px; }
217
+ #caboose_station ul.admin li a.top_level { background-position: 0px -350px; }
218
+ #caboose_station ul.admin li#nav_item_users a.top_level { background-position: 0px -100px; }
219
+ #caboose_station ul.admin li#nav_item_roles a.top_level { background-position: 0px -150px; }
220
+ #caboose_station ul.admin li#nav_item_permissions a.top_level { background-position: 0px -200px; }
221
+ #caboose_station ul.admin li#nav_item_pages a.top_level { background-position: 0px -250px; }
222
+ #caboose_station ul.admin li#nav_item_settings a.top_level { background-position: 0px -300px; }
223
+ #caboose_station ul.admin li#nav_item_star a.top_level { background-position: 0px -350px; }
180
224
 
181
- #caboose_station ul.admin li#nav_item_users a.top_level:active { background-position: -424px -119px; }
182
- #caboose_station ul.admin li#nav_item_roles a.top_level:active { background-position: -424px -171px; }
183
- #caboose_station ul.admin li#nav_item_permissions a.top_level:active { background-position: -424px -222px; }
184
- #caboose_station ul.admin li#nav_item_pages a.top_level:active { background-position: -424px -275px; }
185
- #caboose_station ul.admin li#nav_item_settings a.top_level:active { background-position: -424px -328px; }
225
+ #caboose_station ul.admin li a.top_level:hover { background-position: -250px -350px; }
226
+ #caboose_station ul.admin li#nav_item_users a.top_level:hover { background-position: -250px -100px; }
227
+ #caboose_station ul.admin li#nav_item_roles a.top_level:hover { background-position: -250px -150px; }
228
+ #caboose_station ul.admin li#nav_item_permissions a.top_level:hover { background-position: -250px -200px; }
229
+ #caboose_station ul.admin li#nav_item_pages a.top_level:hover { background-position: -250px -250px; }
230
+ #caboose_station ul.admin li#nav_item_settings a.top_level:hover { background-position: -250px -300px; }
231
+ #caboose_station ul.admin li#nav_item_star a.top_level:hover { background-position: -250px -350px; }
232
+
233
+ #caboose_station ul.admin li a.top_level:active { background-position: -500px -350px; }
234
+ #caboose_station ul.admin li#nav_item_users a.top_level:active { background-position: -500px -100px; }
235
+ #caboose_station ul.admin li#nav_item_roles a.top_level:active { background-position: -500px -150px; }
236
+ #caboose_station ul.admin li#nav_item_permissions a.top_level:active { background-position: -500px -200px; }
237
+ #caboose_station ul.admin li#nav_item_pages a.top_level:active { background-position: -500px -250px; }
238
+ #caboose_station ul.admin li#nav_item_settings a.top_level:active { background-position: -500px -300px; }
239
+ #caboose_station ul.admin li#nav_item_star a.top_level:active { background-position: -500px -350px; }
186
240
 
187
241
  #caboose_station_wrapper.state_min a.close,
188
242
  #caboose_station_wrapper.state_left a.close,
@@ -192,20 +246,30 @@ body {
192
246
  background-repeat: no-repeat;
193
247
  background-position: 0 0;
194
248
  width: 208px;
195
- height: 50px;
249
+ height: 50px;
250
+ font-family: BigNoodleTitling, Tahoma;
251
+ text-decoration: none;
252
+ }
253
+
254
+ #caboose_station_wrapper a.close span {
255
+ display: block;
256
+ margin: 0 0 0 60px;
257
+ padding: 16px 0 0 0;
258
+ height: 34px;
196
259
 
197
- /* Hide the text. */
198
- text-indent: 100%;
199
- white-space: nowrap;
200
- overflow: hidden;
260
+ font-family: BigNoodleTitling, Tahoma;
261
+ font-size: 16px;
201
262
  }
263
+ #caboose_station_wrapper a.close span { background: #e1e1e1; color: #505050; }
264
+ #caboose_station_wrapper a.close:hover span { background: #e1e1e1; color: #941403; }
265
+ #caboose_station_wrapper a.close:active span { background: #d2d2d2; color: #941403; }
202
266
 
203
- #caboose_station_wrapper.state_left a.close { background-position: 0px -422px; }
204
- #caboose_station_wrapper.state_right a.close { background-position: 0px -380px; }
205
- #caboose_station_wrapper.state_min a.close { background-position: 0px -380px; }
206
- #caboose_station_wrapper.state_left a.close:hover { background-position: -212px -422px; }
207
- #caboose_station_wrapper.state_right a.close:hover { background-position: -212px -380px; }
208
- #caboose_station_wrapper.state_min a.close:hover { background-position: -212px -380px; }
209
- #caboose_station_wrapper.state_left a.close:active { background-position: -424px -422px; }
210
- #caboose_station_wrapper.state_right a.close:active { background-position: -424px -380px; }
211
- #caboose_station_wrapper.state_min a.close:active { background-position: -424px -380px; }
267
+ #caboose_station_wrapper.state_left a.close { background-position: 0px -450px; }
268
+ #caboose_station_wrapper.state_right a.close { background-position: 0px -400px; }
269
+ #caboose_station_wrapper.state_min a.close { background-position: 0px -400px; }
270
+ #caboose_station_wrapper.state_left a.close:hover { background-position: -250px -450px; }
271
+ #caboose_station_wrapper.state_right a.close:hover { background-position: -250px -400px; }
272
+ #caboose_station_wrapper.state_min a.close:hover { background-position: -250px -400px; }
273
+ #caboose_station_wrapper.state_left a.close:active { background-position: -500px -450px; }
274
+ #caboose_station_wrapper.state_right a.close:active { background-position: -500px -400px; }
275
+ #caboose_station_wrapper.state_min a.close:active { background-position: -500px -400px; }
@@ -0,0 +1,5 @@
1
+
2
+ @font-face {
3
+ font-family: 'BigNoodleTitling';
4
+ src: local('Big Noodle Titling'), url('/assets/caboose/fonts/big_noodle_titling.ttf') format('truetype');
5
+ }
@@ -0,0 +1,64 @@
1
+
2
+ <h1>Edit Workout</h1>
3
+
4
+ <p><select name='day' onchange="window.location='/workouts/'+this.value+'/edit';">
5
+ <% @workouts.each do |w| %>
6
+ <%
7
+ text = "Day #{w.day}" + (w.name.nil? ? "" : " - #{w.name}")
8
+ selected = w.day == @workout.day ? " selected='true'" : ''
9
+ %>
10
+ <option value="<%= w.day %>"<%= selected %>><%= text %></option>
11
+ <% end %>
12
+ </select></p>
13
+ <hr />
14
+ <div id='workout_<%= @workout.id %>_container'></div>
15
+
16
+ <h2>Sets</h2>
17
+ <div id='set_listing_container'></div>
18
+ <h2>New Set</h2>
19
+ <div id='set_new_container'></div>
20
+
21
+ <% content_for :css do %>
22
+ <%= stylesheet_link_tag "workouts", :media => "all" %>
23
+ <% end %>
24
+ <% content_for :js do %>
25
+ <%= javascript_include_tag "model.form.set" %>
26
+ <script type="text/javascript">
27
+ $(document).ready(function() {
28
+
29
+ new Controller({
30
+
31
+ init: function()
32
+ {
33
+ var workout = new Model({
34
+ name: 'Workout',
35
+ id: <%= @workout.id %>,
36
+ attributes: [
37
+ { name: 'name' , type: 'text' , value: <%= raw @workout.name.to_json %> },
38
+ { name: 'description' , type: 'textarea' , value: <%= raw @workout.description.to_json %>, width: 400, height: 200 }
39
+ ]
40
+ });
41
+
42
+ var set = new Model({
43
+ name: 'Set',
44
+ id: 'new',
45
+ form: 'Model.Form.Set',
46
+ post_add: function() {
47
+ set.listing();
48
+ $('#'+set.message).empty();
49
+ },
50
+ listing_url: '/sets/listing?workout_id=<%= @workout.id %>',
51
+ attributes: [
52
+ { name: 'workout_id' , type: 'hidden' , value: <%= @workout.id %> },
53
+ { name: 'category_id' , type: 'select' , value: -1, options_url: '/workouts/category-options' },
54
+ { name: 'movement_id' , type: 'select' , value: -1, options_url: '/movements/options' },
55
+ { name: 'qty' , type: 'text' , value: 1, show_reminder: false, css: { width: 40, textAlign: 'right' } },
56
+ { name: 'reps' , type: 'text' , value: 10, show_reminder: false, css: { width: 40, textAlign: 'right' } },
57
+ { name: 'per_unit' , type: 'text' , value: '', show_reminder: false, css: { width: 40, textAlign: 'right' } },
58
+ { name: 'hold_time' , type: 'text' , value: '', show_reminder: false, css: { width: 40, textAlign: 'right' } }
59
+ ]
60
+ });
61
+
62
+ });
63
+ </script>
64
+ <% end %>
@@ -23,15 +23,16 @@ end
23
23
  <a href='/login' class='login'>Login</a>
24
24
  <% else %>
25
25
  <ul class='account'>
26
- <li class='my_account'><a href='/users/<%= @user.id %>/edit'>My Account</a></li>
27
- <li class='logout'><a href='/logout'>Logout</a></li>
26
+ <li class='my_account'><a href='/admin/users/<%= @user.id %>/edit'><span>Account</span></a></li>
27
+ <li class='logout'><a href='/logout'><span>Logout</span></a></li>
28
28
  </ul>
29
- <h2>Caboose Station</h2>
29
+ <div class='caboose_logo'></div>
30
+ <h2><span>Caboose Station</span></h2>
30
31
  <ul class='admin'>
31
32
  <% i = 0 %>
32
33
  <% @nav.each do |item| %>
33
34
  <% id = item['id'].nil? ? i.to_s : item['id'] %>
34
- <li id='nav_item_<%= id %>'><a href='#' class='top_level'><%= item['text'] %></a>
35
+ <li id='nav_item_<%= id %>'><a href='#' class='top_level'><span><%= item['text'] %></span></a>
35
36
  <% if (!item['children'].nil? && item['children'].count > 0) %>
36
37
  <%
37
38
  visible = open_tabs.include?(id) || (!item['show_children_default'].nil? && item['show_children_default'])
@@ -47,7 +48,7 @@ end
47
48
  <% i + 1 %>
48
49
  <% end %>
49
50
  </ul>
50
- <a href='<%= return_url %>' class='close'>Close</a>
51
+ <a href='<%= return_url %>' class='close'><span>Close</span></a>
51
52
  <% end %>
52
53
  </div>
53
54
  </div>
data/bin/caboose CHANGED
@@ -43,7 +43,7 @@ when 'new'
43
43
 
44
44
  puts "Creating the new rails app..."
45
45
  `rails new #{path} -d=mysql`
46
- helper = CabooseHelper.new(path)
46
+ helper = CabooseHelper.new(path, true)
47
47
  helper.init_all
48
48
 
49
49
  when 'init'
data/lib/caboose.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "caboose/engine"
2
2
 
3
3
  module Caboose
4
-
4
+
5
5
  mattr_accessor :salt
6
6
  @@salt = "This needs to be changed pronto."
7
7
 
@@ -4,7 +4,7 @@ require 'jquery-ui-rails'
4
4
  require 'modeljs'
5
5
 
6
6
  module Caboose
7
-
7
+
8
8
  def Caboose.log(message, title = nil)
9
9
  if (Rails.logger.nil?)
10
10
  puts "\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.1.78'
2
+ VERSION = '0.1.91'
3
3
  end
@@ -8,22 +8,16 @@
8
8
  <body>
9
9
  <div id='wrapper'>
10
10
  <div id='header'>
11
- <div id='top_nav'>
12
- <% if (@user.nil? || @user.id == Caboose::User::LOGGED_OUT_USER_ID) %>
13
- <%= link_to "Login", "/login?return_url=#{request.fullpath}", :id => 'caboose_login' %>
14
- <% else %>
15
- <%= link_to "Control Panel", '#', :id => 'caboose_conductor' %>
16
- <% end %>
17
- </div>
11
+ <%= render :partial => 'layouts/caboose/top_nav' %>
18
12
  </div>
19
13
  <div id='content_wrapper'>
20
14
  <div id='content'>
21
15
 
22
- <% if (yield) %>
16
+ <% if (yield && yield.strip.length > 0) %>
23
17
  <%= yield %>
24
18
  <% elsif (!@page.nil?) %>
25
19
  <h1><%= @page.title %></h1>
26
- <%= @page.content %>
20
+ <%= raw @page.content %>
27
21
  <% end %>
28
22
 
29
23
  </div>
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.1.78
4
+ version: 0.1.91
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-05 00:00:00.000000000 Z
12
+ date: 2013-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -156,6 +156,9 @@ files:
156
156
  - app/assets/stylesheets/caboose/admin.css
157
157
  - app/assets/stylesheets/caboose/application.css
158
158
  - app/assets/stylesheets/caboose/caboose.css
159
+ - app/assets/stylesheets/caboose/fonts/big_noodle_titling.ttf
160
+ - app/assets/stylesheets/caboose/fonts/big_noodle_titling_oblique.ttf
161
+ - app/assets/stylesheets/caboose/fonts.css
159
162
  - app/assets/stylesheets/caboose/tinymce.css
160
163
  - app/controllers/caboose/admin_controller.rb
161
164
  - app/controllers/caboose/application_controller.rb
@@ -197,6 +200,7 @@ files:
197
200
  - app/views/caboose/pages/new.html.erb
198
201
  - app/views/caboose/pages/show.html.erb
199
202
  - app/views/caboose/pages/sitemap.html.erb
203
+ - app/views/caboose/pages/test.html.erb
200
204
  - app/views/caboose/pages/update_pic.html.erb
201
205
  - app/views/caboose/pages/update_resume.html.erb
202
206
  - app/views/caboose/permissions/edit.html.erb