refinerycms 0.9.5.30 → 0.9.5.31
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +15 -5
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/bin/refinery +9 -9
- data/bin/refinery-update-core +8 -5
- data/config/environment.rb +1 -1
- data/config/routes.rb +1 -0
- data/contributors.md +18 -0
- data/db/migrate/20100127004649_add_reset_code_to_users.rb +9 -0
- data/db/schema.rb +2 -1
- data/db/seeds.rb +11 -1
- data/{LICENSE → license.md} +3 -3
- data/public/javascripts/admin.js +5 -0
- data/public/javascripts/refinery/boot_wym.js +1 -1
- data/public/stylesheets/refinery/refinery.css +7 -0
- data/readme.md +161 -0
- data/themes/demolicious.zip +0 -0
- data/themes/hemingway.zip +0 -0
- data/vendor/plugins/authentication/app/controllers/admin/users_controller.rb +0 -27
- data/vendor/plugins/authentication/app/controllers/sessions_controller.rb +3 -0
- data/vendor/plugins/authentication/app/controllers/users_controller.rb +36 -21
- data/vendor/plugins/authentication/app/models/user.rb +40 -41
- data/vendor/plugins/authentication/app/models/user_mailer.rb +5 -12
- data/vendor/plugins/authentication/app/views/sessions/new.html.erb +3 -0
- data/vendor/plugins/authentication/app/views/user_mailer/reset_notification.html.erb +6 -0
- data/vendor/plugins/authentication/app/views/users/forgot.html.erb +13 -0
- data/vendor/plugins/authentication/app/views/users/reset.html.erb +18 -0
- data/vendor/plugins/authentication/authentication.md +7 -0
- data/vendor/plugins/authentication/config/routes.rb +6 -1
- data/vendor/plugins/dashboard/dashboard.md +22 -0
- data/vendor/plugins/images/images.md +46 -0
- data/vendor/plugins/inquiries/app/controllers/inquiries_controller.rb +0 -8
- data/vendor/plugins/inquiries/app/views/admin/inquiries/show.html.erb +3 -3
- data/vendor/plugins/inquiries/inquiries.md +31 -0
- data/vendor/plugins/news/app/controllers/news_items_controller.rb +9 -19
- data/vendor/plugins/news/app/views/news_items/index.html.erb +1 -1
- data/vendor/plugins/news/app/views/news_items/show.html.erb +13 -18
- data/vendor/plugins/news/news.md +20 -0
- data/vendor/plugins/pages/app/controllers/pages_controller.rb +2 -12
- data/vendor/plugins/pages/app/models/page.rb +5 -5
- data/vendor/plugins/pages/app/presenters/page_presenter.rb +3 -0
- data/vendor/plugins/pages/pages.md +141 -0
- data/vendor/plugins/pages/rails/init.rb +1 -1
- data/vendor/plugins/refinery/app/views/admin/_head.html.erb +1 -0
- data/vendor/plugins/refinery/app/views/layouts/application.html.erb +2 -15
- data/vendor/plugins/refinery/app/views/shared/_head.html.erb +13 -0
- data/vendor/plugins/refinery/app/views/shared/_header.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/_menu.html.erb +4 -15
- data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +20 -25
- data/vendor/plugins/refinery/app/views/shared/_submenu.html.erb +5 -4
- data/vendor/plugins/refinery/crud.md +197 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/public_controller.rb +6 -1
- data/vendor/plugins/refinery/lib/refinery/application_controller.rb +18 -5
- data/vendor/plugins/refinery/lib/refinery/application_helper.rb +31 -28
- data/vendor/plugins/refinery/lib/refinery/base_presenter.rb +27 -0
- data/vendor/plugins/refinery/lib/refinery/initializer.rb +7 -3
- data/vendor/plugins/refinery/lib/tasks/doc.rake +4 -4
- data/vendor/plugins/refinery/plugins.md +194 -0
- data/vendor/plugins/refinery/rails/init.rb +5 -0
- data/vendor/plugins/refinery_settings/settings.md +5 -0
- data/vendor/plugins/resources/resources.md +9 -0
- data/vendor/plugins/themes/app/controllers/themes_controller.rb +12 -15
- data/vendor/plugins/themes/app/models/theme.rb +8 -14
- data/vendor/plugins/themes/config/routes.rb +3 -3
- data/vendor/plugins/themes/themes.md +133 -0
- metadata +29 -38
- data/CONTRIBUTORS +0 -11
- data/README.rdoc +0 -78
- data/themes/demolicious/LICENSE +0 -21
- data/themes/demolicious/README +0 -1
- data/themes/demolicious/images/footer_background.png +0 -0
- data/themes/demolicious/images/header_background.png +0 -0
- data/themes/demolicious/preview.png +0 -0
- data/themes/demolicious/stylesheets/application.css +0 -94
- data/themes/demolicious/stylesheets/formatting.css +0 -36
- data/themes/demolicious/stylesheets/home.css +0 -11
- data/themes/demolicious/stylesheets/ie6.css +0 -0
- data/themes/demolicious/stylesheets/ie7.css +0 -0
- data/themes/demolicious/views/layouts/application.html.erb +0 -33
- data/themes/demolicious/views/pages/home.html.erb +0 -1
- data/themes/demolicious/views/pages/show.html.erb +0 -1
- data/themes/hemingway/LICENSE +0 -7
- data/themes/hemingway/README +0 -3
- data/themes/hemingway/images/archives.gif +0 -0
- data/themes/hemingway/images/footer_black.gif +0 -0
- data/themes/hemingway/images/kyle-header.jpg +0 -0
- data/themes/hemingway/images/readon_black.gif +0 -0
- data/themes/hemingway/images/search.gif +0 -0
- data/themes/hemingway/images/spinner.gif +0 -0
- data/themes/hemingway/images/trackback_pingback.gif +0 -0
- data/themes/hemingway/preview.png +0 -0
- data/themes/hemingway/stylesheets/application.css +0 -713
- data/themes/hemingway/views/layouts/application.html.erb +0 -64
- data/themes/hemingway/views/shared/content_page.html.erb +0 -0
- data/vendor/plugins/authentication/app/models/user_observer.rb +0 -11
- data/vendor/plugins/authentication/app/views/user_mailer/activation.html.erb +0 -3
- data/vendor/plugins/authentication/app/views/user_mailer/signup_notification.html.erb +0 -8
- data/vendor/plugins/themes/themes.rdoc +0 -131
@@ -0,0 +1,31 @@
|
|
1
|
+
# Inquiries
|
2
|
+
|
3
|
+
![Refinery Inquiries](http://refinerycms.com/system/images/0000/0626/inquiries.png)
|
4
|
+
|
5
|
+
## About
|
6
|
+
|
7
|
+
Refinery gives you a simple contact form that notifies you and the customer when an inquiry is made.
|
8
|
+
|
9
|
+
In summary you can:
|
10
|
+
|
11
|
+
* Collect and manage inquiries
|
12
|
+
* Specify who is notified when a new inquiry comes in
|
13
|
+
* Customise an auto responder email that is sent to the person making the inquiry
|
14
|
+
|
15
|
+
When inquiries come in, you and the customer are notified. The inquiry will now show up as an "open" inquiry. The idea is to deal with the inquiry and then "close" it so you know it's been sorted.
|
16
|
+
|
17
|
+
== How do I get notified?
|
18
|
+
|
19
|
+
Go into your inquiries section and click on "Update who gets notified"
|
20
|
+
|
21
|
+
== How do I edit the auto confirmation email
|
22
|
+
|
23
|
+
Go into your inquiries section and click on "Edit confirmation email"
|
24
|
+
|
25
|
+
== But I don't want a contact form how do I kill it?
|
26
|
+
|
27
|
+
Your contact form loads because you have a page in your site that is told to not just render a normal page, but load the contact form instead.
|
28
|
+
|
29
|
+
By default this page is called "Contact Us". Go to your "Pages" tab and click the edit icon on "Contact Us". Now click on "Hide/Show Advanced Options" and you'll see that a "custom URL" is set to ``/inquiries/new``. Simply change this to nothing, or delete the contact us page.
|
30
|
+
|
31
|
+
You might also want to remove the Inquiries plugin from your backend view. To do that, you go to the "Users" tab edit your user, uncheck "Inquiries" from the list of plugins you can access.
|
@@ -1,30 +1,20 @@
|
|
1
1
|
class NewsItemsController < ApplicationController
|
2
2
|
|
3
|
-
before_filter :
|
4
|
-
before_filter :
|
5
|
-
|
6
|
-
def index
|
7
|
-
respond_to do |wants|
|
8
|
-
wants.html
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def show
|
13
|
-
@news_item = NewsItem.find(params[:id], :conditions => ["publish_date < ?", Time.now])
|
14
|
-
|
15
|
-
respond_to do |wants|
|
16
|
-
wants.html
|
17
|
-
end
|
18
|
-
end
|
3
|
+
before_filter :find_latest_news_items, :find_page
|
4
|
+
before_filter :find_news_item, :only => [:show]
|
19
5
|
|
20
6
|
protected
|
21
7
|
|
22
|
-
def
|
8
|
+
def find_latest_news_items
|
23
9
|
@news_items = NewsItem.latest
|
24
10
|
end
|
25
11
|
|
26
|
-
def
|
12
|
+
def find_news_item
|
13
|
+
@news_item = NewsItem.find(params[:id], :conditions => ["publish_date < ?", Time.now])
|
14
|
+
end
|
15
|
+
|
16
|
+
def find_page
|
27
17
|
@page = Page.find_by_link_url("/news", :include => [:parts, :slugs])
|
28
18
|
end
|
29
19
|
|
30
|
-
end
|
20
|
+
end
|
@@ -1,18 +1,13 @@
|
|
1
|
-
<% content_for :
|
2
|
-
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
</div>
|
15
|
-
<div id='body_content_right' class='clearfix'>
|
16
|
-
<%= render :partial => 'recent_posts' %>
|
17
|
-
</div>
|
18
|
-
</div>
|
1
|
+
<% content_for :body_content_title, "<h1>#{@news_item.title}</h1>" %>
|
2
|
+
<% content_for :body_content_left do %>
|
3
|
+
<p>
|
4
|
+
<small>Published <%= @news_item.publish_date.strftime("%A %d of %B, %Y") %></small>
|
5
|
+
</p>
|
6
|
+
<%= @news_item.body %>
|
7
|
+
<p>
|
8
|
+
<%= link_to "Back to all news", news_items_url %>
|
9
|
+
</p>
|
10
|
+
<% end %>
|
11
|
+
<% content_for :body_content_right, render(:partial => 'recent_posts') %>
|
12
|
+
|
13
|
+
<%= render :partial => "/shared/content_page" %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# News
|
2
|
+
|
3
|
+
![Refinery News](http://refinerycms.com/system/images/0000/0646/news.png)
|
4
|
+
|
5
|
+
## About
|
6
|
+
|
7
|
+
Refinery's news plugin allows you to post updates to the news section of your website.
|
8
|
+
|
9
|
+
Key features:
|
10
|
+
|
11
|
+
* Default news page shows a summary of recent news posts
|
12
|
+
* Detail view shows the full post and also linked to recent news on the "side bar"
|
13
|
+
|
14
|
+
## But I don't want a news section, how do I kill it?
|
15
|
+
|
16
|
+
Your news section loads because you have a page in your site that is told to not just render a normal page, but load the news section instead.
|
17
|
+
|
18
|
+
By default this page is called "News". Go to your "Pages" tab and click the edit icon on "News". Now click on "Hide/Show Advanced Options" and you'll see that a "custom URL" is set to ``/news``. Simply change this to nothing, or delete the "News" page.
|
19
|
+
|
20
|
+
You might also want to remove the News plugin from your backend view. To do that, you go to the "Users" tab edit your user, uncheck "News" from the list of plugins you can access.
|
@@ -2,13 +2,7 @@ class PagesController < ApplicationController
|
|
2
2
|
|
3
3
|
def home
|
4
4
|
@page = Page.find_by_link_url("/", :include => [:parts, :slugs])
|
5
|
-
|
6
|
-
error_404
|
7
|
-
else
|
8
|
-
respond_to do |wants|
|
9
|
-
wants.html
|
10
|
-
end
|
11
|
-
end
|
5
|
+
error_404 unless @page.present?
|
12
6
|
end
|
13
7
|
|
14
8
|
def show
|
@@ -18,11 +12,7 @@ class PagesController < ApplicationController
|
|
18
12
|
# if the admin wants this to be a "placeholder" page which goes to its first child, go to that instead.
|
19
13
|
if @page.skip_to_first_child
|
20
14
|
first_live_child = @page.children.find_by_draft(false, :order => "position ASC")
|
21
|
-
redirect_to first_live_child.url
|
22
|
-
else
|
23
|
-
respond_to do |wants|
|
24
|
-
wants.html
|
25
|
-
end
|
15
|
+
redirect_to first_live_child.url if first_live_child.present?
|
26
16
|
end
|
27
17
|
else
|
28
18
|
error_404
|
@@ -13,7 +13,7 @@ class Page < ActiveRecord::Base
|
|
13
13
|
accepts_nested_attributes_for :parts, :allow_destroy => true
|
14
14
|
|
15
15
|
acts_as_indexed :fields => [:title, :meta_keywords, :meta_description, :custom_title, :browser_title, :all_page_part_content],
|
16
|
-
:index_file =>
|
16
|
+
:index_file => %W(#{RAILS_ROOT} tmp index)
|
17
17
|
|
18
18
|
before_destroy :deletable?
|
19
19
|
|
@@ -28,8 +28,8 @@ class Page < ActiveRecord::Base
|
|
28
28
|
super
|
29
29
|
else
|
30
30
|
puts "This page is not deletable. Please use .destroy! if you really want it gone or first:"
|
31
|
-
puts "unset .link_url"
|
32
|
-
puts "unset .menu_match"
|
31
|
+
puts "unset .link_url" if self.link_url.present?
|
32
|
+
puts "unset .menu_match" if self.menu_match.present?
|
33
33
|
puts "set .deletable to true" unless self.deletable
|
34
34
|
return false
|
35
35
|
end
|
@@ -57,9 +57,9 @@ class Page < ActiveRecord::Base
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def url
|
60
|
-
if
|
60
|
+
if self.link_url.present?
|
61
61
|
self.link_url
|
62
|
-
elsif
|
62
|
+
elsif self.to_param.present?
|
63
63
|
"/pages/#{self.to_param}"
|
64
64
|
end
|
65
65
|
end
|
@@ -0,0 +1,141 @@
|
|
1
|
+
# Pages
|
2
|
+
|
3
|
+
![Refinery Pages](http://refinerycms.com/system/images/0000/0656/pages.png)
|
4
|
+
|
5
|
+
## About
|
6
|
+
|
7
|
+
One core part of is Pages. Plugins such as news and inquiries hook to pages. The menu is rendered based off the structure of your pages.
|
8
|
+
|
9
|
+
Pages have one key thing about them that is unique - page parts.
|
10
|
+
|
11
|
+
## Page Parts
|
12
|
+
|
13
|
+
![Refinery Page Parts](http://refinerycms.com/system/images/0000/0586/editing-page.png)
|
14
|
+
|
15
|
+
### What are they
|
16
|
+
|
17
|
+
Think of a page part is a single piece of content on your page. At [Resolve Digital](http://www.resolvedigital.co.nz) we often simply use ``body`` and ``side_body``. One is for the main content and one is for the content which goes on a side bit of the page to display other information.
|
18
|
+
|
19
|
+
### Default Page Parts
|
20
|
+
|
21
|
+
You can change what the default page parts are called or add more by editing the "Default Page Parts" setting. This is a serialize array of names. The default looks like this
|
22
|
+
|
23
|
+
---
|
24
|
+
- body
|
25
|
+
- side_body
|
26
|
+
|
27
|
+
Add more to this setting if you want more default page parts.
|
28
|
+
|
29
|
+
### Adding Page Parts for Specify Pages
|
30
|
+
|
31
|
+
You can add extra page parts to your pages by setting the "New Page Parts" to ``true`` and editing the page you want to add a part to and clicked the little "+" icon.
|
32
|
+
|
33
|
+
Note in the user-facing front end we call them "content sections" not "page parts".
|
34
|
+
|
35
|
+
## Page Options
|
36
|
+
|
37
|
+
### Draft/Published
|
38
|
+
|
39
|
+
You can have draft and published pages. This is controlled by checking and unchecking the "Save as Draft" field on the page form, when editing the page.
|
40
|
+
|
41
|
+
### Custom Title
|
42
|
+
|
43
|
+
There are three options for how the page title will be rendered on the front end.
|
44
|
+
|
45
|
+
* ``None``: will just default to the page title
|
46
|
+
* ``Text``: allows you to have a different name for the page in the backend to the front end (sometimes good for SEO)
|
47
|
+
* ``Image``: If you're designer is using a custom non-standard web font, this is ideal. Bang the image of your title right in there (_we don't recommend this though!_)
|
48
|
+
|
49
|
+
### Show in menu
|
50
|
+
|
51
|
+
You can hide a page from the navigation if you like by unchecking "show in menu"
|
52
|
+
|
53
|
+
### Custom URL
|
54
|
+
|
55
|
+
This allows you to make your page not link to a normal page but make it show something else. This could be a donation link to a completely different site for example. Or as Refinery uses it, you might want to link to another plugin.
|
56
|
+
|
57
|
+
The "contact us" page for example has a Custom URL of ``/inquiries/new`` because we want it to load the inquiries form from the inquiries plugin instead.
|
58
|
+
|
59
|
+
### WYMEditor (the visual editor)
|
60
|
+
|
61
|
+
Refinery is backed by [WYMEditor](http://www.wymeditor.org/)
|
62
|
+
|
63
|
+
It's a standards compliant editor that we've trimmed to only have what we feel is absolutely necessary. When you're editing the content is a page part you're using [WYMEditor](http://www.wymeditor.org/).
|
64
|
+
|
65
|
+
You can also switch to "source" view and edit XHTML manually.
|
66
|
+
|
67
|
+
### Custom selectable styles in WYMEditor
|
68
|
+
|
69
|
+
![Refinery Page Editor Styles](http://refinerycms.com/system/images/0000/0596/editing-page-style.png)
|
70
|
+
|
71
|
+
Some sites require a little more than just your standard bold and heading controls. This is where the "css" style drop down comes in hand.
|
72
|
+
|
73
|
+
It allows your customers to select a style you define. You need to edut/create a CSS file called ``theme.css``. You could have this in one of two places
|
74
|
+
|
75
|
+
1. ``/public/stylesheets/themes.css``
|
76
|
+
2. ``/themes/your_theme_name/stylesheets/themes.css``
|
77
|
+
|
78
|
+
Inside that file you define your styles like this
|
79
|
+
|
80
|
+
.category-name-style-name {
|
81
|
+
// apply your CSS rules here
|
82
|
+
}
|
83
|
+
|
84
|
+
For example if I wanted to add a style that allowed my users to highlight their text a light yellow colour I would put this
|
85
|
+
|
86
|
+
.text-highlight-yellow {
|
87
|
+
background: LightYellow;
|
88
|
+
}
|
89
|
+
|
90
|
+
Now edit ``public/javascripts/admin.js``. We're going to need to tell WYMEditor that we have some new styles it should load when the editor is loaded.
|
91
|
+
|
92
|
+
Currently your ``admin.js`` file will have something like this
|
93
|
+
|
94
|
+
var wymeditorClassesItems = [
|
95
|
+
{name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}
|
96
|
+
, {name: 'image-align', rules:['left', 'right'], join: '-'}
|
97
|
+
, {name: 'font-size', rules:['small','normal','large'], join: '-'}
|
98
|
+
]
|
99
|
+
|
100
|
+
Let's just breakdown a single WYMeditor class line and understand it:
|
101
|
+
|
102
|
+
{name: 'font-size', rules:['small','normal','large'], join: '-'}
|
103
|
+
|
104
|
+
``font-size`` is the name of the category and ``small``, ``normal``, ``large`` are the actual styles. So for this to match up with the styles in my theme.css file the class name has to be:
|
105
|
+
|
106
|
+
.font-size-small { // CSS rules here }
|
107
|
+
.font-size-normal { // CSS rules here }
|
108
|
+
.font-size-large { // CSS rules here }
|
109
|
+
|
110
|
+
So going back to our text highlighting above we make the new style show up in the editor by changing our ``admin.js`` file to:
|
111
|
+
|
112
|
+
var wymeditorClassesItems = [
|
113
|
+
{name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}
|
114
|
+
, {name: 'image-align', rules:['left', 'right'], join: '-'}
|
115
|
+
, {name: 'font-size', rules:['small','normal','large'], join: '-'}
|
116
|
+
, {name: 'text-highlight', rules:['yellow'], join: '-'}
|
117
|
+
]
|
118
|
+
|
119
|
+
### Dialogs that show from WYMEditor
|
120
|
+
|
121
|
+
![Refinery Page Editor Link Dialog](http://refinerycms.com/system/images/0000/0636/link-dialog.png)
|
122
|
+
|
123
|
+
## Page Link dialog
|
124
|
+
|
125
|
+
The link dialog lets you link in several different ways
|
126
|
+
|
127
|
+
* To an internal page
|
128
|
+
* To an external page
|
129
|
+
* To an email address
|
130
|
+
* To a resource you've uploaded in the Resources tab.
|
131
|
+
|
132
|
+
## Insert Image dialog
|
133
|
+
|
134
|
+
Simply lets you select from an existing image found in the Images tab or upload a new one right within the dialog.
|
135
|
+
|
136
|
+
## Refinery Default Pages
|
137
|
+
|
138
|
+
Some pages you have to keep in order for Refinery to fully function.
|
139
|
+
|
140
|
+
* Page not found - the default 404 page, it's hidden from the navigation
|
141
|
+
* Down for maintenance - renders when you're site is being updated.
|
@@ -4,4 +4,4 @@ Refinery::Plugin.register do |plugin|
|
|
4
4
|
plugin.version = 1.0
|
5
5
|
plugin.menu_match = /admin\/((pages)|(page_dialogs)|(page_parts))$/
|
6
6
|
plugin.activity = {:class => Page, :url_prefix => "edit_", :title => "title", :created_image => "page_add.png", :updated_image => "page_edit.png"}
|
7
|
-
end
|
7
|
+
end
|
@@ -20,6 +20,7 @@
|
|
20
20
|
<% end %>
|
21
21
|
<% end %>
|
22
22
|
<script type='text/javascript'>jQuery.noConflict();</script>
|
23
|
+
<%= javascript_include_tag 'admin' %>
|
23
24
|
<%= javascript_include_tag 'refinery/prototype.enhancements.js', 'fastinit', 'refinery/tooltips', 'livepipe', 'tabs', 'thickbox', "wymeditor/jquery.refinery.wymeditor.js", 'refinery/boot_wym', 'refinery/admin', :cache => (use_caching ? "cache/admin" : false) %>
|
24
25
|
<%= "<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>" if RefinerySetting.find_or_set(:show_firebug_lite, false) == true -%>
|
25
26
|
<%= "<script type='text/javascript'>jQuery(document).ready(function(){ jQuery('#flash').fadeIn(550); });</script>" unless flash.empty? -%>
|
@@ -1,21 +1,8 @@
|
|
1
|
-
<% setup # sets up any meta tags and page title -%>
|
2
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
2
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
4
|
-
|
5
|
-
<title>
|
6
|
-
<%= yield :title %> - <%= RefinerySetting.find_or_set(:site_name, "Company Name") %>
|
7
|
-
</title>
|
8
|
-
<%= render :partial => 'shared/google_analytics' unless local_request? %>
|
9
|
-
<%= stylesheet_link_tag 'application' %>
|
10
|
-
<%= stylesheet_link_tag 'formatting', 'theme' %>
|
11
|
-
<%= stylesheet_link_tag 'home' if @page.home? %>
|
12
|
-
<!--[if IE 7]><%= stylesheet_link_tag 'ie7' %><![endif]-->
|
13
|
-
<link rel="shortcut icon" href="/favicon.ico" />
|
14
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
15
|
-
<%= yield :head %>
|
16
|
-
</head>
|
3
|
+
<%= render :partial => "/shared/head" %>
|
17
4
|
<body>
|
18
|
-
<%= render :partial => "/shared/ie6check" if request.env['HTTP_USER_AGENT'] =~ /MSIE/
|
5
|
+
<%= render :partial => "/shared/ie6check" if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
|
19
6
|
<div id='page_container'>
|
20
7
|
<div id='page' class='clearfix'>
|
21
8
|
<div id='header' class='clearfix'>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% theme ||= false -%>
|
2
|
+
<head>
|
3
|
+
<title><%= browser_title(yield(:title)) %></title>
|
4
|
+
<%= render :partial => 'shared/google_analytics' unless local_request? %>
|
5
|
+
<%= stylesheet_link_tag "#{'theme/' if theme}application", "#{'theme/' if theme}formatting", "theme" %>
|
6
|
+
<%= stylesheet_link_tag "#{'theme/' if theme}home" if home_page? %>
|
7
|
+
<%= "<!--[if IE 7]>#{stylesheet_link_tag 'ie7'}<![endif]-->" if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
|
8
|
+
<link rel="shortcut icon" href="/favicon.ico" />
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<%= "<meta name=\"keywords\" content=\"#{@meta.meta_keywords}\" />" if @meta.meta_keywords.present? %>
|
11
|
+
<%= "<meta name=\"description\" content=\"#{@meta.meta_description}\" />" if @meta.meta_description.present? -%>
|
12
|
+
<%= yield :head %>
|
13
|
+
</head>
|
@@ -1,18 +1,7 @@
|
|
1
|
-
<%
|
2
|
-
cache(:action_suffix => "site_menu") do
|
3
|
-
# cache important lookups
|
4
|
-
hide_children = RefinerySetting.find_or_set(:menu_hide_children, false)
|
5
|
-
siblings = nil # all pages in the top level menu have the same siblings, basically.
|
6
|
-
%>
|
1
|
+
<% cache(:action_suffix => "site_menu") do %>
|
7
2
|
<ul id='<%= dom_id ||= "menu" %>' class='menu clearfix'>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
:position => @menu_pages.index(page),
|
12
|
-
:root => true,
|
13
|
-
:siblings => ((siblings ||= page.shown_siblings) - [self]),
|
14
|
-
:hide_children => hide_children
|
15
|
-
} -%>
|
16
|
-
<% end -%>
|
3
|
+
<%= render :partial => "/shared/menu_branch", :collection => @menu_pages, :locals => {
|
4
|
+
:hide_children => RefinerySetting.find_or_set(:menu_hide_children, false)
|
5
|
+
} -%>
|
17
6
|
</ul>
|
18
7
|
<% end %>
|
@@ -1,28 +1,23 @@
|
|
1
|
-
<%# this is pretty bad code - need to rethink this one -%>
|
2
1
|
<%
|
3
2
|
css = []
|
4
|
-
css << "selected" if selected_page?(
|
5
|
-
css << "first" if
|
6
|
-
css << "last" if
|
7
|
-
domid = "#{
|
8
|
-
|
9
|
-
if page.in_menu?
|
3
|
+
css << "selected" if selected_page?(menu_branch) or descendant_page_selected?(menu_branch)
|
4
|
+
css << "first" if menu_branch_counter == 0
|
5
|
+
css << "last" if menu_branch_counter == menu_branch.shown_siblings.size
|
6
|
+
domid = "item_#{menu_branch_counter}" unless menu_branch.parent_id.present? or menu_branch.title.blank?
|
10
7
|
-%>
|
11
|
-
|
12
|
-
<%=
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
</li>
|
28
|
-
<% end -%>
|
8
|
+
<% if menu_branch.in_menu? %>
|
9
|
+
<li<%= " class='#{css.join(' ')}'" if css.present? -%><%= " id='#{domid}'" if domid.present? -%>>
|
10
|
+
<%= link_to menu_branch.title, menu_branch.url %>
|
11
|
+
<%
|
12
|
+
unless hide_children or
|
13
|
+
menu_branch.parent_id.present? or
|
14
|
+
(children = menu_branch.children.collect{|c| c if c.in_menu? }.compact).empty?
|
15
|
+
-%>
|
16
|
+
<ul class='clearfix'>
|
17
|
+
<%= render :partial => "/shared/menu_branch",
|
18
|
+
:collection => children,
|
19
|
+
:locals => {:hide_children => hide_children} -%>
|
20
|
+
</ul>
|
21
|
+
<% end -%>
|
22
|
+
</li>
|
23
|
+
<% end -%>
|