respond_to do |format|
format.html # index.html.erb
format.json { render text: Panel.list_as_json_text(@panels) }
+ format.atom
+ format.rss { render :layout => false }
end
end
{:include => {:speech_balloon => {:include => {:panel => {:include => {:author => {} }}, :speeches => {}, :speech_balloon_template => {} }}}}
end
+ def scenario
+ if caption.blank?
+ ''
+ else
+ '<p>' + ERB::Util.html_escape(self.caption) + '</p>'
+ end
+ end
+
+ def plain_scenario
+ if caption.blank?
+ ''
+ else
+ self.caption + "\n"
+ end
+ end
+
end
{:include => {:panel => {:include => {:author => {}}}, :color => {} }}
end
+ def scenario
+ ''
+ end
+
end
{:include => {:panel => {:include => {:author => {}}}, :picture => {:include => {:artist => {}, :license => {}}} }}
end
+ def scenario
+ ''
+ end
+
end
'[' + ary.map {|i| i.panel_elements_as_json }.join(',') + ']'
end
+ def scenario
+ panel_elements.map { |e|
+ e.scenario
+ }.join
+ end
+
+ def plain_scenario
+ panel_elements.map { |e|
+ e.plain_scenario
+ }.join
+ end
+
def licensed_pictures
r = {}
((self.panel_pictures || []) + (self.ground_pictures || [])).compact.each do |elm|
{:include => {:panel => {:include => {:author => {}}} }}
end
+ def scenario
+ ''
+ end
+
end
{:include => {:panel => {:include => {:author => {}}}, :picture => {:include => {:artist => {}, :license => {}}} }}
end
+ def scenario
+ if caption.blank?
+ ''
+ else
+ '<p>' + ERB::Util.html_escape(self.caption) + '</p>'
+ end
+ end
+
+ def plain_scenario
+ if caption.blank?
+ ''
+ else
+ self.caption + "\n"
+ end
+ end
+
end
{:include => {:speech_balloon => {:include => {:panel => {:include => {:author => {} }}, :balloons => {}, :speech_balloon_template => {} }}}}
end
+ def scenario
+ if content.blank?
+ ''
+ else
+ '<p>' + ERB::Util.html_escape(self.content) + '</p>'
+ end
+ end
+
+ def plain_scenario
+ if content.blank?
+ ''
+ else
+ self.content + "\n"
+ end
+ end
+
end
{:include => {:panel => {:include => {:author => {} }}, :balloons => {}, :speeches => {}, :speech_balloon_template => {} }}
end
+ def scenario
+ balloons.first.scenario.to_s +
+ speeches.map {|s| s.scenario }.join
+ end
+
+ def plain_scenario
+ balloons.first.plain_scenario.to_s +
+ speeches.map {|s| s.plain_scenario }.join
+ end
+
end
--- /dev/null
+atom_feed(
+ :language => 'ja-JP',
+ :root_url => root_url,
+ :url => root_url(:format => :atom),
+ :id => root_url
+) do |feed|
+ feed.title MagicNumber['profile']['users']['caption']
+ feed.subtitle sanitize(MagicNumber['profile']['users']['description'], :tags => %w(a p img br))
+ feed.updated Time.now
+ feed.author {|author| author.name(MagicNumber['profile']['web_master'])}
+
+ @panels.each do |panel|
+ feed.entry(
+ panel,
+ :url => panel_url(panel),
+ :id => panel_url(panel),
+ :published => panel.updated_at,
+ :updated => panel.updated_at
+ ) do |item|
+ item.title(panel.caption)
+ item.content(panel.scenario, :type => 'html')
+ item.author {|author| author.name(panel.author.name)}
+ end
+ end
+end
<%= render 'standard', :panel => panel, :author => @author %>
<% end %>
<%= link_to t('panels.new.title'), new_panel_path %>
+<noscript>
+ <% @panels.each do |panel| %>
+ <%= raw panel.scenario %>
+ <% end %>
+</noscript>
--- /dev/null
+xml.instruct!
+
+xml.rss("version" => "2.0",
+ "xmlns:dc" => "http://purl.org/dc/elements/1.1/",
+ "xmlns:atom" => "http://www.w3.org/2005/Atom") do
+ xml.channel do
+ xml.title MagicNumber['profile']['users']['caption']
+ xml.link root_url
+ xml.pubDate Time.now.rfc822
+ xml.description sanitize(MagicNumber['profile']['users']['description'], :tags => %w(a p img br))
+ xml.atom :link, "href" => @rss_url, "rel" => "self", "type" => "application/rss+xml"
+
+ @panels.each do |panel|
+ xml.item do
+ xml.title panel.caption
+ xml.link panel_url(panel)
+ xml.guid panel_url(panel)
+ xml.description panel.plain_scenario
+ xml.pubDate panel.updated_at.to_formatted_s(:rfc822)
+ xml.dc :creator, panel.author.name
+ end
+ end
+ end
+end
{
"admin@mail.address": {
+ "web_master": "yas",
"users": {
"caption": "site name",
"url": "http://your.site.url/",
--- /dev/null
+class AddCaptionOnPanels < ActiveRecord::Migration
+ def up
+ add_column :panels, :caption, :string
+ end
+
+ def down
+ remove_column :panels, :caption
+ end
+end
+++ /dev/null
----
-error.png: error.png
-folder_album.png: folder_album.png
-folder_general.png: folder_general.png
-grid.gif: grid.gif
-loading.gif: loading.gif
-opacity0.gif: opacity0.gif
-rails.png: rails.png
-sprite.gif: sprite.gif
-application.js: application.js
-application.css: application.css