From 630984f4850fdde8252089bc49bd2614a84f9ef7 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Tue, 5 Nov 2013 10:58:13 +0900 Subject: [PATCH] t#32402:add file prof --- app/assets/images/item.png | Bin 0 -> 282 bytes app/controllers/artists_controller.rb | 1 + app/controllers/authors_controller.rb | 1 + app/controllers/balloons_controller.rb | 1 + app/controllers/comics_controller.rb | 1 + app/controllers/ground_colors_controller.rb | 1 + app/controllers/ground_pictures_controller.rb | 1 + app/controllers/license_groups_controller.rb | 1 + app/controllers/licenses_controller.rb | 1 + app/controllers/original_pictures_controller.rb | 1 + app/controllers/panel_pictures_controller.rb | 1 + app/controllers/panels_controller.rb | 1 + app/controllers/pictures_controller.rb | 1 + app/controllers/resource_pictures_controller.rb | 1 + app/controllers/scroll_panels_controller.rb | 1 + app/controllers/scrolls_controller.rb | 1 + app/controllers/sheet_panels_controller.rb | 1 + app/controllers/sheets_controller.rb | 1 + .../speech_balloon_templates_controller.rb | 1 + app/controllers/speech_balloons_controller.rb | 2 + app/controllers/speeches_controller.rb | 1 + app/controllers/stories_controller.rb | 1 + app/controllers/story_sheets_controller.rb | 1 + app/controllers/system_pictures_controller.rb | 1 + app/helpers/application_helper.rb | 4 + app/views/comics/_list_item.html.erb | 1 + app/views/comics/show.prof.erb | 53 ++++++++++++++ app/views/layouts/test.prof.erb | 81 +++++++++++++++++++++ app/views/top/prof.prof.erb | 1 + config/initializers/mime_types.rb | 1 + 30 files changed, 165 insertions(+) create mode 100644 app/assets/images/item.png create mode 100644 app/views/comics/show.prof.erb create mode 100644 app/views/layouts/test.prof.erb create mode 100644 app/views/top/prof.prof.erb diff --git a/app/assets/images/item.png b/app/assets/images/item.png new file mode 100644 index 0000000000000000000000000000000000000000..132ca25a8b98556621edf11d7a11e215ec5ccc48 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1SD0tpLGH$#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=BdgAk26#O}+vsxZcynF(kwJ?Ri7K!v;Joj{pBh|C)TOrIkxw zK*H)2pJ>WViaFbtF^<1vI-|q3irZ1q<|543c)vDe9A!|r zEh(^+cQ?bLIf=>+Qw$hRd=nJd+4h!UV(JQ(7?W-4TFfyl4$KMcMB;M$2fusYcJ^Gh lWe$*Sc*PLHzF^zE`#+W}2ztDt=_JtU44$rjF6*2UngDYzR~rBT literal 0 HcmV?d00001 diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index dbcfab52..d6c4a0a4 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -28,6 +28,7 @@ class ArtistsController < ApplicationController respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render :json => @ar.to_json(Artist.show_json_opt) } end end diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb index 7f70b721..345c6ebf 100644 --- a/app/controllers/authors_controller.rb +++ b/app/controllers/authors_controller.rb @@ -28,6 +28,7 @@ class AuthorsController < ApplicationController respond_to do |format| format.html + format.prof { render :template => 'top/prof', :layout => true } format.json { render :json => @au.to_json(Author.show_json_opt) } end end diff --git a/app/controllers/balloons_controller.rb b/app/controllers/balloons_controller.rb index d3c67272..885e055d 100644 --- a/app/controllers/balloons_controller.rb +++ b/app/controllers/balloons_controller.rb @@ -25,6 +25,7 @@ class BalloonsController < ApplicationController @balloon = Balloon.show(params[:id], [@user, @admin]) respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @balloon.to_json(Balloon.show_json_opt) } end end diff --git a/app/controllers/comics_controller.rb b/app/controllers/comics_controller.rb index d8729a37..d60fd815 100644 --- a/app/controllers/comics_controller.rb +++ b/app/controllers/comics_controller.rb @@ -29,6 +29,7 @@ class ComicsController < ApplicationController respond_to do |format| format.html + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @comic.to_json(Comic.show_json_opt) } format.atom format.rss diff --git a/app/controllers/ground_colors_controller.rb b/app/controllers/ground_colors_controller.rb index e9456f90..f990f241 100644 --- a/app/controllers/ground_colors_controller.rb +++ b/app/controllers/ground_colors_controller.rb @@ -26,6 +26,7 @@ class GroundColorsController < ApplicationController @ground_color = GroundColor.show(params[:id], [@user, @admin]) respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @ground_color.to_json(GroundColor.show_json_opt) } end end diff --git a/app/controllers/ground_pictures_controller.rb b/app/controllers/ground_pictures_controller.rb index 9cf4159f..16989a04 100644 --- a/app/controllers/ground_pictures_controller.rb +++ b/app/controllers/ground_pictures_controller.rb @@ -26,6 +26,7 @@ class GroundPicturesController < ApplicationController @ground_picture = GroundPicture.show(params[:id], [@user, @admin]) respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @ground_picture.to_json(GroundPicture.show_json_opt) } end end diff --git a/app/controllers/license_groups_controller.rb b/app/controllers/license_groups_controller.rb index 4433053b..5e652a15 100644 --- a/app/controllers/license_groups_controller.rb +++ b/app/controllers/license_groups_controller.rb @@ -19,6 +19,7 @@ class LicenseGroupsController < ApplicationController @license_group = LicenseGroup.show(params[:id]) respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @license_group.to_json(LicenseGroup.show_json_opt) } end end diff --git a/app/controllers/licenses_controller.rb b/app/controllers/licenses_controller.rb index d30b226e..49e11123 100644 --- a/app/controllers/licenses_controller.rb +++ b/app/controllers/licenses_controller.rb @@ -19,6 +19,7 @@ class LicensesController < ApplicationController @license = License.show(params[:id]) respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @license.to_json(License.show_json_opt) } end end diff --git a/app/controllers/original_pictures_controller.rb b/app/controllers/original_pictures_controller.rb index 2d0b4635..6f70a0ef 100644 --- a/app/controllers/original_pictures_controller.rb +++ b/app/controllers/original_pictures_controller.rb @@ -32,6 +32,7 @@ class OriginalPicturesController < ApplicationController @original_picture_license_group = OriginalPictureLicenseGroup.new :original_picture_id => @original_picture.id render } + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @original_picture.to_json(OriginalPicture.show_json_opt)} end end diff --git a/app/controllers/panel_pictures_controller.rb b/app/controllers/panel_pictures_controller.rb index 5a98947d..69f7cb56 100644 --- a/app/controllers/panel_pictures_controller.rb +++ b/app/controllers/panel_pictures_controller.rb @@ -28,6 +28,7 @@ class PanelPicturesController < ApplicationController respond_to do |format| format.html + format.prof { render :template => 'top/prof', :layout => true } format.json { render :json => @panel_picture.to_json(PanelPicture.show_json_opt) } end end diff --git a/app/controllers/panels_controller.rb b/app/controllers/panels_controller.rb index 28a03fee..51f7b63f 100644 --- a/app/controllers/panels_controller.rb +++ b/app/controllers/panels_controller.rb @@ -39,6 +39,7 @@ class PanelsController < ApplicationController @fresh_sheets = SheetPanel.mylist(@author, 1, 5).map {|sp| sp.sheet} end } + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @panel.panel_elements_as_json } format.jsonp { render :json => "callback(" + @panel.panel_elements_as_json + ");" diff --git a/app/controllers/pictures_controller.rb b/app/controllers/pictures_controller.rb index b8ab99dc..d124c9e8 100644 --- a/app/controllers/pictures_controller.rb +++ b/app/controllers/pictures_controller.rb @@ -19,6 +19,7 @@ class PicturesController < ApplicationController format.gif { send_data(@picture.restore(params[:subdir]), opt ) } format.jpeg { send_data(@picture.restore(params[:subdir]), opt ) } format.html + format.prof { render :template => 'top/prof', :layout => true } format.json { render :json => @picture.to_json} end end diff --git a/app/controllers/resource_pictures_controller.rb b/app/controllers/resource_pictures_controller.rb index 16124437..ae83fbdd 100644 --- a/app/controllers/resource_pictures_controller.rb +++ b/app/controllers/resource_pictures_controller.rb @@ -32,6 +32,7 @@ class ResourcePicturesController < ApplicationController format.gif { send_data(@resource_picture.restore(params[:subdir]), opt ) } format.jpeg { send_data(@resource_picture.restore(params[:subdir]), opt ) } format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render :json => @resource_picture.to_json(ResourcePicture.show_json_opt)} end end diff --git a/app/controllers/scroll_panels_controller.rb b/app/controllers/scroll_panels_controller.rb index f694433f..305638c6 100644 --- a/app/controllers/scroll_panels_controller.rb +++ b/app/controllers/scroll_panels_controller.rb @@ -28,6 +28,7 @@ class ScrollPanelsController < ApplicationController respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @scroll_panel.scroll_panel_as_json(@author) } end end diff --git a/app/controllers/scrolls_controller.rb b/app/controllers/scrolls_controller.rb index 62a84131..9c255bdb 100644 --- a/app/controllers/scrolls_controller.rb +++ b/app/controllers/scrolls_controller.rb @@ -34,6 +34,7 @@ class ScrollsController < ApplicationController end } format.json { render json: @scroll.to_json(Scroll.show_json_opt) } + format.prof { render :template => 'top/prof', :layout => true } format.atom format.rss end diff --git a/app/controllers/sheet_panels_controller.rb b/app/controllers/sheet_panels_controller.rb index 23320d63..d7a79611 100644 --- a/app/controllers/sheet_panels_controller.rb +++ b/app/controllers/sheet_panels_controller.rb @@ -28,6 +28,7 @@ class SheetPanelsController < ApplicationController respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @sheet_panel.sheet_panel_as_json(@author) } end end diff --git a/app/controllers/sheets_controller.rb b/app/controllers/sheets_controller.rb index 7c63a0b9..b7cf8921 100644 --- a/app/controllers/sheets_controller.rb +++ b/app/controllers/sheets_controller.rb @@ -35,6 +35,7 @@ class SheetsController < ApplicationController @fresh_stories = StorySheet.mylist(@author, 1, 5).map {|ss| ss.story} end } + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @sheet.to_json(Sheet.show_json_opt) } format.atom format.rss diff --git a/app/controllers/speech_balloon_templates_controller.rb b/app/controllers/speech_balloon_templates_controller.rb index ab393671..eb8d8836 100644 --- a/app/controllers/speech_balloon_templates_controller.rb +++ b/app/controllers/speech_balloon_templates_controller.rb @@ -26,6 +26,7 @@ class SpeechBalloonTemplatesController < ApplicationController respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render :json => @speech_balloon_template.to_json(SpeechBalloonTemplate.show_json_opt) } diff --git a/app/controllers/speech_balloons_controller.rb b/app/controllers/speech_balloons_controller.rb index bc5aea82..93505119 100644 --- a/app/controllers/speech_balloons_controller.rb +++ b/app/controllers/speech_balloons_controller.rb @@ -27,6 +27,8 @@ class SpeechBalloonsController < ApplicationController @speech_balloon = SpeechBalloon.show(params[:id], [@user, @admin]) respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @speech_balloon.to_json(SpeechBalloon.show_json_opt) } end end diff --git a/app/controllers/speeches_controller.rb b/app/controllers/speeches_controller.rb index 1095fdb7..24ca9711 100644 --- a/app/controllers/speeches_controller.rb +++ b/app/controllers/speeches_controller.rb @@ -25,6 +25,7 @@ class SpeechesController < ApplicationController @speech = Speech.show(params[:id], [@user, @admin]) respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @speech.to_json(Speech.show_json_opt) } end end diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 366c4a8e..fba32e6b 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -32,6 +32,7 @@ class StoriesController < ApplicationController @new_sheets = Sheet.mylist(@author, 1, 5) end } + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @story.to_json(Story.show_json_opt) } end end diff --git a/app/controllers/story_sheets_controller.rb b/app/controllers/story_sheets_controller.rb index cefa5a08..020fee17 100644 --- a/app/controllers/story_sheets_controller.rb +++ b/app/controllers/story_sheets_controller.rb @@ -28,6 +28,7 @@ class StorySheetsController < ApplicationController respond_to do |format| format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @story_sheet.to_json(StorySheet.show_json_opt) } end end diff --git a/app/controllers/system_pictures_controller.rb b/app/controllers/system_pictures_controller.rb index ae6a671e..ad83b275 100644 --- a/app/controllers/system_pictures_controller.rb +++ b/app/controllers/system_pictures_controller.rb @@ -34,6 +34,7 @@ class SystemPicturesController < ApplicationController format.gif { send_data(@system_picture.restore, opt ) } format.jpeg { send_data(@system_picture.restore, opt ) } format.html # show.html.erb + format.prof { render :template => 'top/prof', :layout => true } format.json { render json: @system_picture.to_json(SystemPicture.show_json_opt)} end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4b6a3427..ce88098a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -24,6 +24,10 @@ module ApplicationHelper t(MagicNumber[name][index][0]) end + def item_tag + tag :img, :src => asset_path('item.png'), :width => 35, :height => 35 + end + def icon_tag name, opt = {} title = opt[:object] ? (name.to_s + ' ID:' + opt[:object].id.to_s) : name size = opt[:size] ? opt[:size].to_i : 35 diff --git a/app/views/comics/_list_item.html.erb b/app/views/comics/_list_item.html.erb index 059b7271..73ff51ef 100644 --- a/app/views/comics/_list_item.html.erb +++ b/app/views/comics/_list_item.html.erb @@ -1,5 +1,6 @@ + <%= link_to item_tag, comic_path(comic, :format => :prof) %> <%= link_to comic_icon(:object => comic, :size => 25), comic_path(comic) %> <%= link_to h(truncate(comic.title, :length => 40)), comic_path(comic) %> (<%= comic.stories.size -%>) diff --git a/app/views/comics/show.prof.erb b/app/views/comics/show.prof.erb new file mode 100644 index 00000000..b38609fc --- /dev/null +++ b/app/views/comics/show.prof.erb @@ -0,0 +1,53 @@ +<% @page_title = t('.title') + ':' + @comic.title %> +

<%= t('.title') %>

+

<%= notice %>

+ +

+ <%= t_m 'Comic.title' -%>: + <%= link_to h(@comic.title), comic_path(@comic) %> +

+ +

+ <%= t_m 'Comic.description' -%>: + <%= h(@comic.description) %> +

+ +

+ <%= t_m 'Comic.visible' -%>: + <%= t_selected_item('comic_visible_items', @comic.visible) %> +

+ +

+ <%= t_m 'Comic.author_id' -%>: + <%= link_to h(@comic.author.name), author_path(@comic.author) %> +

+ +<% @comic.stories.each do |story| %> + <% if story.visible? @author -%> +
+ <%= link_to t('stories.show.t', :t => story.disp_t), story_path(story) %> + <%= link_to h(story.title), play_story_path(story) %> +
+ <% end %> +<% end %> +

+ <%= t_m 'Comic.created_at' -%>: + <%= l @comic.created_at %> +

+ +

+ <%= t_m 'Comic.updated_at' -%>: + <%= l @comic.updated_at %> +

+ +<% if @comic.own? @author -%> + <%= link_to t('link.edit'), edit_comic_path(@comic) %> + <%= link_to t('link.destroy'), comic_path(@comic), :method => :delete %> + +

+ <%= t('stories.index.new') %> +

+ <% @story = Story.new -%> + <% @story.supply_default -%> + <% @story.attributes = {:comic_id => @comic.id} -%> +<% end %> diff --git a/app/views/layouts/test.prof.erb b/app/views/layouts/test.prof.erb new file mode 100644 index 00000000..2a17f1d0 --- /dev/null +++ b/app/views/layouts/test.prof.erb @@ -0,0 +1,81 @@ + + + + + <% if @page_title %> + <%= h @page_title %> + <% else %> + <%= t("#{params[:controller]}.#{params[:action]}.title") %> + <% end %> + - <%= h(MagicNumber['profile']['users']['caption']) %> + + <%= stylesheet_link_tag "application" %> + <%= javascript_include_tag "application" %> + <%= raw panel_editor_javascript_include_tags %> + <%= csrf_meta_tags %> + + + +
+ + + + + + + +
+

<%= link_to MagicNumber['profile']['users']['caption'], main_app.root_path %>

+
+ <% if user_signed_in? %> + <%# link_to t('top.metro.title'), '/top/metro' %> + <% end %> + +
+ <% if @author %> + <%= link_to h(truncate(@author.name, :length => 12)), main_app.author_path(@author) %> + <% end %> +
+
+ <% if @artist %> + <%= link_to h(truncate(@artist.name, :length => 12)), main_app.artist_path(@artist) %> + <% end %> +
+
+ <% if user_signed_in? %> + <%= 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 "sign in", main_app.new_user_session_path %> + <% end %> +
+
+<%= yield %> +
+ <%= link_to t('tab.demander.title'), main_app.demanders_path %> + <% if demand_user_signed_in? %> + <%= link_to t_m('Demander'), main_app.demanders_path %> + <%= link_to t('home.sign_out.title'), main_app.destroy_demand_user_session_path, :method => :delete %> + <% else %> + <%= link_to t('home.sign_in.title'), main_app.new_demand_user_session_path %> + <% end %> +
+
+ <%= link_to t('tab.system.title'), '/system' %> + <% if admin_signed_in? %> + <%= link_to t('tab.system.browse'), '/system/browse' %> + <%= link_to t('tab.system.approve'), '/system/waiting_list' %> + <%= link_to t('tab.system.port'), '/system/import' %> + <%= link_to t('tab.system.token'), '/system/auth_token' %> + <%= t('tab.system.layout') %>: + <%= link_to t('tab.system.test'), '/system/test_layout' %> + <%= link_to t('tab.system.production'), '/system/production_layout' %> + <%= link_to t('home.sign_out.title'), main_app.destroy_admin_session_path, :method => :delete %> + <% else %> + <%= link_to t('home.sign_in.title'), main_app.new_admin_session_path %> + <% end %> +
+<%= javascript_tag 'var server_result=' + @server_result.to_json + ';' %> + + + diff --git a/app/views/top/prof.prof.erb b/app/views/top/prof.prof.erb new file mode 100644 index 00000000..c8d5ec22 --- /dev/null +++ b/app/views/top/prof.prof.erb @@ -0,0 +1 @@ +prof diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 8f16e737..0876b143 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -7,3 +7,4 @@ Mime::Type.register_alias "image/png", :png Mime::Type.register_alias "image/gif", :gif Mime::Type.register_alias "image/jpeg", :jpeg Mime::Type.register_alias "application/javascript", :jsonp +Mime::Type.register_alias "text/html", :prof -- 2.11.0