OSDN Git Service

t#32402:add file prof
authoryasushiito <yas@pen-chan.jp>
Tue, 5 Nov 2013 01:58:13 +0000 (10:58 +0900)
committeryasushiito <yas@pen-chan.jp>
Tue, 5 Nov 2013 01:58:13 +0000 (10:58 +0900)
30 files changed:
app/assets/images/item.png [new file with mode: 0644]
app/controllers/artists_controller.rb
app/controllers/authors_controller.rb
app/controllers/balloons_controller.rb
app/controllers/comics_controller.rb
app/controllers/ground_colors_controller.rb
app/controllers/ground_pictures_controller.rb
app/controllers/license_groups_controller.rb
app/controllers/licenses_controller.rb
app/controllers/original_pictures_controller.rb
app/controllers/panel_pictures_controller.rb
app/controllers/panels_controller.rb
app/controllers/pictures_controller.rb
app/controllers/resource_pictures_controller.rb
app/controllers/scroll_panels_controller.rb
app/controllers/scrolls_controller.rb
app/controllers/sheet_panels_controller.rb
app/controllers/sheets_controller.rb
app/controllers/speech_balloon_templates_controller.rb
app/controllers/speech_balloons_controller.rb
app/controllers/speeches_controller.rb
app/controllers/stories_controller.rb
app/controllers/story_sheets_controller.rb
app/controllers/system_pictures_controller.rb
app/helpers/application_helper.rb
app/views/comics/_list_item.html.erb
app/views/comics/show.prof.erb [new file with mode: 0644]
app/views/layouts/test.prof.erb [new file with mode: 0644]
app/views/top/prof.prof.erb [new file with mode: 0644]
config/initializers/mime_types.rb

diff --git a/app/assets/images/item.png b/app/assets/images/item.png
new file mode 100644 (file)
index 0000000..132ca25
Binary files /dev/null and b/app/assets/images/item.png differ
index dbcfab5..d6c4a0a 100644 (file)
@@ -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
index 7f70b72..345c6eb 100644 (file)
@@ -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
index d3c6727..885e055 100644 (file)
@@ -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
index d8729a3..d60fd81 100644 (file)
@@ -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 
index e9456f9..f990f24 100644 (file)
@@ -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
index 9cf4159..16989a0 100644 (file)
@@ -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
index 4433053..5e652a1 100644 (file)
@@ -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
index d30b226..49e1112 100644 (file)
@@ -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
index 2d0b463..6f70a0e 100644 (file)
@@ -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
index 5a98947..69f7cb5 100644 (file)
@@ -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
index 28a03fe..51f7b63 100644 (file)
@@ -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 + ");"
index b8ab99d..d124c9e 100644 (file)
@@ -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
index 1612443..ae83fbd 100644 (file)
@@ -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
index f694433..305638c 100644 (file)
@@ -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
index 62a8413..9c255bd 100644 (file)
@@ -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
index 23320d6..d7a7961 100644 (file)
@@ -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
index 7c63a0b..b7cf892 100644 (file)
@@ -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 
index ab39367..eb8d883 100644 (file)
@@ -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)
       }
index bc5aea8..9350511 100644 (file)
@@ -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
index 1095fdb..24ca971 100644 (file)
@@ -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
index 366c4a8..fba32e6 100644 (file)
@@ -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
index cefa5a0..020fee1 100644 (file)
@@ -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
index ae6a671..ad83b27 100644 (file)
@@ -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
index 4b6a342..ce88098 100644 (file)
@@ -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
index 059b727..73ff51e 100644 (file)
@@ -1,5 +1,6 @@
 <tr>
   <td>
+    <%= 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 (file)
index 0000000..b38609f
--- /dev/null
@@ -0,0 +1,53 @@
+<% @page_title = t('.title') + ':' + @comic.title %>
+<h1><%= t('.title') %></h1>
+<p id="notice"><%= notice %></p>
+
+<p>
+  <b><%= t_m 'Comic.title' -%>:</b>
+  <%= link_to h(@comic.title), comic_path(@comic) %>
+</p>
+
+<p>
+  <b><%= t_m 'Comic.description' -%>:</b>
+  <%= h(@comic.description) %>
+</p>
+
+<p>
+  <b><%= t_m 'Comic.visible' -%>:</b>
+  <%= t_selected_item('comic_visible_items', @comic.visible) %>
+</p>
+
+<p>
+  <b><%= t_m 'Comic.author_id' -%>:</b>
+  <%= link_to h(@comic.author.name), author_path(@comic.author) %>
+</p>
+
+<% @comic.stories.each do |story| %>
+  <% if story.visible? @author -%>
+    <div>
+      <%= link_to t('stories.show.t', :t => story.disp_t), story_path(story) %>
+      <%= link_to h(story.title), play_story_path(story) %>
+    </div>
+  <% end %>
+<% end %>
+<p>
+  <b><%= t_m 'Comic.created_at' -%>:</b>
+  <%= l @comic.created_at %>
+</p>
+
+<p>
+  <b><%= t_m 'Comic.updated_at' -%>:</b>
+  <%= l @comic.updated_at %>
+</p>
+
+<% if @comic.own? @author -%>
+  <%= link_to t('link.edit'), edit_comic_path(@comic) %>
+  <%= link_to t('link.destroy'), comic_path(@comic), :method => :delete %>
+
+  <h2>
+    <%= t('stories.index.new') %>
+  </h2>
+  <% @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 (file)
index 0000000..2a17f1d
--- /dev/null
@@ -0,0 +1,81 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+  <title>\r
+    <% if @page_title %>\r
+      <%= h @page_title %>\r
+    <% else %>\r
+      <%= t("#{params[:controller]}.#{params[:action]}.title") %>\r
+    <% end %>\r
+    - <%= h(MagicNumber['profile']['users']['caption']) %>\r
+  </title>\r
+  <%= stylesheet_link_tag "application" %>\r
+  <%= javascript_include_tag "application" %>\r
+  <%= raw panel_editor_javascript_include_tags %>\r
+  <%= csrf_meta_tags %>\r
+</head>\r
+<body>\r
+\r
+<div width="100%">\r
+<table class="no-border">\r
+  <tr>\r
+    <td width="50%">\r
+      <h3><%= link_to MagicNumber['profile']['users']['caption'], main_app.root_path %></h3>\r
+    </td>\r
+    <td width="30%">\r
+      <% if user_signed_in? %>\r
+        <%# link_to t('top.metro.title'), '/top/metro' %>\r
+      <% end %>\r
+    </td>\r
+    <td>\r
+      <div>\r
+        <% if @author %>\r
+          <%= link_to h(truncate(@author.name, :length => 12)), main_app.author_path(@author) %>\r
+        <% end %>\r
+      </div>\r
+      <div>\r
+        <% if @artist %>\r
+          <%= link_to h(truncate(@artist.name, :length => 12)), main_app.artist_path(@artist) %>\r
+        <% end %>\r
+      </div>\r
+    </td>\r
+    <td>\r
+      <% if user_signed_in? %>\r
+        <%= link_to t('home.configure.title'), '/home/configure' %>\r
+        <%= link_to t('home.sign_out.title'), main_app.destroy_user_session_path, :method => :delete %>\r
+      <% else %>\r
+        <%= link_to "sign in", main_app.new_user_session_path %>\r
+      <% end %>\r
+  </td>\r
+  </tr>\r
+</table>\r
+</div>\r
+<%= yield %>\r
+<div width="100%" style="background-color: #faddfa; padding: 5px;">\r
+  <%= link_to t('tab.demander.title'), main_app.demanders_path %>\r
+  <% if demand_user_signed_in? %>\r
+    <%= link_to t_m('Demander'), main_app.demanders_path %>\r
+    <%= link_to t('home.sign_out.title'), main_app.destroy_demand_user_session_path, :method => :delete %>\r
+  <% else %>\r
+    <%= link_to t('home.sign_in.title'), main_app.new_demand_user_session_path %>\r
+  <% end %>\r
+</div>\r
+<div width="100%" style="background-color: #ddddfa; padding: 5px;">\r
+  <%= link_to t('tab.system.title'), '/system' %>\r
+  <% if admin_signed_in? %>\r
+    <%= link_to t('tab.system.browse'), '/system/browse' %>\r
+    <%= link_to t('tab.system.approve'), '/system/waiting_list' %>\r
+    <%= link_to t('tab.system.port'), '/system/import' %>\r
+    <%= link_to t('tab.system.token'), '/system/auth_token' %>\r
+    <%= t('tab.system.layout') %>:\r
+    <%= link_to t('tab.system.test'), '/system/test_layout' %>\r
+    <%= link_to t('tab.system.production'), '/system/production_layout' %>\r
+    <%= link_to t('home.sign_out.title'), main_app.destroy_admin_session_path, :method => :delete %>\r
+  <% else %>\r
+    <%= link_to t('home.sign_in.title'), main_app.new_admin_session_path %>\r
+  <% end %>\r
+</div>\r
+<%= javascript_tag 'var server_result=' + @server_result.to_json + ';' %>\r
+\r
+</body>\r
+</html>\r
diff --git a/app/views/top/prof.prof.erb b/app/views/top/prof.prof.erb
new file mode 100644 (file)
index 0000000..c8d5ec2
--- /dev/null
@@ -0,0 +1 @@
+prof\r
index 8f16e73..0876b14 100644 (file)
@@ -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