Skip to content

Commit

Permalink
Merge branch 'development' of git://github.com/cykod/Webiva into face…
Browse files Browse the repository at this point in the history
…book-connect
  • Loading branch information
Doug Youch committed Mar 18, 2010
2 parents 96150fc + 15c41f8 commit 6909350
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions app/controllers/structure_controller.rb
Expand Up @@ -50,6 +50,7 @@ def index
end

@wizard_list = get_handlers(:structure,:wizard) if myself.has_role?('editor_structure_advanced')
@wizard_list ||= []

cms_page_info 'Website', 'website',myself.has_role?('editor_structure_advanced') ? 'CMSStructure.popup();' : nil
render :action => 'view', :layout => "manage"
Expand All @@ -60,6 +61,7 @@ def wizards
cms_page_path ['Website'], "Wizards"

@wizard_list = get_handler_info(:structure,:wizard) if myself.has_role?('editor_structure_advanced')
@wizard_list ||= []
@wizard_list = @wizard_list.select { |info| myself.has_role?(info[:permit]) }

end
Expand Down
15 changes: 7 additions & 8 deletions vendor/modules/feed/app/controllers/feed/rss_renderer.rb
Expand Up @@ -49,12 +49,12 @@ def feed
feature :rss_feed_view, :default_feature => <<-FEATURE
<div class='rss_feed'>
<cms:feed>
<h2><a <cms:href/>><cms:title/></a></h2>
<h2><cms:link><cms:title/></cms:link></h2>
<cms:description/>
<cms:items>
<cms:item>
<div class='rss_feed_item'>
<h2><a <cms:href/>><cms:title/></a></h2>
<h3><cms:link><cms:title/></cms:link></h3>
<cms:content/>
</div>
</cms:item>
Expand All @@ -66,12 +66,12 @@ def feed
</div>
FEATURE

def rss_feed_view_feature(feature,data)
parser_context = FeatureContext.new do |c|
def rss_feed_view_feature(data)
webiva_feature(:rss_feed_view,data) do |c|
c.define_tag('feed') { |tag| data[:feed].blank? ? nil : tag.expand }
c.define_tag('no_feed') { |tag| data[:feed].blank? ? tag.expand : nil }

c.define_value_tag('feed:href') { |tag| "href='#{data[:feed].channel.link}'" }
c.define_link_tag('feed:') { |t| data[:feed].channel.link }
c.define_value_tag('feed:title') { |tag| data[:feed].channel.title }
c.define_value_tag('feed:description') { |tag|
data[:feed].channel.description
Expand Down Expand Up @@ -103,7 +103,7 @@ def rss_feed_view_feature(feature,data)
txt = tag.locals.item.description.to_s.sub(data[:read_more],"[<a href='#{tag.locals.item.link}'>Read More..</a>]")
end
}
c.define_value_tag('feed:items:item:href') { |tag| "href='#{tag.locals.item.link}'" }
c.define_link_tag('feed:items:item:') { |t| t.locals.item.link }
c.define_value_tag('feed:items:item:title') { |tag| tag.locals.item.title }
c.define_value_tag('feed:items:item:author') { |tag| tag.locals.item.author }
c.define_value_tag('feed:items:item:categories') { |tag| tag.locals.item.categories.map { |cat| cat.content }.join(", ") }
Expand All @@ -112,7 +112,6 @@ def rss_feed_view_feature(feature,data)

end

parse_feature(feature,parser_context)
end


Expand Down Expand Up @@ -144,7 +143,7 @@ def view_rss
end
data = { :feed => rss_feed, :items => options.items, :category => options.category, :read_more => options.read_more }

feature_output = rss_feed_view_feature(get_feature('rss_feed_view'),data)
feature_output = rss_feed_view_feature(data)
valid_until = Time.now + options.cache_minutes.to_i.minutes

DataCache.put_content('Feed',target_string,display_string,[ valid_until, feature_output ]) if !editor?
Expand Down

0 comments on commit 6909350

Please sign in to comment.