refinerycms 0.9.6.28 → 0.9.6.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. data/VERSION +1 -1
  2. data/config/application.rb +1 -1
  3. data/db/seeds.rb +54 -41
  4. data/vendor/plugins/authentication/app/controllers/users_controller.rb +13 -1
  5. data/vendor/plugins/authentication/app/models/user.rb +0 -13
  6. data/vendor/plugins/authentication/app/views/admin/users/_user.html.erb +16 -0
  7. data/vendor/plugins/authentication/app/views/admin/users/index.html.erb +2 -19
  8. data/vendor/plugins/images/app/views/admin/images/_grid_view.html.erb +14 -13
  9. data/vendor/plugins/images/app/views/admin/images/_list_view_image.html.erb +7 -6
  10. data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +7 -15
  11. data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/index.html.erb +4 -4
  12. data/vendor/plugins/inquiries/config/routes.rb +1 -0
  13. data/vendor/plugins/pages/app/views/admin/pages/_page.html.erb +32 -0
  14. data/vendor/plugins/pages/app/views/admin/pages/_sortable_list.html.erb +1 -3
  15. data/vendor/plugins/refinery/app/views/admin/_head.html.erb +1 -1
  16. data/vendor/plugins/refinery/app/views/layouts/admin.html.erb +1 -1
  17. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_singular_name.html.erb +4 -2
  18. data/vendor/plugins/refinery_settings/app/models/refinery_setting.rb +5 -44
  19. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_refinery_setting.html.erb +11 -7
  20. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/index.html.erb +1 -1
  21. data/vendor/plugins/resources/app/views/admin/resources/_resource.html.erb +4 -3
  22. metadata +5 -4
  23. data/vendor/plugins/pages/app/views/admin/pages/_list.html.erb +0 -29
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.6.28
1
+ 0.9.6.29
@@ -2,7 +2,7 @@
2
2
  RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
3
3
 
4
4
  # Specified gem version of Refinery to use when vendor/plugins/refinery/lib/refinery.rb is not present.
5
- REFINERY_GEM_VERSION = '0.9.6.28' unless defined? REFINERY_GEM_VERSION
5
+ REFINERY_GEM_VERSION = '0.9.6.29' unless defined? REFINERY_GEM_VERSION
6
6
 
7
7
  # Boot Rails
8
8
  require File.join(File.dirname(__FILE__), 'boot')
data/db/seeds.rb CHANGED
@@ -19,87 +19,100 @@ end
19
19
  InquirySetting.create(:name => "Confirmation Body", :value => "Thank you for your inquiry %name%,\n\nThis email is a receipt to confirm we have received your inquiry and we'll be in touch shortly.\n\nThanks.", :destroyable => false)
20
20
  InquirySetting.create(:name => "Notification Recipients", :value => "", :destroyable => false)
21
21
 
22
- Page.create(:title => "Home",
22
+ page_position = -1
23
+
24
+ home_page = Page.create(:title => "Home",
23
25
  :deletable => false,
24
26
  :link_url => "/",
25
27
  :menu_match => "^/$",
26
- :position => 0).parts.create(
27
- {
28
+ :position => (page_position += 1))
29
+ home_page.parts.create({
28
30
  :title => "Body",
29
- :body => "<p>Welcome to our site. This is just a place holder page while we gather our content.</p>"
30
- }).page.parts.create(
31
- {
31
+ :body => "<p>Welcome to our site. This is just a place holder page while we gather our content.</p>",
32
+ :position => 0
33
+ })
34
+ home_page.parts.create({
32
35
  :title => "Side Body",
33
- :body => "<p>This is another block of content over here.</p>"
36
+ :body => "<p>This is another block of content over here.</p>",
37
+ :position => 1
34
38
  })
35
39
 
36
- Page.create(:title => "About Us",
40
+ about_us_page = Page.create(:title => "About Us",
37
41
  :deletable => true,
38
- :position => 1).parts.create(
39
- {
42
+ :position => (page_position += 1))
43
+ about_us_page.parts.create({
40
44
  :title => "Body",
41
- :body => "<p>This is just a standard text page example. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin metus dolor, hendrerit sit amet, aliquet nec, posuere sed, purus. Nullam et velit iaculis odio sagittis placerat. Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit viverra. Proin at leo ut lacus consequat rhoncus. In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus.\n\nInteger interdum purus id erat. Duis nec velit vitae dolor mattis euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.</p>"
42
- }).page.parts.create(
43
- {
45
+ :body => "<p>This is just a standard text page example. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin metus dolor, hendrerit sit amet, aliquet nec, posuere sed, purus. Nullam et velit iaculis odio sagittis placerat. Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit viverra. Proin at leo ut lacus consequat rhoncus. In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus.\n\nInteger interdum purus id erat. Duis nec velit vitae dolor mattis euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.</p>",
46
+ :position => 0
47
+ })
48
+ about_us_page.parts.create({
44
49
  :title => "Side Body",
45
- :body => "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus fringilla nisi a elit. Duis ultricies orci ut arcu. Ut ac nibh. Duis blandit rhoncus magna. Pellentesque semper risus ut magna. Etiam pulvinar tellus eget diam. Morbi blandit. Donec pulvinar mauris at ligula. Sed pellentesque, ipsum id congue molestie, lectus risus egestas pede, ac viverra diam lacus ac urna. Aenean elit.</p>"
50
+ :body => "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus fringilla nisi a elit. Duis ultricies orci ut arcu. Ut ac nibh. Duis blandit rhoncus magna. Pellentesque semper risus ut magna. Etiam pulvinar tellus eget diam. Morbi blandit. Donec pulvinar mauris at ligula. Sed pellentesque, ipsum id congue molestie, lectus risus egestas pede, ac viverra diam lacus ac urna. Aenean elit.</p>",
51
+ :position => 1
46
52
  })
47
53
 
48
- Page.create(:title => "Contact Us",
54
+ contact_us_page = Page.create(:title => "Contact Us",
49
55
  :link_url => "/inquiries/new",
50
56
  :menu_match => "^/inquiries.*$",
51
57
  :deletable => false,
52
- :position => 2).parts.create(
53
- {
58
+ :position => (page_position += 1))
59
+ contact_us_page.parts.create({
54
60
  :title => "Body",
55
- :body => "<p>Get in touch with us. Just use the form below and we'll get back to you as soon as we can.</p>"
56
- }).page.parts.create(
57
- {
61
+ :body => "<p>Get in touch with us. Just use the form below and we'll get back to you as soon as we can.</p>",
62
+ :position => 0
63
+ })
64
+ contact_us_page.parts.create({
58
65
  :title => "Side Body",
59
- :body => "<p>163 Evergreen Terrace<br/>Happyville<br/>USA.<br/>Phone: 1-800 CALLUSNOW</p>"
66
+ :body => "<p>163 Evergreen Terrace<br/>Happyville<br/>USA.<br/>Phone: 1-800 CALLUSNOW</p>",
67
+ :position => 1
60
68
  })
61
69
 
62
- Page.create(:title => "Thank You",
70
+ thank_you_page = Page.create(:title => "Thank You",
63
71
  :menu_match => "^/inquiries/thank_you$",
64
72
  :show_in_menu => false,
65
73
  :deletable => false,
66
- :position => 3,
67
- :parent_id => 4).parts.create(
68
- {
74
+ :position => 0,
75
+ :parent_id => contact_us_page.id)
76
+ thank_you_page.parts.create({
69
77
  :title => "Body",
70
- :body => "<p>We've received your inquiry and will get back to you with a response shortly.</p><p><a href='/'>Return to the home page</a></p>"
78
+ :body => "<p>We've received your inquiry and will get back to you with a response shortly.</p><p><a href='/'>Return to the home page</a></p>",
79
+ :position => 0
71
80
  })
72
81
 
73
- Page.create(:title => "Page not found",
82
+ page_not_found_page = Page.create(:title => "Page not found",
74
83
  :menu_match => "^/404$",
75
84
  :show_in_menu => false,
76
85
  :deletable => false,
77
- :position => 4).parts.create(
78
- {
86
+ :position => (page_position += 1))
87
+ page_not_found_page.parts.create({
79
88
  :title => "Body",
80
- :body => "<h2>Sorry, there was a problem...</h2><p>The page you requested was not found.</p><p><a href='/'>Return to the home page</a></p>"
89
+ :body => "<h2>Sorry, there was a problem...</h2><p>The page you requested was not found.</p><p><a href='/'>Return to the home page</a></p>",
90
+ :position => 0
81
91
  })
82
92
 
83
- Page.create(:title => "Privacy Policy",
93
+ privacy_policy_page = Page.create(:title => "Privacy Policy",
84
94
  :deletable => true,
85
95
  :show_in_menu => false,
86
- :position => 5).parts.create(
87
- {
96
+ :position => (page_position += 1))
97
+ privacy_policy_page.parts.create({
88
98
  :title => "Body",
89
- :body => "<p><strong>We respect your privacy. We do not market, rent or sell our email list to any outside parties.</p><p>We need your e-mail address so that we can ensure that the people using our forms are bona fide. It also allows us to send you e-mail newsletters and other communications, if you opt-in. Your postal address is required in order to send you information and pricing, if you request it.</p><p>Please call us at 123 456 7890 if you have any questions or concerns.</p>"
90
- }).page.parts.create(
91
- {
99
+ :body => "<p><strong>We respect your privacy. We do not market, rent or sell our email list to any outside parties.</p><p>We need your e-mail address so that we can ensure that the people using our forms are bona fide. It also allows us to send you e-mail newsletters and other communications, if you opt-in. Your postal address is required in order to send you information and pricing, if you request it.</p><p>Please call us at 123 456 7890 if you have any questions or concerns.</p>",
100
+ :position => 0
101
+ })
102
+ privacy_policy_page.parts.create({
92
103
  :title => "Side Body",
93
- :body => ""
104
+ :body => "",
105
+ :position => 1
94
106
  })
95
107
 
96
- Page.create(:title => "Down for maintenance",
108
+ down_for_maintenance_page = Page.create(:title => "Down for maintenance",
97
109
  :menu_match => "^/maintenance$",
98
110
  :show_in_menu => false,
99
- :position => 6).parts.create(
100
- {
111
+ :position => (page_position += 1))
112
+ down_for_maintenance_page.parts.create({
101
113
  :title => "Body",
102
- :body => "<p>Our site is currently down for maintenance. Please try back later.</p>"
114
+ :body => "<p>Our site is currently down for maintenance. Please try back later.</p>",
115
+ :position => 0
103
116
  })
104
117
 
105
118
  # Create a default themes directory.
@@ -34,7 +34,19 @@ class UsersController < ApplicationController
34
34
  @user.plugins = @selected_plugin_titles
35
35
  @user.save
36
36
  UserSession.create!(@user)
37
- current_user.update_attribute(:superuser, true) if User.count == 1 # this is the superuser if this user is the only user.
37
+ if User.count == 1
38
+ # this is the superuser if this user is the only user.
39
+ current_user.update_attribute(:superuser, true)
40
+
41
+ # set this user as the recipient of inquiry notifications
42
+ if (notification_recipients = InquirySetting.find_or_create_by_name("Notification Recipients")).present?
43
+ notification_recipients.update_attributes({
44
+ :value => current_user.email,
45
+ :destroyable => false
46
+ })
47
+ end
48
+ end
49
+
38
50
  redirect_back_or_default(admin_root_url)
39
51
  flash[:notice] = "Welcome to Refinery, #{current_user.login}."
40
52
 
@@ -55,17 +55,4 @@ class User < ActiveRecord::Base
55
55
  !other_user.superuser and User.count > 1 and (other_user.nil? or self.id != other_user.id)
56
56
  end
57
57
 
58
- protected
59
-
60
- # before filter
61
- def encrypt_password
62
- return if password.blank?
63
- self.password_salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--") if new_record?
64
- self.crypted_password = encrypt(password)
65
- end
66
-
67
- def password_required?
68
- crypted_password.blank? || !password.blank?
69
- end
70
-
71
58
  end
@@ -0,0 +1,16 @@
1
+ <li id="sortable_<%= user.id %>" class='clearfix record <%= cycle("on", "on-hover") %>'>
2
+ <span class='title'>
3
+ <strong><%= user.login %></strong>
4
+ <span class="preview">(<%= user.email %>) created <%= user.created_at.strftime("%b %d, %Y") %></span>
5
+
6
+ <span class='actions'>
7
+ <%= link_to refinery_icon_tag('delete.png'), admin_user_path(user),
8
+ :class => "cancel confirm-delete",
9
+ :title => "Remove this user forever" if current_user.can_delete?(user) %>
10
+ <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_user_path(user),
11
+ :title => 'Edit this user' %>
12
+ <%= mail_to user.email, refinery_icon_tag('email_go.png'),
13
+ :title => 'Email this user' %>
14
+ </span>
15
+ </span>
16
+ </li>
@@ -9,24 +9,7 @@
9
9
  <% if @users.any? %>
10
10
  <%= will_paginate @users, :previous_label => '&laquo;', :next_label => '&raquo;' %>
11
11
  <ul>
12
- <% @users.each do |user| -%>
13
- <li id="sortable_<%= user.id %>" class='clearfix record <%= cycle("on", "on-hover") %>'>
14
- <span class='title'>
15
- <span class='actions'>
16
- <%= link_to refinery_icon_tag('delete.png'), admin_user_path(user),
17
- :class => "cancel confirm-delete",
18
- :title => "Remove this user forever" if current_user.can_delete?(user) %>
19
- <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_user_path(user),
20
- :title => 'Edit this user' %>
21
- <%= mail_to user.email, refinery_icon_tag('email_go.png'), :title => 'Email this user' %>
22
- </span>
23
- <strong><%= user.login %></strong>
24
- <span class="preview">
25
- (<%= user.email %>) created <%= user.created_at.strftime("%b %d, %Y") %>
26
- </span>
27
- </span>
28
- </li>
29
- <% end -%>
12
+ <%= render :partial => "user", :collection => @users %>
30
13
  </ul>
31
14
  <%= will_paginate @users, :previous_label => '&laquo;', :next_label => '&raquo;' %>
32
15
  <% else %>
@@ -37,4 +20,4 @@
37
20
  </strong>
38
21
  </p>
39
22
  <% end %>
40
- </div>
23
+ </div>
@@ -1,16 +1,17 @@
1
1
  <ul id="image_grid" class="clearfix">
2
2
  <% @images.each do |image| -%>
3
- <li id="image_<%= image.id %>" <%= "class='row-end'" if (@images.index(image)+1) % 4 == 0 %>>
4
- <%= image_fu image, :grid, :title => image.title %>
5
- <span class='actions'>
6
- <%= link_to refinery_icon_tag('eye.png'), image.public_filename,
7
- :target => "_blank", :title => "Click to view '#{image.title}'<br/><em>Opens in a new window</em>" %>
8
- <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_image_path(image),
9
- :title => 'Edit this image' %>
10
- <%= link_to refinery_icon_tag('delete.png'), admin_image_path(image),
11
- :class => "cancel confirm-delete",
12
- :title => "Remove this image forever" %>
13
- </span>
14
- </li>
3
+ <li id="image_<%= image.id %>" <%= "class='row-end'" if (@images.index(image)+1) % 4 == 0 %>>
4
+ <%= image_fu image, :grid, :title => image.title %>
5
+ <span class='actions'>
6
+ <%= link_to refinery_icon_tag('eye.png'), image.public_filename,
7
+ :target => "_blank",
8
+ :title => "Click to view '#{image.title}'<br/><em>Opens in a new window</em>" %>
9
+ <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_image_path(image),
10
+ :title => 'Edit this image' %>
11
+ <%= link_to refinery_icon_tag('delete.png'), admin_image_path(image),
12
+ :class => "cancel confirm-delete",
13
+ :title => "Remove this image forever" %>
14
+ </span>
15
+ </li>
15
16
  <% end -%>
16
- </ul>
17
+ </ul>
@@ -1,16 +1,17 @@
1
1
  <% if list_view_image.parent_id.nil? %>
2
2
  <li id="sortable_<%= list_view_image.id %>" class='clearfix record <%= cycle("on", "on-hover") %>'>
3
3
  <span class='title'>
4
+ <%= list_view_image.title %> <span class="preview">&nbsp;</span>
4
5
  <span class='actions'>
5
6
  <%= link_to refinery_icon_tag('eye.png'), list_view_image.public_filename,
6
- :target => "_blank", :title => "#{image_fu list_view_image, :preview}" %>
7
+ :target => "_blank",
8
+ :title => "#{image_fu list_view_image, :preview}" %>
7
9
  <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_image_path(list_view_image),
8
- :title => 'Edit this image' %>
10
+ :title => 'Edit this image' %>
9
11
  <%= link_to refinery_icon_tag('delete.png'), admin_image_path(list_view_image),
10
- :class => "cancel confirm-delete",
11
- :title => "Remove this image forever" %>
12
+ :class => "cancel confirm-delete",
13
+ :title => "Remove this image forever" %>
12
14
  </span>
13
- <%= list_view_image.title %> <span class="preview">&nbsp;</span>
14
15
  </span>
15
16
  </li>
16
- <% end %>
17
+ <% end %>
@@ -1,24 +1,16 @@
1
1
  <li class='clearfix record <%= cycle("on", "on-hover") %>'>
2
2
  <span class='title'>
3
+ <%=h inquiry.name %>
4
+ <span class="preview">- <%= truncate(strip_tags(inquiry.message), :length => 50) -%></span>
5
+
3
6
  <span class='actions'>
4
- <%= link_to refinery_icon_tag("#{inquiry.open? ? 'accept' : 'arrow_up'}.png"),
5
- toggle_status_admin_inquiry_url(inquiry),
7
+ <%= link_to refinery_icon_tag("#{inquiry.open? ? 'accept' : 'arrow_up'}.png"), toggle_status_admin_inquiry_url(inquiry),
6
8
  :title => "Move this inquiry to #{inquiry.open? ? 'closed' : 'open'}" %>
7
- <%= link_to refinery_icon_tag('email_open.png'),
8
- admin_inquiry_url(inquiry),
9
+ <%= link_to refinery_icon_tag('email_open.png'), admin_inquiry_url(inquiry),
9
10
  :title => "Read this inquiry" -%>
10
- <%= link_to refinery_icon_tag('delete.png'),
11
- admin_inquiry_url(inquiry),
11
+ <%= link_to refinery_icon_tag('delete.png'), admin_inquiry_url(inquiry),
12
12
  :class => "cancel confirm-delete",
13
13
  :title => "Remove this inquiry forever" -%>
14
14
  </span>
15
- <%=h inquiry.name %>
16
- <span class="preview">
17
- - <%= truncate(strip_tags(inquiry.message), :length => 50) -%>
18
- </span>
19
15
  </span>
20
- </li>
21
-
22
-
23
-
24
-
16
+ </li>
@@ -16,16 +16,16 @@
16
16
  <% @inquiry_settings.each do |setting| -%>
17
17
  <li class='clearfix record <%= cycle("on", "on-hover") %>'>
18
18
  <span class='title'>
19
+ <span><%=h setting.name %></span>
19
20
  <span class='actions'>
20
21
  <%= link_to refinery_icon_tag("application_edit.png", :alt => "Edit"), edit_admin_inquiry_setting_path(setting) %>
21
22
  <%= link_to refinery_icon_tag("delete.png", :alt => "Delete"), admin_inquiry_setting_path(setting),
22
- :class => "cancel confirm-delete" ,
23
- :title => "Remove this inquiry setting forever" if setting.destroyable? %>
23
+ :class => "cancel confirm-delete" ,
24
+ :title => "Remove this inquiry setting forever" if setting.destroyable? %>
24
25
  </span>
25
- <span><%=h setting.name %></span>
26
26
  </span>
27
27
  </li>
28
28
  <% end -%>
29
29
  </ul>
30
30
  <% end -%>
31
- </div>
31
+ </div>
@@ -1,4 +1,5 @@
1
1
  ActionController::Routing::Routes.draw do |map|
2
+ map.new_inquiry '/contact', :controller => "inquiries", :action => "new"
2
3
  map.resources :inquiries, :collection => {:thank_you => :get}
3
4
 
4
5
  map.namespace(:admin) do |admin|
@@ -0,0 +1,32 @@
1
+ <%
2
+ branch = if (!page.parent_id.nil? and page === page.self_and_siblings.last) or (page != @pages.first and page === @pages.last)
3
+ "branch_end"
4
+ elsif page === @pages.first
5
+ "branch_start"
6
+ end
7
+ -%>
8
+ <li class='record<%= " #{branch}" %>' id="<%= dom_id(page) -%>">
9
+ <div class='clearfix'>
10
+ <span class='title'>
11
+ <%= h page.title %>
12
+ <%= "<em>(hidden)</em>" unless page.show_in_menu? %>
13
+ <%= "<em>(draft)</em>" if page.draft? %>
14
+ </span>
15
+
16
+ <span class='actions'>
17
+ <%= link_to refinery_icon_tag('application_go.png'), page.url,
18
+ :target => "_blank",
19
+ :title => "View this page live <br/><em>(opens in a new window)</em>" %>
20
+ <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_page_path(page),
21
+ :title => "Edit this page" %>
22
+ <%= link_to refinery_icon_tag('delete.png'), admin_page_path(page),
23
+ :class => "cancel confirm-delete",
24
+ :title => "Remove this page forever" if page.deletable? %>
25
+ </span>
26
+ </div>
27
+ <% if (children = page.children).any? -%>
28
+ <ul class='nested'>
29
+ <%= render :partial => 'page', :collection => children %>
30
+ </ul>
31
+ <% end -%>
32
+ </li>
@@ -1,4 +1,2 @@
1
- <% @pages.each do |page| %>
2
- <%= render :partial => 'list', :locals => {:page => page} %>
3
- <% end %>
1
+ <%= render :partial => "page", :collection => @pages %>
4
2
  <%= render :partial => "/shared/admin/sortable_list", :locals => {:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)} %>
@@ -1,7 +1,7 @@
1
1
  <% use_caching = RefinerySetting.find_or_set(:use_resource_caching, false) -%>
2
2
  <head>
3
3
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
4
- <title><%= RefinerySetting.find_or_set(:site_name, 'Company Name').titleize %> - Refinery</title>
4
+ <title><%= RefinerySetting.find_or_set(:site_name, 'Company Name') %> - Refinery</title>
5
5
  <%= stylesheet_link_tag 'refinery/refinery', 'refinery/tooltips', "wymeditor/skins/refinery/skin", :cache => (use_caching ? "cache/refinery" : false) %>
6
6
  <%= render :partial => "/shared/admin/head_before_javascript_libraries" -%>
7
7
  <%= jquery_include_tags(use_caching) %>
@@ -25,7 +25,7 @@
25
25
  <%= link_to image_tag("#{"http://www.resolvedigital.com/images/" unless local_request?}refinery/resolve_digital_footer_logo.png", :alt => "Resolve Digital"), "http://www.resolvedigital.com", :target => "_blank", :id => "footer_logo" %>
26
26
  <p>
27
27
  Refinery built by <%= link_to "Resolve Digital", "http://www.resolvedigital.com", :target => "_blank" %>.
28
- Copyright 2009 Resolve Digital.
28
+ Copyright &copy; 2005-<%= Time.now.year %> Resolve Digital
29
29
  </p>
30
30
  </div>
31
31
  <% end %>
@@ -1,5 +1,8 @@
1
1
  <li class='clearfix record <%%= cycle("on", "on-hover") %>' id="<%%= dom_id(<%= singular_name %>) -%>">
2
2
  <span class='title'>
3
+ <%%=h <%= singular_name %>.<%= attributes.first.name %> %>
4
+ <span class="preview">&nbsp;</span>
5
+
3
6
  <span class='actions'>
4
7
  <%%= link_to refinery_icon_tag("application_go.png"), <%= singular_name %>_url(<%= singular_name %>),
5
8
  :title => 'View this <%= $title_name.downcase %><br/><em>Opens in a new window</em>',
@@ -10,6 +13,5 @@
10
13
  :class => "cancel confirm-delete",
11
14
  :title => 'Remove this <%= $title_name.downcase %> forever' %>
12
15
  </span>
13
- <%%=h <%= singular_name %>.<%= attributes.first.name %> %> <span class="preview">&nbsp;</span>
14
16
  </span>
15
- </li>
17
+ </li>
@@ -1,24 +1,8 @@
1
1
  class RefinerySetting < ActiveRecord::Base
2
2
 
3
3
  validates_presence_of :name
4
- #validates_uniqueness_of :name
5
4
 
6
5
  serialize :value # stores into YAML format
7
- after_save do |object|
8
- cache_write(object.name, object.value)
9
- end
10
-
11
- def self.cache_key(name)
12
- "refinery_setting_#{name}"
13
- end
14
-
15
- def self.cache_write(name, value)
16
- Rails.cache.write(cache_key(name), value)
17
- end
18
-
19
- def self.cache_read(name)
20
- Rails.cache.read(cache_key(name))
21
- end
22
6
 
23
7
  # Number of settings to show per page when using will_paginate
24
8
  def self.per_page
@@ -47,33 +31,12 @@ class RefinerySetting < ActiveRecord::Base
47
31
  end
48
32
 
49
33
  def self.find_or_set(name, the_value)
50
- # Try to get the value from cache first.
51
- unless (value = cache_read(name)).present?
52
- # Either find the record or create one with the defined value
53
- value = find_or_create_by_name(:name => name.to_s, :value => the_value).value
54
- # Cache it
55
- cache_write(name, value)
56
- end
57
-
58
- # Return what we found.
59
- value
34
+ find_or_create_by_name(:name => name.to_s, :value => the_value).value
60
35
  end
61
36
 
62
37
  def self.[](name)
63
- # Try to get the value from cache first.
64
- unless (value = cache_read(name)).present?
65
- # Not found in cache, try to find the record
66
- value = if (setting = self.find_by_name(name.to_s)).present?
67
- # Cache it
68
- cache_write(name, setting.value)
69
- else
70
- # Still cache the nil to prevent more lookups to find nothing.
71
- cache_write(name, nil)
72
- end
73
- end
74
-
75
- # Return what we found.
76
- value
38
+ setting = self.find_by_name(name.to_s)
39
+ setting.value unless setting.nil?
77
40
  end
78
41
 
79
42
  def self.[]=(name, value)
@@ -90,9 +53,7 @@ class RefinerySetting < ActiveRecord::Base
90
53
  REPLACEMENTS = {"true" => true, "false" => false}
91
54
 
92
55
  def value
93
- current_value = self[:value]
94
-
95
- if current_value.present?
56
+ if (current_value = self[:value]).present?
96
57
  # This bit handles true and false so that true and false are actually returned
97
58
  # not "0" and "1"
98
59
  REPLACEMENTS.each do |current, new_value|
@@ -119,4 +80,4 @@ class RefinerySetting < ActiveRecord::Base
119
80
  self[:value] = new_value
120
81
  end
121
82
 
122
- end
83
+ end
@@ -1,12 +1,16 @@
1
1
  <li class='clearfix record <%= cycle("on", "on-hover") %>'>
2
2
  <span class='title'>
3
+ <%=h refinery_setting.name.titleize %>
4
+ <span class="preview">- <%=h truncate(refinery_setting.value.to_s, :length => 40) %></span>
5
+
3
6
  <span class='actions'>
4
- <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_refinery_setting_path(refinery_setting),
5
- :title => 'Edit this setting' %>
6
- <%= link_to refinery_icon_tag("delete.png"), admin_refinery_setting_path(refinery_setting),
7
- :class => "cancel confirm-delete",
8
- :title => 'Remove this setting forever' if refinery_setting.destroyable %>
7
+ <%= link_to refinery_icon_tag("application_edit.png"),
8
+ edit_admin_refinery_setting_path(refinery_setting),
9
+ :title => 'Edit this setting' %>
10
+ <%= link_to refinery_icon_tag("delete.png"),
11
+ admin_refinery_setting_path(refinery_setting),
12
+ :class => "cancel confirm-delete",
13
+ :title => 'Remove this setting forever' if refinery_setting.destroyable %>
9
14
  </span>
10
- <%=h refinery_setting.name.titleize %> <span class="preview">- <%=h truncate(refinery_setting.value.to_s, :length => 40) %></span>
11
15
  </span>
12
- </li>
16
+ </li>
@@ -24,4 +24,4 @@
24
24
  <% end %>
25
25
  </p>
26
26
  <% end %>
27
- </div>
27
+ </div>
@@ -1,5 +1,8 @@
1
1
  <li class='clearfix record <%= cycle("on", "on-hover") %>'>
2
2
  <span class='title'>
3
+ <%=h resource.title %>
4
+ <span class="preview">- <%= number_to_human_size(resource.size) %> - <%= resource.public_filename -%></span>
5
+
3
6
  <span class='actions'>
4
7
  <%= link_to refinery_icon_tag('page_white_put.png'), resource.public_filename,
5
8
  :title => "Download this file (#{number_to_human_size(resource.size)})" %>
@@ -8,7 +11,5 @@
8
11
  <%= link_to refinery_icon_tag('delete.png'), admin_resource_path(resource), :class => "cancel confirm-delete",
9
12
  :title => "Remove this file forever" %>
10
13
  </span>
11
- <%=h resource.title %>
12
- <span class="preview">- <%= number_to_human_size(resource.size) %> - <%= resource.public_filename -%></span>
13
14
  </span>
14
- </li>
15
+ </li>
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 6
9
- - 28
10
- version: 0.9.6.28
9
+ - 29
10
+ version: 0.9.6.29
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-04-13 00:00:00 +12:00
20
+ date: 2010-04-15 00:00:00 +12:00
21
21
  default_executable:
22
22
  dependencies: []
23
23
 
@@ -357,6 +357,7 @@ files:
357
357
  - vendor/plugins/authentication/app/models/user_plugin.rb
358
358
  - vendor/plugins/authentication/app/models/user_session.rb
359
359
  - vendor/plugins/authentication/app/views/admin/users/_form.html.erb
360
+ - vendor/plugins/authentication/app/views/admin/users/_user.html.erb
360
361
  - vendor/plugins/authentication/app/views/admin/users/edit.html.erb
361
362
  - vendor/plugins/authentication/app/views/admin/users/index.html.erb
362
363
  - vendor/plugins/authentication/app/views/admin/users/new.html.erb
@@ -659,7 +660,7 @@ files:
659
660
  - vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb
660
661
  - vendor/plugins/pages/app/views/admin/page_dialogs/link_to.html.erb
661
662
  - vendor/plugins/pages/app/views/admin/pages/_form.html.erb
662
- - vendor/plugins/pages/app/views/admin/pages/_list.html.erb
663
+ - vendor/plugins/pages/app/views/admin/pages/_page.html.erb
663
664
  - vendor/plugins/pages/app/views/admin/pages/_page_part_field.html.erb
664
665
  - vendor/plugins/pages/app/views/admin/pages/_sortable_list.html.erb
665
666
  - vendor/plugins/pages/app/views/admin/pages/edit.html.erb
@@ -1,29 +0,0 @@
1
- <%
2
- branch = if (!page.parent_id.nil? and page === page.self_and_siblings.last) or (page != @pages.first and page === @pages.last)
3
- "branch_end"
4
- elsif page === @pages.first
5
- "branch_start"
6
- end
7
- -%>
8
- <li class='record<%= " #{branch}" %>' id="<%= dom_id(page) -%>">
9
- <div class='clearfix'>
10
- <span class='actions'>
11
- <%= link_to refinery_icon_tag('application_go.png'), page.url, :target => "_blank",
12
- :title => "View this page live <br/><em>(opens in a new window)</em>" %>
13
- <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_page_path(page),
14
- :title => "Edit this page" %>
15
- <%= link_to refinery_icon_tag('delete.png'), admin_page_path(page),
16
- :class => "cancel confirm-delete",
17
- :title => "Remove this page forever" if page.deletable? %>
18
- </span>
19
- <%= h page.title %> <%= "<em>(hidden)</em>" unless page.show_in_menu? %>
20
- <%= "<em>(draft)</em>" if page.draft? %>
21
- </div>
22
- <% if (children = page.children).any? %>
23
- <ul<%= " class='nested'" %>>
24
- <% children.each do |child| %>
25
- <%= render :partial => 'list', :locals => {:page => child} %>
26
- <% end %>
27
- </ul>
28
- <% end %>
29
- </li>