From 3b695342f170cafcc457f8042056fc8eb73bc0f2 Mon Sep 17 00:00:00 2001
From: yasushiito
+ <%= f.text_area :description %>
+
<%= f.collection_select :visible, t_select_items(MagicNumber['comic_visible_items']), :last, :first, :html => {:selected => @comic.visible} %>
+
diff --git a/app/views/comics/index.atom.builder b/app/views/comics/index.atom.builder
index ddf8c879..a1e9b0c0 100644
--- a/app/views/comics/index.atom.builder
+++ b/app/views/comics/index.atom.builder
@@ -18,7 +18,7 @@ atom_feed(
:updated => comic.updated_at
) do |item|
item.title(comic.title)
- item.content(comic.title, :type => 'html')
+ item.content(comic.description, :type => 'html')
item.author {|author| author.name(comic.author.name)}
end
end
diff --git a/app/views/comics/index.rss.builder b/app/views/comics/index.rss.builder
index abbf1c33..b319a9d0 100644
--- a/app/views/comics/index.rss.builder
+++ b/app/views/comics/index.rss.builder
@@ -15,7 +15,7 @@ xml.rss("version" => "2.0",
xml.title comic.title
xml.link comic_url(comic)
xml.guid comic_url(comic)
- xml.description comic.title
+ xml.description comic.description
xml.pubDate comic.updated_at.to_formatted_s(:rfc822)
xml.dc :creator, comic.author.name
end
diff --git a/app/views/comics/show.html.erb b/app/views/comics/show.html.erb
index fee9107e..81a1bbf3 100644
--- a/app/views/comics/show.html.erb
+++ b/app/views/comics/show.html.erb
@@ -8,6 +8,11 @@
+ <%= h(truncate(comic.description, :length => 40)) %>
+
+
+ <%= t_m 'Comic.description' -%>: + <%= h(@comic.description) %> +
+ +<%= t_m 'Comic.visible' -%>: <%= t_selected_item('comic_visible_items', @comic.visible) %>
diff --git a/app/views/panels/_standard.html.erb b/app/views/panels/_standard.html.erb index 02c0dfdf..a67b70aa 100644 --- a/app/views/panels/_standard.html.erb +++ b/app/views/panels/_standard.html.erb @@ -1,3 +1,5 @@ +<%= t_m 'Panel.caption' -%>: +<%= h(panel.caption) %> <%= render 'panels/body', :panel => panel, :author => author %> <%= render 'panels/footer', :panel => panel, :author => author %> <%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %> diff --git a/app/views/panels/index.html.erb b/app/views/panels/index.html.erb index 9f511b9b..0f61452a 100644 --- a/app/views/panels/index.html.erb +++ b/app/views/panels/index.html.erb @@ -3,8 +3,3 @@ <%= render 'standard', :panel => panel, :author => @author %> <% end %> <%= link_to t('panels.new.title'), new_panel_path %> - diff --git a/config/locales/pettanr.ja.yml b/config/locales/pettanr.ja.yml index ee9fc453..e5006a65 100644 --- a/config/locales/pettanr.ja.yml +++ b/config/locales/pettanr.ja.yml @@ -70,6 +70,7 @@ ja: authentication_token: èªè¨¼ãã¼ã¯ã³ comic: title: ã¿ã¤ãã« + description: ãããã visible: å ¬é author_id: ä½å®¶ created_at: æ´æ° @@ -88,6 +89,7 @@ ja: x: X y: Y z: éãªã + caption: è¦ç´ publish: å ¬é author_id: ä½å®¶ panel_picture: diff --git a/db/migrate/20130504004559_add_description_on_comics.rb b/db/migrate/20130504004559_add_description_on_comics.rb new file mode 100644 index 00000000..73920f5e --- /dev/null +++ b/db/migrate/20130504004559_add_description_on_comics.rb @@ -0,0 +1,9 @@ +class AddDescriptionOnComics < ActiveRecord::Migration + def up + add_column :comics, :description, :string + end + + def down + remove_column :comics, :description + end +end diff --git a/spec/factories.rb b/spec/factories.rb index 3dba65e8..e5967d74 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -69,6 +69,7 @@ FactoryGirl.define do factory :comic, :class => Comic do |comic| comic.title "comic" + comic.description 'comic description' comic.visible 1 end @@ -196,6 +197,7 @@ FactoryGirl.define do panel.border 1 panel.width 100 panel.height 300 + panel.caption 'panel caption' panel.publish 1 panel.author_id 1 end diff --git a/spec/models/comic_spec.rb b/spec/models/comic_spec.rb index 64acd7e0..f9978aa7 100644 --- a/spec/models/comic_spec.rb +++ b/spec/models/comic_spec.rb @@ -74,6 +74,15 @@ describe Comic do }.should raise_error(Pettanr::BadRequest) end end + + context 'descriptionãæ¤è¨¼ããã¨ã' do + it 'Shift JISãªã失æãã' do + @comic.description = "\x83G\x83r\x83]\x83D" + lambda{ + @comic.valid_encode + }.should raise_error(Pettanr::BadRequest) + end + end end describe 'ããã©ã«ãå¤è£å ã«æ¼ãã¦' do diff --git a/spec/models/panel_spec.rb b/spec/models/panel_spec.rb index 9fa263d2..308bc3b4 100644 --- a/spec/models/panel_spec.rb +++ b/spec/models/panel_spec.rb @@ -171,6 +171,22 @@ describe Panel do end end + describe 'æåã³ã¼ãæ¤è¨¼ã«æ¼ãã¦' do + before do + @panel = FactoryGirl.build :panel, :author_id => @author.id + end + + context 'captionãæ¤è¨¼ããã¨ã' do + it 'Shift JISãªã失æãã' do + @panel.caption = "\x83G\x83r\x83]\x83D" + lambda{ + @panel.valid_encode + }.should raise_error(Pettanr::BadRequest) + end + end + + end + describe 'ããã©ã«ãå¤è£å ã«æ¼ãã¦' do before do @panel = FactoryGirl.build :panel, :author_id => @author.id -- 2.11.0