Skip to content
Browse files

Replaced template cms_text_area tags with cms_template_editor tags in…

… Portlet forms. Added method to portlets to enable/disable. Fixed syntax for auto_discovery tags
  • Loading branch information...
1 parent fd9ed4c commit bf580a44447d66a3348dc908f069cf27dba1d3ad @crh3675 crh3675 committed
View
3 app/portlets/news_archive_portlet.rb
@@ -1,5 +1,8 @@
class NewsArchivePortlet < Portlet
+ # Mark this as 'true' to allow the portlet's template to be editable via the CMS admin UI.
+ enable_template_editor false
+
def render
if self.category_id.blank?
@articles = NewsArticle.all(:order => "release_date desc", :limit => self.limit)
View
3 app/portlets/news_article_portlet.rb
@@ -1,4 +1,7 @@
class NewsArticlePortlet < Portlet
+
+ # Mark this as 'true' to allow the portlet's template to be editable via the CMS admin UI.
+ enable_template_editor false
def render
# @news_article should already be set by the page route
View
3 app/portlets/recent_news_portlet.rb
@@ -1,4 +1,7 @@
class RecentNewsPortlet < Portlet
+
+ # Mark this as 'true' to allow the portlet's template to be editable via the CMS admin UI.
+ enable_template_editor false
def render
order = "release_date DESC"
View
2 app/views/portlets/news_archive/_form.html.erb
@@ -1,3 +1,3 @@
<%= f.cms_text_field :name %>
<%= f.cms_drop_down :category_id, categories_for('News Article').map{|c| [c.path, c.id]}, { :selected=>f.object.category_id.to_i, :include_blank=>"Show News Articles in any Category", :instructions=>"Select a category to show News Articles from only that category." } %>
-<%= f.cms_text_area :template, :default_value => @block.class.default_template %>
+<%= f.cms_template_editor :template %>
View
2 app/views/portlets/news_archive/render.html.erb
@@ -1,5 +1,5 @@
<% content_for :html_head do %>
- <%= auto_discovery_link_tag :rss, news_articles_url, "RSS Feed for News Articles" %>
+ <%= auto_discovery_link_tag( :rss, news_articles_url, {:title => "RSS Feed for News Articles"}) %>
<% end %>
<div>
<% @articles.group_by(&:year).sort_by(&:first).reverse.each do |year, year_articles| %>
View
2 app/views/portlets/news_article/_form.html.erb
@@ -1,2 +1,2 @@
<%= f.cms_text_field :name %>
-<%= f.cms_text_area :template, :default_value => @block.class.default_template %>
+<%= f.cms_template_editor :template %>
View
2 app/views/portlets/recent_news/_form.html.erb
@@ -4,4 +4,4 @@
<%= f.cms_drop_down :sort_order, %w(asc desc).collect { |field| ["#{field.titleize}ending", field.upcase] } %>
<%= f.cms_drop_down :category_id, categories_for('News Article').map{|c| [c.path, c.id]}, {:selected=>f.object.category_id.to_i, :include_blank=>"Show News Articles in any Category", :instructions=>"Select a category to show News Articles from only that category." } %>
<%= f.cms_text_field :more_link %>
-<%= f.cms_text_area :template, :default_value => @block.class.default_template %>
+<%= f.cms_template_editor :template %>
View
2 app/views/portlets/recent_news/render.html.erb
@@ -1,5 +1,5 @@
<% content_for :html_head do %>
- <%= auto_discovery_link_tag :rss, news_articles_url, "RSS Feed for News Articles" %>
+ <%= auto_discovery_link_tag( :rss, news_articles_url, {:title => "RSS Feed for News Articles" }) %>
<% end %>
<b>Latest News</b>
<br/>

0 comments on commit bf580a4

Please sign in to comment.
Something went wrong with that request. Please try again.