From d8a82884effe9d5f500400351164f1ce21c22f67 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Tue, 20 Nov 2012 07:45:10 +0900 Subject: [PATCH] t#30102:update i18n op rp au ar gc gp pc --- app/controllers/application_controller.rb | 5 ++ app/controllers/original_pictures_controller.rb | 2 +- app/models/original_picture.rb | 1 + app/models/resource_picture.rb | 6 +- app/views/artists/_form.html.erb | 3 - app/views/artists/browse.html.erb | 23 +++++- app/views/artists/edit.html.erb | 5 +- app/views/artists/index.html.erb | 26 +++---- app/views/artists/list.html.erb | 36 ++++----- app/views/artists/new.html.erb | 6 +- app/views/artists/show.html.erb | 18 ++++- app/views/authors/browse.html.erb | 34 +++------ app/views/authors/edit.html.erb | 2 +- app/views/authors/index.html.erb | 18 +++-- app/views/authors/list.html.erb | 38 ++++------ app/views/authors/show.html.erb | 17 ++++- app/views/balloons/index.html.erb | 32 -------- app/views/comics/browse.html.erb | 2 +- app/views/comics/list.html.erb | 6 +- app/views/ground_colors/index.html.erb | 28 +++---- app/views/ground_pictures/index.html.erb | 40 +++++----- app/views/home/configure.html.erb | 12 +++ app/views/layouts/system.html.erb | 50 ++++++++++--- app/views/layouts/test.html.erb | 18 +++-- app/views/original_pictures/browse.html.erb | 43 +++++------ app/views/original_pictures/index.html.erb | 59 ++++++++------- app/views/original_pictures/list.html.erb | 51 ++++++------- app/views/original_pictures/show.html.erb | 54 +++++++++----- app/views/panel_colors/index.html.erb | 28 +++---- app/views/pictures/browse.html.erb | 7 +- app/views/resource_pictures/browse.html.erb | 86 ++++++++++++++++++---- app/views/resource_pictures/index.html.erb | 32 ++++---- app/views/resource_pictures/list.html.erb | 70 ++++++++++-------- app/views/resource_pictures/show.html.erb | 53 +++++++++---- app/views/speeches/index.html.erb | 26 ------- config/locales/pettanr.ja.yml | 19 ++++- config/routes.rb | 2 +- .../original_pictures_controller_spec.rb | 2 +- spec/models/original_picture_spec.rb | 9 ++- 39 files changed, 556 insertions(+), 413 deletions(-) delete mode 100644 app/views/balloons/index.html.erb delete mode 100644 app/views/speeches/index.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 970bb9d4..fc35d3f1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -22,6 +22,11 @@ class ApplicationController < ActionController::Base nil end end + @admin = if admin_signed_in? + current_admin + else + nil + end end end diff --git a/app/controllers/original_pictures_controller.rb b/app/controllers/original_pictures_controller.rb index e322b6c5..5f053a95 100644 --- a/app/controllers/original_pictures_controller.rb +++ b/app/controllers/original_pictures_controller.rb @@ -21,7 +21,7 @@ class OriginalPicturesController < ApplicationController # GET /original_pictures/1 # GET /original_pictures/1.json def show - @original_picture = OriginalPicture.show(params[:id], @artist) + @original_picture = OriginalPicture.show(params[:id], @admin || @artist) respond_to do |format| opt = {:type => @original_picture.mime_type, :disposition=>"inline"} diff --git a/app/models/original_picture.rb b/app/models/original_picture.rb index 10bb0979..9a435ee3 100644 --- a/app/models/original_picture.rb +++ b/app/models/original_picture.rb @@ -31,6 +31,7 @@ class OriginalPicture < ActiveRecord::Base end def visible? ar + return true if ar.is_a?(Admin) self.own?(ar) end diff --git a/app/models/resource_picture.rb b/app/models/resource_picture.rb index 8b5bf5fb..d22162e5 100644 --- a/app/models/resource_picture.rb +++ b/app/models/resource_picture.rb @@ -69,11 +69,15 @@ class ResourcePicture < ActiveRecord::Base ResourcePicture.resize(rimg.to_blob, tw, th).to_blob end - def opt_img_tag + def tmb_opt_img_tag tw, th = PettanImager.thumbnail_size(self.width, self.height) {:src => self.url, :width => tw, :height => th} end + def opt_img_tag + {:src => self.url('full'), :width => self.width, :height => self.height} + end + def self.default_page_size 25 end diff --git a/app/views/artists/_form.html.erb b/app/views/artists/_form.html.erb index b91ef8a8..74802c09 100644 --- a/app/views/artists/_form.html.erb +++ b/app/views/artists/_form.html.erb @@ -1,6 +1,3 @@ -

素材の投稿には絵師登録が必要です。

-

下記フォームで登録してください。

- <%= form_for(@artist) do |f| %> <% if @artist.errors.any? %>
diff --git a/app/views/artists/browse.html.erb b/app/views/artists/browse.html.erb index aed21d2a..7cf62b3c 100644 --- a/app/views/artists/browse.html.erb +++ b/app/views/artists/browse.html.erb @@ -1,5 +1,24 @@ +

<%= t '.title' -%>

<%= notice %>

-投稿された素材 +

+ <%= t_m 'Artist.id' -%>: + <%= h @artist.id %> +

-<%= link_to 'Back', :action => :list %> +

+ <%= t_m 'Artist.name' -%>: + <%= h @artist.name %> +

+ +

+ <%= t_m 'Artist.created_at' -%>: + <%= l @artist.created_at %> +

+ +

+ <%= t_m 'Artist.updated_at' -%>: + <%= l @artist.updated_at %> +

+ +<%= link_to t('link.back'), :action => :list %> diff --git a/app/views/artists/edit.html.erb b/app/views/artists/edit.html.erb index 0ca9f859..21e86b7e 100644 --- a/app/views/artists/edit.html.erb +++ b/app/views/artists/edit.html.erb @@ -1,6 +1,7 @@ -

Editing artist

+

<%= t '.title' -%>

+

<%= notice %>

<%= render 'form' %> - +configure <%= link_to 'Show', @artist %> | <%= link_to 'Back', artists_path %> diff --git a/app/views/artists/index.html.erb b/app/views/artists/index.html.erb index 760580b8..7d640611 100644 --- a/app/views/artists/index.html.erb +++ b/app/views/artists/index.html.erb @@ -1,21 +1,17 @@ -

Listing artists

+

<%= t '.title' -%>

- - - + + + -<% @artists.each do |artist| %> - - - - - -<% end %> + <% @artists.each do |artist| %> + + + + + + <% end %>
authorname<%= t_m 'Artist.name' -%><%= t_m 'Artist.created_at' -%><%= t_m 'Artist.updated_at' -%>
<%= artist.author_id %><%= h artist.name %><%= link_to 'Show', artist %>
<%= link_to h(truncate(artist.name, :length => 12)), artist_path(artist) %><%= distance_of_time_in_words_to_now artist.created_at %><%= distance_of_time_in_words_to_now artist.updated_at %>
-<%= link_to 'artist register', new_artist_path, :remote => true %> -
-reg -
diff --git a/app/views/artists/list.html.erb b/app/views/artists/list.html.erb index de4e1df0..abca0851 100644 --- a/app/views/artists/list.html.erb +++ b/app/views/artists/list.html.erb @@ -1,29 +1,19 @@ -

Listing artists

+

<%= t '.title' -%>

- - - - - - - - - + + + + -<% @artists.each do |artist| %> - - - - - - - - - - - -<% end %> + <% @artists.each do |artist| %> + + + + + + + <% end %>
idemailnamehomepage_urlapi_urlcrowled_atauthor_idcreated_atupdated_at<%= t_m 'Artist.id' -%><%= t_m 'Artist.name' -%><%= t_m 'Artist.created_at' -%><%= t_m 'Artist.updated_at' -%>
<%= link_to artist.id, :action => :browse, :id => artist.id %><%= h artist.email %><%= h artist.name %><%= h artist.homepage_url %><%= h artist.api_url %><%= artist.crowled_at %><%= link_to artist.author_id, :controller => 'authors', :action => :browse, :id => artist.author_id %><%= artist.created_at %><%= artist.updated_at %>
<%= link_to artist.id, browse_artist_path(artist) %><%= h(truncate(artist.name, :length => 12)) %><%= l artist.created_at %><%= l artist.updated_at %>
diff --git a/app/views/artists/new.html.erb b/app/views/artists/new.html.erb index 40a9512e..8c748272 100644 --- a/app/views/artists/new.html.erb +++ b/app/views/artists/new.html.erb @@ -1,5 +1,7 @@ -

New artist

+

<%= t '.title' -%>

+

素材の投稿には絵師登録が必要です。

+

下記フォームで登録してください。

<%= render 'form' %> -<%= link_to 'Back', artists_path %> +<%= link_to t('link.back'), artists_path %> diff --git a/app/views/artists/show.html.erb b/app/views/artists/show.html.erb index 70d36264..c2f21e4b 100644 --- a/app/views/artists/show.html.erb +++ b/app/views/artists/show.html.erb @@ -1,5 +1,19 @@ +

<%= t '.title' -%>

<%= notice %>

-投稿された素材 +

+ <%= t_m 'Artist.name' -%>: + <%= h @artist.name %> +

-<%= link_to 'Back', artists_path %> +

+ <%= t_m 'Artist.created_at' -%>: + <%= l @artist.created_at %> +

+ +

+ <%= t_m 'Artist.updated_at' -%>: + <%= l @artist.updated_at %> +

+ +<%= link_to t('link.back'), artists_path %> diff --git a/app/views/authors/browse.html.erb b/app/views/authors/browse.html.erb index 86d0e794..a5f1813c 100644 --- a/app/views/authors/browse.html.erb +++ b/app/views/authors/browse.html.erb @@ -1,38 +1,24 @@ +

<%= t '.title' -%>

<%= notice %>

- name: - <%= h(@author.name) %> + <%= t_m 'Author.id' -%>: + <%= h @author.id %>

- email: - <%= h(@author.email) %> + <%= t_m 'Author.name' -%>: + <%= h @author.name %>

- sign_in_count: - <%= @author.sign_in_count %> + <%= t_m 'Author.created_at' -%>: + <%= l @author.created_at %>

- current_sign_in_at: - <%= @author.current_sign_in_at %> + <%= t_m 'Author.updated_at' -%>: + <%= l @author.updated_at %>

-

- last_sign_in_at: - <%= @author.last_sign_in_at %> -

- -

- current_sign_in_ip: - <%= @author.current_sign_in_ip %> -

- -

- last_sign_in_ip: - <%= @author.last_sign_in_ip %> -

- -<%= link_to 'Back', :action => :list %> +<%= link_to t('link.back'), :action => :list %> diff --git a/app/views/authors/edit.html.erb b/app/views/authors/edit.html.erb index 85205716..8e679a13 100644 --- a/app/views/authors/edit.html.erb +++ b/app/views/authors/edit.html.erb @@ -1,4 +1,4 @@ -

Editing author

+

<%= t '.title' -%>

<%= render 'form' %> diff --git a/app/views/authors/index.html.erb b/app/views/authors/index.html.erb index 5691bbbf..ee234482 100644 --- a/app/views/authors/index.html.erb +++ b/app/views/authors/index.html.erb @@ -1,13 +1,17 @@ -

Listing system_pictures

+

<%= t '.title' -%>

- + + + -<% @authors.each do |author| %> - - - -<% end %> + <% @authors.each do |author| %> + + + + + + <% end %>
Ext<%= t_m 'Author.name' -%><%= t_m 'Author.created_at' -%><%= t_m 'Author.updated_at' -%>
<%= link_to h(author.name), :action => :show, :id => author.id %>
<%= link_to h(truncate(author.name, :length => 12)), author_path(author) %><%= distance_of_time_in_words_to_now author.created_at %><%= distance_of_time_in_words_to_now author.updated_at %>
diff --git a/app/views/authors/list.html.erb b/app/views/authors/list.html.erb index a5599796..b190ff6a 100644 --- a/app/views/authors/list.html.erb +++ b/app/views/authors/list.html.erb @@ -1,31 +1,19 @@ -

Listing authors

+

<%= t '.title' -%>

- - - - - - - - - - + + + + -<% @authors.each do |author| %> - - - - - - - - - - - - -<% end %> + <% @authors.each do |author| %> + + + + + + + <% end %>
idnameemailsign_in_countcurrent_sign_in_atlast_sign_in_atcurrent_sign_in_iplast_sign_in_ipcreated_atupdated_at<%= t_m 'Author.id' -%><%= t_m 'Author.name' -%><%= t_m 'Author.created_at' -%><%= t_m 'Author.updated_at' -%>
<%= link_to author.id, :action => :show, :id => author.id %><%= h(author.name) %><%= h(author.email) %><%= author.sign_in_count %><%= author.current_sign_in_at %><%= author.last_sign_in_at %><%= author.current_sign_in_ip %><%= author.last_sign_in_ip %><%= author.created_at %><%= author.updated_at %>
<%= link_to author.id, browse_author_path(author) %><%= h(truncate(author.name, :length => 12)) %><%= l author.created_at %><%= l author.updated_at %>
diff --git a/app/views/authors/show.html.erb b/app/views/authors/show.html.erb index bbaf0844..3c114a2e 100644 --- a/app/views/authors/show.html.erb +++ b/app/views/authors/show.html.erb @@ -1,8 +1,19 @@ +

<%= t '.title' -%>

<%= notice %>

- name: - <%= h(@au.name) %> + <%= t_m 'Author.name' -%>: + <%= h @au.name %>

-<%= link_to 'Back', :controller => 'authors' %> +

+ <%= t_m 'Author.created_at' -%>: + <%= l @au.created_at %> +

+ +

+ <%= t_m 'Author.updated_at' -%>: + <%= l @au.updated_at %> +

+ +<%= link_to t('link.back'), authors_path %> diff --git a/app/views/balloons/index.html.erb b/app/views/balloons/index.html.erb deleted file mode 100644 index 8856ac1d..00000000 --- a/app/views/balloons/index.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -

Listing balloons

- - - - - - - - - - - - - - - - -<% @balloons.each do |balloon| %> - - - - - - - - - - - - -<% end %> -
panelballoonTemplatesystem_pictureTailsizexyztWidthHeight
<%= balloon.panel_id %><%= balloon.balloon_template_id %><%= balloon.system_picture_id %><%= balloon.tail %><%= balloon.size %><%= balloon.x %><%= balloon.y %><%= balloon.z %><%= balloon.width %><%= balloon.height %>
diff --git a/app/views/comics/browse.html.erb b/app/views/comics/browse.html.erb index 4f6e026b..c93e6224 100644 --- a/app/views/comics/browse.html.erb +++ b/app/views/comics/browse.html.erb @@ -18,7 +18,7 @@

<%= t_m 'Comic.author_id' -%>: <%= @comic.author_id %> - <%= link_to h(@comic.author.name), :controller => '/authors', :action => :browse, :id => @comic.author_id %> + <%= link_to h(@comic.author.name), browse_author_path(@comic.author) %>

diff --git a/app/views/comics/list.html.erb b/app/views/comics/list.html.erb index bfae91a9..43fdf7e5 100644 --- a/app/views/comics/list.html.erb +++ b/app/views/comics/list.html.erb @@ -12,10 +12,10 @@ <% @comics.each do |comic| %> - <%= link_to comic.id, :action => :browse, :id => comic.id %> - <%= h comic.title %> + <%= link_to comic.id, browse_comic_path(comic) %> + <%= h(truncate(comic.title, :length => 12)) %> <%= comic.visible %> - <%= link_to comic.author_id, :controller => '/authors', :action => :browse, :id => comic.author_id %> + <%= link_to comic.author_id, browse_author_path(comic.author) %> <%= l comic.created_at %> <%= l comic.updated_at %> diff --git a/app/views/ground_colors/index.html.erb b/app/views/ground_colors/index.html.erb index fed3158d..a8c3e54f 100644 --- a/app/views/ground_colors/index.html.erb +++ b/app/views/ground_colors/index.html.erb @@ -1,19 +1,21 @@ -

Listing Ground Colors

+

<%= t '.title' -%>

- - - - + + + + + -<% @ground_colors.each do |gc| %> - - - - - - -<% end -%> + <% @ground_colors.each do |gc| %> + + + + + + + + <% end -%>
idpanel_idcolor_idz<%= t_m 'GroundColor.panel_id' -%><%= t_m 'GroundColor.color_id' -%><%= t_m 'GroundColor.z' -%><%= t_m 'GroundColor.created_at' -%><%= t_m 'GroundColor.updated_at' -%>
<%= gc.id %><%= link_to gc.panel_id, panel_path(gc.panel_id) %><%= link_to gc.color_id, color_path(gc.color_id) %><%= gc.z %>
<%= link_to gc.panel_id, panel_path(gc.panel_id) %>; background-color: #<%= format("%06x", gc.color.code) -%>;"><%= h gc.color.name %><%= gc.z %><%= distance_of_time_in_words_to_now gc.created_at %><%= distance_of_time_in_words_to_now gc.updated_at %>
diff --git a/app/views/ground_pictures/index.html.erb b/app/views/ground_pictures/index.html.erb index 18e665c6..f44803e3 100644 --- a/app/views/ground_pictures/index.html.erb +++ b/app/views/ground_pictures/index.html.erb @@ -1,23 +1,29 @@ -

Listing Ground Pictures

+

<%= t '.title' -%>

- - - - - - + + + + + + + + + -<% @ground_pictures.each do |gp| %> - - - - - - - - -<% end -%> + <% @ground_pictures.each do |gp| %> + + + + + + + + + + + + <% end -%>
idpanel_idpicture_idrepeatposition x,yz<%= t_m 'GroundPicture.panel_id' -%><%= t_m 'GroundPicture.picture_id' -%><%= -%><%= t_m 'GroundPicture.z' -%><%= t_m 'GroundPicture.repeat' -%><%= t_m 'GroundPicture.x' -%><%= t_m 'GroundPicture.y' -%><%= t_m 'GroundPicture.created_at' -%><%= t_m 'GroundPicture.updated_at' -%>
<%= gp.id %><%= link_to gp.panel_id, panel_path(gp.panel_id) %><%= link_to gp.picture_id, color_path(gp.picture_id) %><%= gp.repeat %><%= MagicNumber['ground_picture_repeat_items'][gp.repeat] %><%= gp.x %>, <%= gp.y %><%= gp.z %>
<%= link_to gp.panel_id, panel_path(gp.panel_id) %><%= tag :img, gp.picture.tmb_opt_img_tag -%><%= render gp.picture.credit_template, :picture => gp.picture %><%= gp.z %><%= gp.repeat %><%= MagicNumber['ground_picture_repeat_items'][gp.repeat] %><%= gp.x %><%= gp.y %><%= distance_of_time_in_words_to_now gp.created_at %><%= distance_of_time_in_words_to_now gp.updated_at %>
diff --git a/app/views/home/configure.html.erb b/app/views/home/configure.html.erb index 02196cd0..71e2fe9e 100644 --- a/app/views/home/configure.html.erb +++ b/app/views/home/configure.html.erb @@ -9,6 +9,18 @@ <%= link_to 'generate token', :action => :create_token %> <% end %>
+
+

作家

+ <%= link_to 'edit author profile', edit_author_path(@author) %> +
+
+

絵師

+ <% if @artist %> + <%= link_to 'edit artist profile', edit_artist_path(@artist) %> + <% else %> + <%= link_to 'regist artist', new_artist_path %> + <% end %> +

退会

<%= link_to('退会する', {:controller => 'user_registrations', :action => :destroy, :id => @user.id}, {:method => :delete}) %> diff --git a/app/views/layouts/system.html.erb b/app/views/layouts/system.html.erb index 97ced9d8..124eefb5 100644 --- a/app/views/layouts/system.html.erb +++ b/app/views/layouts/system.html.erb @@ -2,39 +2,65 @@ Pettanr - <%= stylesheet_link_tag "application" %> + <%= stylesheet_link_tag "test.css" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> -ぺったんR
<% if user_signed_in? %> - <%= link_to "my home", '/home' %> - <%= link_to "ログアウト", main_app.destroy_user_session_path, :method => :delete %> + <%= link_to t('home.index.title'), '/home' %> + <%= link_to t('home.comics.title'), '/home/comic' %> + <%= link_to t('home.panels.title'), '/home/panel' %> + <%= link_to t('home.panel_pictures.title'), '/home/panel_picture' %> + <%= link_to h(truncate(@author.name, :length => 12)), main_app.author_path(@author) %> + <% if @artist %> + <%= link_to t('home.pictures.title'), main_app.original_pictures_path %> + <%= link_to h(truncate(@artist.name, :length => 12)), main_app.artist_path(@artist) %> + <% end %> + <%= link_to t('home.configure.title'), '/home/configure' %> + <%= link_to t('home.sign_out.title'), main_app.destroy_user_session_path, :method => :delete %> <% else %> - <%= link_to "ログイン", main_app.new_user_session_path %> + <%= link_to "sign in", main_app.new_user_session_path %> <% end %>
<% if admin_signed_in? %> <%= link_to "system", '/system' %> - <%= link_to "ログアウト", main_app.destroy_admin_session_path, :method => :delete %> + <%= link_to "browse", '/system/browse' %> + <%= link_to "approve", '/system/waiting_list' %> + <%= link_to "token", '/system/auth_token' %> + layout: + <%= link_to "test", '/system/test_layout' %> + <%= link_to "production", '/system/production_layout' %> + <%= link_to "sign out", main_app.destroy_admin_session_path, :method => :delete %> <% else %> - <%= link_to "管理者", main_app.new_admin_session_path %> + <%= link_to "sign in", main_app.new_admin_session_path %> <% end %>
-

<%= notice %>

-

<%= alert %>

+user.resources +<%= link_to 'comics', main_app.comics_path %> +<%= link_to 'stories', main_app.new_story_path %> +<%= link_to 'panels', main_app.panels_path %> +<%= link_to 'original_pictures', main_app.original_pictures_path %> +<%= link_to 'resource_pictures', main_app.resource_pictures_path %> +<%= link_to 'panel_pictures', main_app.panel_pictures_path %> + : +<%= link_to 'authors', main_app.authors_path %> +<%= link_to 'artists', main_app.artists_path %>
- <%= link_to "browse", '/system/browse' %> - <%= link_to "approve", '/system/waiting_list' %> - <%= link_to "token", '/system/auth_token' %> +system.resources +<%= link_to 'speech_balloon_templates', main_app.speech_balloon_templates_path %> +<%= link_to 'license_groups', main_app.license_groups_path %> +<%= link_to 'licenses', main_app.licenses_path %> +<%= link_to 'colors', main_app.colors_path %> +<%= link_to 'system_pictures', main_app.system_pictures_path %>
<%= yield %> +<%= javascript_tag 'var server_result=' + @server_result.to_json + ';' %> diff --git a/app/views/layouts/test.html.erb b/app/views/layouts/test.html.erb index 6fa0d2fb..57ea89e7 100644 --- a/app/views/layouts/test.html.erb +++ b/app/views/layouts/test.html.erb @@ -41,15 +41,17 @@
user.resources -<%= link_to 'comics', main_app.comics_path %> -<%= link_to 'stories', main_app.new_story_path %> -<%= link_to 'panels', main_app.panels_path %> -<%= link_to 'original_pictures', main_app.original_pictures_path %> -<%= link_to 'resource_pictures', main_app.resource_pictures_path %> -<%= link_to 'panel_pictures', main_app.panel_pictures_path %> +<%= link_to t_m('Comic'), main_app.comics_path %> +<%= link_to t_m('Story'), main_app.new_story_path %> +<%= link_to t_m('Panel'), main_app.panels_path %> +<%= link_to t_m('ResourcePicture'), main_app.resource_pictures_path %> +<%= link_to t_m('PanelPicture'), main_app.panel_pictures_path %> +<%= link_to t_m('GroundPicture'), main_app.ground_pictures_path %> +<%= link_to t_m('GroundColor'), main_app.ground_colors_path %> +<%= link_to t_m('PanelColor'), main_app.panel_colors_path %> : -<%= link_to 'authors', main_app.authors_path %> -<%= link_to 'artists', main_app.artists_path %> +<%= link_to t_m('Author'), main_app.authors_path %> +<%= link_to t_m('Artist'), main_app.artists_path %>
system.resources diff --git a/app/views/original_pictures/browse.html.erb b/app/views/original_pictures/browse.html.erb index 03ea4843..08c39cd9 100644 --- a/app/views/original_pictures/browse.html.erb +++ b/app/views/original_pictures/browse.html.erb @@ -1,50 +1,51 @@ +

<%= t '.title' -%>

<%= notice %>

+<%= link_to tag(:img, @original_picture.opt_img_tag), @original_picture.url %> + +

+ <%= t_m 'OriginalPicture.id' -%>: + <%= @original_picture.id %> +

+

- Ext: + <%= t_m 'OriginalPicture.ext' -%>: <%= @original_picture.ext %>

- Width: + <%= t_m 'OriginalPicture.width' -%>: <%= @original_picture.width %>

- Height: + <%= t_m 'OriginalPicture.height' -%>: <%= @original_picture.height %>

- filesize: + <%= t_m 'OriginalPicture.filesize' -%>: <%= @original_picture.filesize %>

- artist: - <%= @original_picture.artist_id %> + <%= t_m 'OriginalPicture.md5' -%>: + <%= @original_picture.md5 %>

- md5: - <%= @original_picture.md5 %> + <%= t_m 'OriginalPicture.artist_id' -%>: + <%= link_to h(@original_picture.artist.name), browse_artist_path(@original_picture.artist) %>

- -

-browse picture + <%= t_m 'OriginalPicture.created_at' -%>: + <%= l @original_picture.created_at %>

-<% if @original_picture.own? @author -%> +

-Replace picture + <%= t_m 'OriginalPicture.updated_at' -%>: + <%= l @original_picture.updated_at %>

- <%= form_for(@original_picture, :html => { :multipart => true }) do |f| %> - <%= f.file_field "file" %> -
- <%= f.submit 'replace' %> -
- <% end %> -<% end -%> -<%= link_to 'Back', :action => :list %> +<%= link_to t('link.back'), :action => :list %> diff --git a/app/views/original_pictures/index.html.erb b/app/views/original_pictures/index.html.erb index aaad718c..3c8a214c 100644 --- a/app/views/original_pictures/index.html.erb +++ b/app/views/original_pictures/index.html.erb @@ -1,36 +1,43 @@ -

Listing original_pictures

+

<%= t '.title' -%>

<%= render 'uploader' %> - - - - - - - - + + + + + + -<% @original_pictures.each do |original_picture| %> -
-
- - - - - - - - - - -<% end %> + <% @original_pictures.each do |original_picture| %> + + + + + + + + <% end %>
picturerevisionsfilenameWidthHeightfilesizemd5history<%= t_m 'OriginalPicture' -%><%= t 'original_pictures.index.history' -%><%= t 'original_pictures.index.status' -%><%= t_m 'ResourcePicture' -%><%= -%><%= -%>
- <%= link_to tag(:img, original_picture.tmb_opt_img_tag), original_picture %> - <%= original_picture.pictures.empty? ? '' : original_picture.history.first.revision %><%= original_picture.filename %><%= original_picture.width %><%= original_picture.height %><%= original_picture.filesize %><%= original_picture.md5 %><%= link_to '...', :controller => 'original_pictures', :action => :history, :id => original_picture.id %>
+ <%= link_to tag(:img, original_picture.tmb_opt_img_tag), original_picture %> + + <% if original_picture.pictures.empty? %> + - + <% else %> + <%= link_to original_picture.history.first.revision, history_original_picture_path(original_picture) %> + <% end %> + + + <% if original_picture.resource_picture %> + <%= link_to t('original_pictures.index.stop'), original_picture.resource_picture, confirm: 'Are you sure?', method: :delete %> + <% else %> + <% end %> + + <%= link_to t('original_pictures.index.destroy'), original_picture, confirm: 'Are you sure?', method: :delete %> +
<%= link_to 'open form', new_original_picture_path, :remote => true %>
- uploader + ...
diff --git a/app/views/original_pictures/list.html.erb b/app/views/original_pictures/list.html.erb index f9a69df4..66b6679a 100644 --- a/app/views/original_pictures/list.html.erb +++ b/app/views/original_pictures/list.html.erb @@ -1,34 +1,31 @@ -

Listing original_pictures

+

<%= t '.title' -%>

-<%= render 'uploader' %> - - - - - - - - - + + + + + + + + + -<% @original_pictures.each do |original_picture| %> - - - - - - - - - - - - -<% end %> + <% @original_pictures.each do |original_picture| %> + + + + + + + + + + + + + <% end %>
idExtWidthHeightfilesizeartistmd5created_atupdated_at <%= t_m 'OriginalPicture.id' -%><%= t_m 'OriginalPicture.ext' -%><%= t_m 'OriginalPicture.width' -%><%= t_m 'OriginalPicture.height' -%><%= t_m 'OriginalPicture.filesize' -%><%= t_m 'OriginalPicture.md5' -%><%= t_m 'OriginalPicture.artist_id' -%><%= t_m 'OriginalPicture.created_at' -%><%= t_m 'OriginalPicture.updated_at' -%>
<%= link_to original_picture.id, :action => :browse, :id => original_picture.id %><%= original_picture.ext %><%= original_picture.width %><%= original_picture.height %><%= original_picture.filesize %><%= link_to original_picture.artist_id, :controller => 'artists', :action => :browse, :id => original_picture.artist_id %><%= original_picture.md5 %><%= original_picture.created_at %><%= original_picture.updated_at %> - <%= link_to 'Destroy', original_picture, confirm: 'Are you sure?', method: :delete %> -
<%= link_to tag(:img, original_picture.tmb_opt_img_tag), original_picture.url %><%= link_to original_picture.id, browse_original_picture_path(original_picture) %><%= h original_picture.ext %><%= original_picture.width %><%= original_picture.height %><%= original_picture.filesize %><%= h(truncate(original_picture.md5, :length => 8)) %><%= link_to original_picture.artist_id, browse_artist_path(original_picture.artist) %><%= l original_picture.created_at %><%= l original_picture.updated_at %>
diff --git a/app/views/original_pictures/show.html.erb b/app/views/original_pictures/show.html.erb index f08dd215..0e480afc 100644 --- a/app/views/original_pictures/show.html.erb +++ b/app/views/original_pictures/show.html.erb @@ -1,35 +1,49 @@ -

-Original Picture -

+

<%= t '.title' -%>

<%= render 'exist', :exist => Picture.exist_by_md5(@original_picture.md5, @original_picture.id) %>

<%= notice %>

-
- Ext: - <%= @original_picture.ext %> - Width: - <%= @original_picture.width %> - Height: - <%= @original_picture.height %> - filesize: - <%= @original_picture.filesize %> + <%= link_to tag(:img, @original_picture.opt_img_tag), @original_picture.url %>

- md5: - <%= @original_picture.md5 %> + <%= t_m 'OriginalPicture.ext' -%>: + <%= @original_picture.ext %>

- artist: - <%= @original_picture.artist_id %> + <%= t_m 'OriginalPicture.width' -%>: + <%= @original_picture.width %>

- +

+ <%= t_m 'OriginalPicture.height' -%>: + <%= @original_picture.height %> +

+ +

+ <%= t_m 'OriginalPicture.filesize' -%>: + <%= @original_picture.filesize %> +

+ +

+ <%= t_m 'OriginalPicture.artist_id' -%>: + <%= link_to h(@original_picture.artist.name), artist_path(@original_picture.artist) %> +

+ +

+ <%= t_m 'OriginalPicture.created_at' -%>: + <%= l @original_picture.created_at %> +

+ +

+ <%= t_m 'OriginalPicture.updated_at' -%>: + <%= l @original_picture.updated_at %> +

- <%= link_to 'Select License', :controller => 'original_picture_license_groups', :action => :new, :original_picture_id => @original_picture.id %> + <%= link_to 'Select License', :controller => 'original_picture_license_groups', :action => :new, :original_picture_id => @original_picture.id %>

Replace picture @@ -48,7 +62,7 @@ Original Picture <%= render 'history_list', :history => @original_picture.history %>

-<%= link_to 'destroy', resource_picture_path(@original_picture.resource_picture), :method => :delete %> + +<%= link_to t('link.destroy'), original_picture_path(@original_picture), :method => :delete %> -<%= link_to 'Back', original_pictures_path %> +<%= link_to t('link.back'), original_pictures_path %> diff --git a/app/views/panel_colors/index.html.erb b/app/views/panel_colors/index.html.erb index e6a9fa21..812408ca 100644 --- a/app/views/panel_colors/index.html.erb +++ b/app/views/panel_colors/index.html.erb @@ -1,19 +1,21 @@ -

Listing Panel Colors

+

<%= t '.title' -%>

- - - - + + + + + -<% @panel_colors.each do |pc| %> - - - - - - -<% end -%> + <% @panel_colors.each do |pc| %> + + + + + + + + <% end -%>
idpanel_idcodez<%= t_m 'PanelColor.panel_id' -%><%= t_m 'PanelColor.code' -%><%= t_m 'PanelColor.z' -%><%= t_m 'PanelColor.created_at' -%><%= t_m 'PanelColor.updated_at' -%>
<%= pc.id %><%= link_to pc.panel_id, panel_path(pc.panel_id) %><%= pc.code %>*****<%= pc.z %>
<%= link_to pc.panel_id, panel_path(pc.panel_id) %>; background-color: #<%= format("%06x", pc.code) -%>;"><%= format("%06x", pc.code ^ 0xffffff) %><%= pc.z %><%= distance_of_time_in_words_to_now pc.created_at %><%= distance_of_time_in_words_to_now pc.updated_at %>
diff --git a/app/views/pictures/browse.html.erb b/app/views/pictures/browse.html.erb index 458ff492..35c2f411 100644 --- a/app/views/pictures/browse.html.erb +++ b/app/views/pictures/browse.html.erb @@ -2,6 +2,7 @@

<%= notice %>

<%= link_to tag(:img, @picture.opt_img_tag), @picture.url %> +<%= render @picture.credit_template, :picture => @picture %>

<%= t_m 'Picture.id' -%>: <%= @picture.id %> @@ -74,12 +75,12 @@

<%= t_m 'Picture.created_at' -%>: - <%= @picture.created_at %> + <%= l @picture.created_at %>

<%= t_m 'Picture.updated_at' -%>: - <%= @picture.updated_at %> + <%= l @picture.updated_at %>

- %= link_to t('link.back'), :action => :list %> +<%= link_to t('link.back'), :action => :list %> diff --git a/app/views/resource_pictures/browse.html.erb b/app/views/resource_pictures/browse.html.erb index f43b1718..9d4e2fab 100644 --- a/app/views/resource_pictures/browse.html.erb +++ b/app/views/resource_pictures/browse.html.erb @@ -1,31 +1,87 @@ +

<%= t '.title' -%>

<%= notice %>

-credit + +<%= link_to tag(:img, @resource_picture.opt_img_tag), @resource_picture.url %> +<%= render @resource_picture.credit_template, :picture => @resource_picture %> + +

+ <%= t_m 'ResourcePicture.id' -%>: + <%= @resource_picture.id %> +

+ +

+ <%= t_m 'ResourcePicture.original_picture_id' -%>: + <%= link_to @resource_picture.original_picture_id, browse_original_picture_path(@resource_picture.original_picture) %> +

+ +

+ <%= t_m 'ResourcePicture.ext' -%>: + <%= @resource_picture.ext %> +

+

- <%= @resource_picture.credit %> + <%= t_m 'ResourcePicture.width' -%>: + <%= @resource_picture.width %>

-settings +

- <%= @resource_picture.settings %> + <%= t_m 'ResourcePicture.height' -%>: + <%= @resource_picture.height %>

- ノーマル - + <%= t_m 'ResourcePicture.filesize' -%>: + <%= @resource_picture.filesize %>

+

- 垂直反転 - + <%= t_m 'ResourcePicture.md5' -%>: + <%= @resource_picture.md5 %>

+

- 水平反転 - + <%= t_m 'ResourcePicture.license_id' -%>: + <%= link_to @resource_picture.license_id, browse_license_path(@resource_picture.license) %>

+

- 垂直水平反転 - + <%= t_m 'ResourcePicture.artist_id' -%>: + <%= link_to @resource_picture.artist_id, browse_artist_path(@resource_picture.artist) %>

+

- サムネ - + <%= t_m 'ResourcePicture.artist_name' -%>: + <%= h @resource_picture.artist_name %>

-<%= link_to 'Back', :action => :list %> + +

+ <%= t_m 'ResourcePicture.classname' -%>: + <%= h @resource_picture.classname %> +

+ +

+ <%= t_m 'ResourcePicture.credit' -%>: + <%= h @resource_picture.credit %> +

+ +

+ <%= t_m 'ResourcePicture.settings' -%>: + <%= h @resource_picture.settings %> +

+ +

+ <%= t_m 'ResourcePicture.picture_id' -%>: + <%= link_to @resource_picture.picture_id, browse_picture_path(@resource_picture.picture) %> +

+ +

+ <%= t_m 'ResourcePicture.created_at' -%>: + <%= l @resource_picture.created_at %> +

+ +

+ <%= t_m 'ResourcePicture.updated_at' -%>: + <%= l @resource_picture.updated_at %> +

+ +<%= link_to t('link.back'), :action => :list %> diff --git a/app/views/resource_pictures/index.html.erb b/app/views/resource_pictures/index.html.erb index 4d04af27..85644d8e 100644 --- a/app/views/resource_pictures/index.html.erb +++ b/app/views/resource_pictures/index.html.erb @@ -1,32 +1,36 @@ -

Listing resource_pictures

+

<%= t '.title' -%>

- - + + + + + <% @resource_pictures.each do |resource_picture| %> + + + <% end %> diff --git a/app/views/resource_pictures/list.html.erb b/app/views/resource_pictures/list.html.erb index 2141011a..eac212c8 100644 --- a/app/views/resource_pictures/list.html.erb +++ b/app/views/resource_pictures/list.html.erb @@ -1,36 +1,44 @@ -

Listing resource_pictures

+

<%= t '.title' -%>

picture creditartistproperties<%= t_m 'ResourcePicture.artist_id' -%><%= t_m 'ResourcePicture.ext' -%><%= t_m 'ResourcePicture.width' -%><%= t_m 'ResourcePicture.height' -%><%= t_m 'ResourcePicture.filesize' -%>
- <%= link_to tag(:img, resource_picture.opt_img_tag), resource_picture %> + <%= link_to tag(:img, resource_picture.tmb_opt_img_tag), resource_picture_path(resource_picture) %> <%= render resource_picture.credit_template, :picture => resource_picture %> - <%= link_to(h(resource_picture.artist.name), artist_path(resource_picture.artist)) %> + <%= link_to(h(truncate(resource_picture.artist.name, :length => 8)), artist_path(resource_picture.artist)) %> -
- <%= resource_picture.ext %> -
-
- <%= resource_picture.width %>x<%= resource_picture.height %>px -
-
- <%= resource_picture.filesize %>bytes -
+ <%= h resource_picture.ext %> +
+ <%= resource_picture.width %>px + + <%= resource_picture.height %>px + + <%= resource_picture.filesize %>bytes
- - - - - - - - - - - - - + + + + + + + + + + + + + + + + + -<% @resource_pictures.each do |resource_picture| %> - - - - - - - - - - - - - - - -<% end %> + <% @resource_pictures.each do |resource_picture| %> + + + + + + + + + + + + + + + + + + + + <% end %>
idExtWidthHeightfilesizeartistlicense_idoriginal_picture_idartist_nameclassnamepicturecreated_atupdated_at<%= t_m 'ResourcePicture.id' -%><%= t_m 'ResourcePicture.original_picture_id' -%><%= t_m 'ResourcePicture.ext' -%><%= t_m 'ResourcePicture.width' -%><%= t_m 'ResourcePicture.height' -%><%= t_m 'ResourcePicture.filesize' -%><%= t_m 'ResourcePicture.md5' -%><%= t_m 'ResourcePicture.artist_id' -%><%= t_m 'ResourcePicture.license_id' -%><%= t_m 'ResourcePicture.artist_name' -%><%= t_m 'ResourcePicture.classname' -%><%= t_m 'ResourcePicture.credit' -%><%= t_m 'ResourcePicture.settings' -%><%= t_m 'ResourcePicture.picture_id' -%><%= t_m 'ResourcePicture.created_at' -%><%= t_m 'ResourcePicture.updated_at' -%>
<%= link_to resource_picture.id, :action => :browse, :id => resource_picture.id%><%= resource_picture.ext %><%= resource_picture.width %><%= resource_picture.height %><%= resource_picture.filesize %><%= link_to resource_picture.artist_id, :controller => 'artists', :action => :browse, :id => resource_picture.artist_id %><%= link_to resource_picture.license_id, :controller => 'licenses', :action => :browse, :id => resource_picture.license_id %><%= link_to resource_picture.original_picture_id, :controller => 'original_pictures', :action => :browse, :id => resource_picture.original_picture_id%><%= resource_picture.artist_name %><%= resource_picture.classname %><%= link_to resource_picture.picture_id, main_app.picture_path(resource_picture.picture_id) %><%= resource_picture.created_at %><%= resource_picture.updated_at %>
<%= link_to tag(:img, resource_picture.tmb_opt_img_tag), resource_picture.url %><%= link_to resource_picture.id, browse_resource_picture_path(resource_picture.id) %><%= link_to resource_picture.original_picture_id, browse_original_picture_path(resource_picture.original_picture) %><%= h resource_picture.ext %><%= resource_picture.width %><%= resource_picture.height %><%= resource_picture.filesize %><%= h(truncate(resource_picture.md5, :length => 8)) %><%= link_to resource_picture.artist_id, browse_artist_path(resource_picture.artist) %><%= link_to resource_picture.license_id, browse_license_path(resource_picture.license) %><%= h(truncate(resource_picture.artist_name, :length => 8)) %><%= h(truncate(resource_picture.classname, :length => 8)) %><%= h(truncate(resource_picture.credit, :length => 8)) %><%= h(truncate(resource_picture.settings, :length => 8)) %><%= link_to resource_picture.picture_id, main_app.browse_picture_path(resource_picture.picture) %><%= l resource_picture.created_at %><%= l resource_picture.updated_at %>
diff --git a/app/views/resource_pictures/show.html.erb b/app/views/resource_pictures/show.html.erb index 4d600810..eeddbbb5 100644 --- a/app/views/resource_pictures/show.html.erb +++ b/app/views/resource_pictures/show.html.erb @@ -1,16 +1,43 @@ -

Resource Picture #<%= @resource_picture.id %>

+

<%= t '.title' -%>

<%= notice %>

- -

credit

+ +<%= link_to tag(:img, @resource_picture.opt_img_tag), @resource_picture.url %> + <%= render @resource_picture.full_credit_template, :picture => @resource_picture %> -

properties

-
+ +

+ <%= t_m 'ResourcePicture.ext' -%>: <%= @resource_picture.ext %> -

-
- <%= @resource_picture.width %>x<%= @resource_picture.height %>px -
-
- <%= @resource_picture.filesize %>bytes -
-<%= link_to 'Back', resource_pictures_path %> +

+ +

+ <%= t_m 'ResourcePicture.width' -%>: + <%= @resource_picture.width %> +

+ +

+ <%= t_m 'ResourcePicture.height' -%>: + <%= @resource_picture.height %> +

+ +

+ <%= t_m 'ResourcePicture.filesize' -%>: + <%= @resource_picture.filesize %> +

+ +

+ <%= t_m 'ResourcePicture.artist_id' -%>: + <%= link_to h(@resource_picture.artist.name), artist_path(@resource_picture.artist) %> +

+ +

+ <%= t_m 'ResourcePicture.created_at' -%>: + <%= l @resource_picture.created_at %> +

+ +

+ <%= t_m 'ResourcePicture.updated_at' -%>: + <%= l @resource_picture.updated_at %> +

+ +<%= link_to t('link.back'), resource_pictures_path %> diff --git a/app/views/speeches/index.html.erb b/app/views/speeches/index.html.erb deleted file mode 100644 index d481a0e8..00000000 --- a/app/views/speeches/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -

Listing speeches

- - - - - - - - - - - - -<% @speeches.each do |speech| %> - - - - - - - - - -<% end %> -
ballooncontentxytWidthHeight
<%= speech.balloon_id %><%= h speech.content %><%= speech.x %><%= speech.y %><%= speech.t %><%= speech.width %><%= speech.height %>
- diff --git a/config/locales/pettanr.ja.yml b/config/locales/pettanr.ja.yml index e6949a8d..754678f3 100644 --- a/config/locales/pettanr.ja.yml +++ b/config/locales/pettanr.ja.yml @@ -10,7 +10,7 @@ ja: balloon: フキダシ枠 ground_picture: 絵地 ground_color: 選択色地 - pane_color: 指定色地 + panel_color: 指定色地 original_picture: 原画 picture: 実素材 resource_picture: 素材 @@ -102,7 +102,7 @@ ja: z: 重なり created_at: 作成 updated_at: 更新 - pane_color: + panel_color: panel_id: コマ code: カラーコード z: 重なり @@ -134,13 +134,14 @@ ja: created_at: 作成 updated_at: 更新 resource_picture: + original_picture_id: 原画 ext: 画像フォーマット width: 幅 height: 高さ filesize: ファイルサイズ md5: MD5 artist_id: 絵師 - original_picture_id: 原画 + license_id: ライセンス artist_name: 著作者名 classname: ライセンスクラス名 credit: クレジット拡張データ @@ -248,6 +249,8 @@ ja: title: ストーリー詳細 new: title: ストーリー追加 + edit: + title: 並び替え list: title: ストーリー 生一覧 browse: @@ -329,6 +332,10 @@ ja: original_pictures: index: title: 原画一覧 + history: 履歴 + status: 状態 + stop: 停止する + destroy: 削除する show: title: 原画詳細 new: @@ -396,6 +403,8 @@ ja: title: 作家一覧 show: title: 作家詳細 + edit: + title: 作家プロフィール編集 list: title: 作家 生一覧 browse: @@ -405,6 +414,10 @@ ja: title: 絵師一覧 show: title: 絵師詳細 + new: + title: 絵師登録 + edit: + title: 絵師プロフィール編集 list: title: 絵師 生一覧 browse: diff --git a/config/routes.rb b/config/routes.rb index 7ac803d8..67008d26 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -114,7 +114,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :history post :create get :list end @@ -122,6 +121,7 @@ Pettanr::Application.routes.draw do get :edit put :update delete :destroy + get :history get :browse end end diff --git a/spec/controllers/original_pictures_controller_spec.rb b/spec/controllers/original_pictures_controller_spec.rb index 5ba01e29..86ef5489 100644 --- a/spec/controllers/original_pictures_controller_spec.rb +++ b/spec/controllers/original_pictures_controller_spec.rb @@ -348,7 +348,7 @@ describe OriginalPicturesController do end it '自身に履歴一覧を問い合わせている' do OriginalPicture.any_instance.should_receive(:history).exactly(1) - get :history + get :history, :id => @op.id end it '@historyにリストを取得している' do get :history, :id => @op.id diff --git a/spec/models/original_picture_spec.rb b/spec/models/original_picture_spec.rb index 564cecb9..f469895e 100644 --- a/spec/models/original_picture_spec.rb +++ b/spec/models/original_picture_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' describe OriginalPicture do before do - FactoryGirl.create :admin + @admin = FactoryGirl.create :admin @user = FactoryGirl.create( :user_yas) @author = @user.author @artist = FactoryGirl.create :artist_yas, :author_id => @author.id @@ -184,7 +184,12 @@ describe OriginalPicture do before do @op = FactoryGirl.create :original_picture, :artist_id => @artist.id end - it '自分の原画を見るときは許可する' do + it '検査対象が管理者のとき、許可を返す' do + OriginalPicture.any_instance.stub(:own?).and_return(false) + r = @op.visible?(@admin) + r.should == true + end + it '所持判定を問い合わせ、自分の原画なら許可する' do OriginalPicture.any_instance.stub(:own?).and_return(true) r = @op.visible?(@artist) r.should == true -- 2.11.0