Skip to content

Commit

Permalink
Change wording from template to theme
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Jun 23, 2010
1 parent b5edcdc commit 31baea1
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 46 deletions.
2 changes: 1 addition & 1 deletion app/controllers/mail_manager_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def add_template
end


@design_templates = [['--Select a Design Template--','']] + SiteTemplate.find_select_options(:all, :order => 'name',:conditions => 'template_type="mail"')
@design_templates = [['--Select a Mail Theme--','']] + SiteTemplate.find_select_options(:all, :order => 'name',:conditions => 'template_type="mail"')
@master_templates = [['--Select a Master Template--','']] + MailTemplate.find_select_options(:all,:order => 'name',:conditions => 'master = 1')

end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/options_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def index
[ "Website Configuration", :editor_site_management, "website_configuration.gif",
{ :controller => '/options', :action => 'configuration' }, "Presents various site-wide configuration options that can be set up. Configure System Languages."
],
[ "Design Templates", :editor_design_templates, "design_templates.gif",
[ "Themes", :editor_design_templates, "design_templates.gif",
{ :controller => '/templates' },
"Create, Select and Edit site design templates. Design templates control the look of your site."
"Create, Select and Edit site themes. Themes control the look of your site."
],
[ "Module Setup", :editor_site_management, 'module_setup.gif',
{ :controller => '/modules'},
Expand Down
39 changes: 21 additions & 18 deletions app/controllers/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class TemplatesController < CmsController # :nodoc: all

cms_admin_paths 'options',
'Options' => { :controller => 'options' },
"Design Templates" => { :controller => 'templates' },
"Site Features" => { :action => 'features' }
"Themes" => { :controller => 'templates' },
"Paragraph Themes" => { :action => 'features' }

include SiteNodeEngine::Controller

Expand Down Expand Up @@ -44,7 +44,7 @@ def type_options; SiteTemplate.template_type_select_options; end
def index
templates_table(false)

cms_page_path [ "Options" ], "Design Templates"
cms_page_path [ "Options" ], "Themes"

render :action => 'index'
end
Expand All @@ -66,18 +66,21 @@ def delete_template
def new
@site_template = SiteTemplate.new(params[:site_template])

cms_page_path ['Options','Design Templates'], 'Create Site Template'
cms_page_path ['Options','Themes'], 'Create a Theme'

if(request.post?)
if params[:path][0]
parent = SiteTemplate.find(params[:path][0])
@site_template.parent_id = parent.id
@site_template.domain_file_id = parent.domain_file_id
@site_template.template_html = parent.template_html
end
if @site_template.save
redirect_to :action => 'edit', :path => @site_template.id
return
if params[:commit]
if params[:path][0]
parent = SiteTemplate.find(params[:path][0])
@site_template.parent_id = parent.id
@site_template.domain_file_id = parent.domain_file_id
@site_template.template_html = parent.template_html
end
if @site_template.save
return redirect_to :action => 'edit', :path => @site_template.id
end
else
return redirect_to :action => 'index'
end
end
render :action => 'new'
Expand All @@ -96,7 +99,7 @@ def edit
if flash[:template_version_load]
@site_template.load_version(flash[:template_version_load])
end
cms_page_path ['Options','Design Templates'], [ 'Edit %s',nil,@site_template.name]
cms_page_path ['Options','Themes'], [ 'Edit %s',nil,@site_template.name]

if @display_view == 'advanced'
if @site_template.parent_id
Expand Down Expand Up @@ -232,7 +235,7 @@ def preview_css
[ :check,
hdr(:string,'site_features.name'),
hdr(:string,'site_features.category'),
:feature_type,
hdr(:string,:feature_type,:label => 'Paragraph Theme Type'),
hdr(:options,'site_template_id',:options => :site_template_names),
hdr(:date_range,'site_features.updated_at')
]
Expand Down Expand Up @@ -260,12 +263,12 @@ def display_features_table(display=true)
end

def features
cms_page_path [ "Options", "Design Templates" ], "Site Features"
cms_page_path [ "Options", "Themes" ], "Paragraph Themes"
display_features_table @tbl
end

def new_feature
cms_page_path [ "Options", "Design Templates", "Site Features"], "Create a feature"
cms_page_path [ "Options", "Themes", "Paragraph Themes"], "Create a feature"
@feature = SiteFeature.new
@features = ParagraphRenderer.get_editor_features + ParagraphRenderer.get_component_features + ContentPublication.get_publication_features

Expand Down Expand Up @@ -300,7 +303,7 @@ def feature(popup=false,data={})
end


cms_page_path [ "Options", "Design Templates", "Site Features"], [ '"%s" Feature', nil, @feature.name ]
cms_page_path [ "Options", "Themes", "Paragraph Themes"], [ '"%s" Paragraph Theme', nil, @feature.name ]

details = @feature.feature_details
# [ Human Name, feature_name, Renderer, Publication ]
Expand Down
4 changes: 2 additions & 2 deletions app/models/site_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SiteTemplate < DomainModel

track_editor_changes

has_options :template_type, [ ['Site Template','site'], ['Mail Template','mail'] ]
has_options :template_type, [ ['Site Theme','site'], ['Mail Theme','mail'] ]
serialize :options

def self.site_template_options
Expand Down Expand Up @@ -72,7 +72,7 @@ def initialize


def self.create_default_template
SiteTemplate.create(:name => 'Default Template'.t,:template_html => "<cms:zone name='Main'/>") unless SiteTemplate.find(:first)
SiteTemplate.create(:name => 'Default Theme'.t,:template_html => "<cms:zone name='Main'/>") unless SiteTemplate.find(:first)
end

# Override domain file setting so we can
Expand Down
5 changes: 4 additions & 1 deletion app/models/site_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
class SiteVersion < DomainModel


validates_presence_of :name


has_many :site_nodes,:order => 'lft', :dependent => :destroy

# Returns the default site Version (or creates one automatically)
def self.default
self.find(:first,:order => 'id') || self.create(:name => 'Default')
self.find(:first,:order => 'id') || self.create(:name => 'Main Tree'.t)
end

def self.current(force=false)
Expand Down
4 changes: 2 additions & 2 deletions app/views/mail_manager/add_template.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<%= f.radio_buttons :template_type, MailTemplate.template_type_select_options, :vertical => true %>
<%= f.radio_buttons :language, Configuration.languages, :vertical => true if Configuration.languages.length > 1 %>
<%= f.text_field :category, :vertical => true %>
<%= f.radio_buttons :create_type, [ ['New Blank Mail Template','blank'],['Build from Design Template','design'] ],
<%= f.radio_buttons :create_type, [ ['New Blank Mail Template','blank'],['Build from a Theme','design'] ],
:separator => '<br/>', :vertical => true, :onclick => 'updateOptions();', :required => true %>
</tbody>
<tbody id='site_template_select' <%= "style='display:none;'" unless @mail_template.create_type == 'design' %>>
<%= f.select :site_template_id, @design_templates, :label => 'Design Template', :vertical => true, :required => true %>
<%= f.select :site_template_id, @design_templates, :label => 'Mail Theme', :vertical => true, :required => true %>
</tbody>
<tbody id='master_template_select' <%= "style='display:none;'" unless @mail_template.create_type == 'master' %>>
<%= f.select :master_template_id, @master_templates, :label => 'Master Template', :vertical => true, :required => true %>
Expand Down
5 changes: 3 additions & 2 deletions app/views/mail_manager/edit_template.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@
addContent: function(content) {
this.triggerContent();
$('mail_template_body_html').value += "<br/>" + content;
$('template_html_iframe').contentWindow.tinyMCE.setContent($('mail_template_body_html').value);
$('template_html_iframe').contentWindow.tinyMCE.selectedInstance.resizeToContent();
tinyMCE.get
$('template_html_iframe').contentWindow.tinyMCE.get('template_body_html').setContent($('mail_template_body_html').value);
//$('template_html_iframe').contentWindow.tinyMCE.get('template_body_html').resizeToContent();
}


Expand Down
2 changes: 2 additions & 0 deletions app/views/structure/_site_version.rhtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

<div class='cms_form'>
<div align='right'>
<% if @version.id %>
<% if @version.can_delete? %>
<a href='javascript:void(0);' onclick='StructureEditor.deleteVersion(<%= @version.id %>);'>Delete Tree</a>
<% else %>
Cannot delete an active tree
<% end -%>
<% end -%>
</div>
<h2><%= @version.id ? "Edit Site Tree" : "Create New Site Tree" %></h2>
<% admin_form_for :version, @version, :html => { :onsubmit => "SCMS.updateOverlay('#{url_for :action => 'site_version',:site_version => @version.id}',Form.serialize(this)); return false;" } do |f| %>
Expand Down
8 changes: 4 additions & 4 deletions app/views/structure/_template_modifier_info.rhtml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<% if @updated -%>
<div class='flash_notice'>
<%= "Template Information Saved".t -%>
<%= "Theme Information Saved".t -%>
</div>
<% end -%>

<b> <%= "Template Modifier".t %> </b>
<b> <%= "Theme Modifier".t %> </b>
<% if @frm.template_id %>
(<a href='<%= url_for :controller => '/templates', :action => 'edit', :path => @frm.template_id %>'><%= "Edit Template".t %></a>)<br/>
(<a href='<%= url_for :controller => '/templates', :action => 'edit', :path => @frm.template_id %>'><%= "Edit Theme".t %></a>)<br/>
<% end -%>
</div>
<br/>
Expand All @@ -16,7 +16,7 @@
:url => { :action => 'element_info', :node_type => 'mod', :node_id => @mod.id },
:html => { :class => 'admin_form' } do |f| -%>
<%= f.radio_buttons :template_id, @site_templates.collect { |tpl| [ tpl.name, tpl.id ] }, :label => 'Selected Template' ,:default => 'None', :vertical => 'true', :separator => '<br/>' %>
<%= f.radio_buttons :template_id, @site_templates.collect { |tpl| [ tpl.name, tpl.id ] }, :label => 'Selected Theme' ,:default => 'None', :vertical => 'true', :separator => '<br/>' %>
<%= f.radio_buttons :clear_frameworks, [ ['Yes'.t,'yes'], ['No'.t,'no' ] ], :label => 'Clear Framework Elements' ,:default => 'No', :vertical => 'true', :separator => '&nbsp;' %>
<%= f.submit_tag 'Submit' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/structure/view.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if @show_archived == 'hide'
<div class='add_node_group'>
<div class='add_node_header'><%= "Modifiers".t %> <i><%= "(drag to add)".t %></i></div>
<div class='add_nodes' id='add_modifiers'>
<div class='add_mod_elem' id='add_template' > <a href='javascript:void(0);' title='<%= vh "Change the page style of an element".t %>' > <%= image_tag theme_src('icons/template.gif') %> <%= "Template".t %></a></div>
<div class='add_mod_elem' id='add_template' > <a href='javascript:void(0);' title='<%= vh "Change the page style of an element".t %>' > <%= image_tag theme_src('icons/template.gif') %> <%= "Theme".t %></a></div>
<div class='add_mod_elem' id='add_framework' ><a href='javascript:void(0);' title='<%= vh "Add page elements that will appear on multiple pages".t %>'> <%= image_tag theme_src('icons/framework.gif') %> <%= "Framework".t %></a></div>
<div class='add_mod_elem' id='add_lock' ><a href='javascript:void(0);' title='<%= vh "Control who is allowed to view page".t %>'> <%= image_tag theme_src('icons/lock.gif') %> <%= "Add Lock".t %></a></div>
<div class='add_mod_elem' id='add_ssl' ><a href='javascript:void(0);' title='<%= vh "Page is protected via SSL ".t %>'> <%= image_tag theme_src('icons/ssl.gif') %> <%= "Add SSL".t %></a></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/templates/_features_table.rhtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% active_table_for :features_table, @tbl,
:actions => [ ['Duplicate','duplicate' ],
['Delete','delete','Delete the selected features?' ]] do |t| -%>
['Delete','delete','Delete the selected paragraph themes?' ]] do |t| -%>
<tr <%= highlight_row 'feature', t.id %>>
<td><%= entry_checkbox 'feature',t.id %></td>
<td><%= link_to v(t.name), :action => 'feature', :path => [ t.id ] %></td>
Expand Down
8 changes: 4 additions & 4 deletions app/views/templates/feature.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ Event.observe(document.onresize ? document : window, "resize",FeatureEditor.kill
</label>
</div>
</div>
<% ajax_tabs ['Options','Feature',['CSS','FeatureEditor.activateCss();']], 'Feature' do |t| -%>
<% ajax_tabs ['Options','Theme',['CSS','FeatureEditor.activateCss();']], 'Theme' do |t| -%>
<% t.tab do -%>
<div class='admin_content' id='feature_options'>
<% admin_fields_for :feature, @feature do |f| -%>
<%= f.text_field :category, :size => 30 %>
<%= f.text_field :description,:size => 80 %>
<%= f.custom_field :feature_type, :value => @feature.feature_type %>
<%= f.select :site_template_id, [['--Available in all Site Templates--',nil]] + SiteTemplate.select_options(:conditions => { :template_type => 'site', :parent_id => nil}) %>
<%= f.filemanager_folder :image_folder_id,:description => 'Overrides site template folder (if a site template is selected)' %>
<%= f.custom_field :feature_type, :value => @feature.feature_type, :label => 'Paragraph Theme Type' %>
<%= f.select :site_template_id, [['--Available in all Site Templates--',nil]] + SiteTemplate.select_options(:conditions => { :template_type => 'site', :parent_id => nil}), :label => 'Site Theme' %>
<%= f.filemanager_folder :image_folder_id,:description => 'Overrides site theme folder (if a site theme is selected)' %>
<% end -%>
</div>
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/templates/features.rhtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% action_panel do |p| -%>
<%= p.link 'Add a new Feature', :action => 'new_feature' ,:icon => 'add.gif' %>
<%= p.link 'Add a new Paragraph Theme', :action => 'new_feature' ,:icon => 'add.gif' %>
<% end -%>

<hr/>
Expand Down
10 changes: 5 additions & 5 deletions app/views/templates/index.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ TemplateList = {
popup: function(tid,parent_id) {
var opts = new Array();
if(!parent_id) {
opts.push(['Create Child Template','<%= url_for :action => "new" %>/' + tid ]);
opts.push(['Create Child Theme','<%= url_for :action => "new" %>/' + tid ]);
}
opts.push(['Delete Template','js','TemplateList.deleteTemplate(' + tid + ')']);
opts.push(['Delete Theme','js','TemplateList.deleteTemplate(' + tid + ')']);

SCMS.popup(opts);
},

deleteTemplate: function(tid) {
if(confirm('Are you sure you want to delete this template? This template will be removed from and pages it is on.')) {
if(confirm('Are you sure you want to delete this theme? This theme will be removed from and pages it is on.')) {
new Ajax.Updater('templates_table',
"<%= url_for :action => 'delete_template' %>/" + tid);
}
Expand All @@ -23,8 +23,8 @@ TemplateList = {
}
</script>
<% action_panel do |p| -%>
<%= p.link 'Add a Blank Template', :action => 'new', :icon => 'add.gif' %>
<%= p.link 'View Site Features',:action => 'features', :icon => 'view.gif' %>
<%= p.link 'Add a Blank Theme', :action => 'new', :icon => 'add.gif' %>
<%= p.link 'View Paragraph Themes',:action => 'features', :icon => 'view.gif' %>
<% end -%>

<hr/>
Expand Down
4 changes: 2 additions & 2 deletions app/views/templates/new.rhtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class='admin_content'>
<% tabled_form_for :site_template, @site_template, :html => {:class => 'admin_form'} do |f| -%>
<%= f.text_field :name, :label => 'Template Name' %>
<%= f.text_field :name, :label => 'Name' %>
<%= f.radio_buttons :template_type, SiteTemplate.template_type_select_options %>
<%= f.text_area :description %>
<%= f.submit_cancel_tags 'Create','Cancel',{}, :onclick => "document.location='#{ url_for :action => "index"}'; return false;" %>
<%= f.cancel_submit_buttons 'Cancel','Submit' %>
<% end -%>
</div>

0 comments on commit 31baea1

Please sign in to comment.