class ColorsController < ApplicationController
layout 'test' if MagicNumber['test_layout']
+ before_filter :authenticate_admin!, :only => [:list]
# GET /colors
# GET /colors.json
format.json { render json: @colors.to_json(Color.list_json_opt) }
end
end
+
+ def list
+ @colors = Color.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }# index.html.erb
+ format.json { render json: @colors }
+ end
+ end
end
-<h1>Listing Colors</h1>
+<h1><%= t '.title' -%></h1>
<table>
- <tr>
- <th>id</th>
- <th>name</th>
- <th>code</th>
- <th>t</th>
- </tr>
-
<% @colors.each do |c| %>
<tr>
- <td><%= c.id %></td>
- <td><%= h c.name %></td>
- <td><%= c.code %><font color="<%= c.code %>">*****</font></td>
- <td><%= c.t %></td>
+ <td style="color: #<%= format("%06x", c.code ^ 0xffffff) -%>; background-color: #<%= format("%06x", c.code) -%>;"><%= h c.name %></td>
</tr>
<% end -%>
</table>
--- /dev/null
+<h1><%= t '.title' -%></h1>
+
+<table>
+ <tr>
+ <th><%= t_m 'Color.id' -%></th>
+ <th><%= t_m 'Color.name' -%></th>
+ <th><%= t_m 'Color.code' -%></th>
+ <th><%= t_m 'Color.code' -%></th>
+ <th><%= t_m 'Color.t' -%></th>
+ <th><%= t_m 'Color.created_at' -%></th>
+ <th><%= t_m 'Color.updated_at' -%></th>
+ </tr>
+
+<% @colors.each do |c| %>
+ <tr>
+ <td><%= c.id %></td>
+ <td><%= h c.name %></td>
+ <td><%= c.code %></td>
+ <td style="background-color: #<%= format("%06x", c.code) -%>;"></td>
+ <td><%= c.t %></td>
+ <td><%= l c.created_at %></td>
+ <td><%= l c.updated_at %></td>
+ </tr>
+<% end -%>
+</table>
</div>
<% when 'PanelColor' %>
- <div id="panel-color<%= elm.id -%>" class="pettanr-comic-panel-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:#<%= format("%x", elm.code) -%>;">
+ <div id="panel-color<%= elm.id -%>" class="pettanr-comic-panel-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:#<%= format("%06x", elm.code) -%>;">
</div>
<% when 'GroundPicture' %>
+++ /dev/null
-<%= form_for(@speech_balloon_template) do |f| %>
- <% if @speech_balloon_template.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@speech_balloon_template.errors.count, "error") %> prohibited this speech_balloon_template from being saved:</h2>
-
- <ul>
- <% @speech_balloon_template.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <div class="actions">
- <%= f.submit %>
- </div>
-<% end %>
+<h1><%= t '.title' -%></h1>
<p id="notice"><%= notice %></p>
<p>
- <b>Name:</b>
+ <b><%= t_m 'SpeechBalloonTemplate.id' -%>:</b>
+ <%= h @speech_balloon_template.id %>
+</p>
+
+<p>
+ <b><%= t_m 'SpeechBalloonTemplate.name' -%>:</b>
<%= h @speech_balloon_template.name %>
</p>
<p>
- <b>classname:</b>
+ <b><%= t_m 'SpeechBalloonTemplate.classname' -%>:</b>
<%= h @speech_balloon_template.classname %>
</p>
<p>
- <b>caption:</b>
+ <b><%= t_m 'SpeechBalloonTemplate.caption' -%>:</b>
<%= h @speech_balloon_template.caption %>
</p>
<p>
- <b>t:</b>
+ <b><%= t_m 'SpeechBalloonTemplate.t' -%>:</b>
<%= @speech_balloon_template.t %>
</p>
<p>
- <b>settings:</b>
+ <b><%= t_m 'SpeechBalloonTemplate.settings' -%>:</b>
<%= h @speech_balloon_template.settings %>
</p>
-<%= link_to 'Back', :action => :list %>
+<p>
+ <b><%= t_m 'SpeechBalloonTemplate.created_at' -%>:</b>
+ <%= l @speech_balloon_template.created_at %>
+</p>
+
+<p>
+ <b><%= t_m 'SpeechBalloonTemplate.updated_at' -%>:</b>
+ <%= l @speech_balloon_template.updated_at %>
+</p>
+
+<%= link_to t('link.back'), :action => :list %>
-<h1>Listing speach balloon template</h1>
+<h1><%= t '.title' -%></h1>
+
<table>
<tr>
- <th>Name</th>
+ <th><%= t_m 'SpeechBalloonTemplate.caption' -%></th>
</tr>
-<% @speech_balloon_templates.each do |st| %>
- <tr>
- <td><%= h st.caption %></td>
- </tr>
-<% end %>
+ <% @speech_balloon_templates.each do |st| %>
+ <tr>
+ <td><%= link_to h(st.caption), speech_balloon_template_path(st) %></td>
+ </tr>
+ <% end %>
</table>
-<h1>Listing speech_balloon_templates</h1>
-<table>
- <tr>
- <th>id</th>
- <th>Name</th>
- <th>classname</th>
- <th>caption</th>
- <th>t</th>
- <th>created_at</th>
- <th>updated_at</th>
- <th></th>
- </tr>
+<h1><%= t '.title' -%></h1>
-<% @speech_balloon_templates.each do |speech_balloon_template| %>
+<table>
<tr>
- <td><%= link_to speech_balloon_template.id, :action => :browse, :id => speech_balloon_template.id %></td>
- <td><%= h speech_balloon_template.name %></td>
- <td><%= h speech_balloon_template.classname %></td>
- <td><%= h speech_balloon_template.caption %></td>
- <td><%= speech_balloon_template.t %></td>
- <td><%= speech_balloon_template.created_at %></td>
- <td><%= speech_balloon_template.updated_at %></td>
- <td>
- <%= link_to 'Destroy', speech_balloon_template, confirm: 'Are you sure?', method: :delete %>
- </td>
+ <th><%= t_m 'SpeechBalloonTemplate.id' -%></th>
+ <th><%= t_m 'SpeechBalloonTemplate.name' -%></th>
+ <th><%= t_m 'SpeechBalloonTemplate.classname' -%></th>
+ <th><%= t_m 'SpeechBalloonTemplate.caption' -%></th>
+ <th><%= t_m 'SpeechBalloonTemplate.t' -%></th>
+ <th><%= t_m 'SpeechBalloonTemplate.settings' -%></th>
+ <th><%= t_m 'SpeechBalloonTemplate.created_at' -%></th>
+ <th><%= t_m 'SpeechBalloonTemplate.updated_at' -%></th>
</tr>
-<% end %>
+ <% @speech_balloon_templates.each do |speech_balloon_template| %>
+ <tr>
+ <td><%= link_to speech_balloon_template.id, browse_speech_balloon_template_path(speech_balloon_template) %></td>
+ <td>
+ <%= h(truncate(speech_balloon_template.name, :length => 16)) %>
+ </td>
+ <td>
+ <%= h(truncate(speech_balloon_template.classname, :length => 16)) %>
+ </td>
+ <td>
+ <%= h(truncate(speech_balloon_template.caption, :length => 16)) %>
+ </td>
+ <td>
+ <%= speech_balloon_template.t %>
+ </td>
+ <td>
+ <%= h(truncate(speech_balloon_template.settings, :length => 10)) %>
+ </td>
+ <td>
+ <%= l speech_balloon_template.created_at %>
+ </td>
+ <td>
+ <%= l speech_balloon_template.updated_at %>
+ </td>
+ </tr>
+ <% end -%>
</table>
+<h1><%= t '.title' -%></h1>
<p id="notice"><%= notice %></p>
<p>
- <b>Name:</b>
- <%= h @speech_balloon_template.name %>
-</p>
-
-<p>
- <b>classname:</b>
- <%= h @speech_balloon_template.classname %>
-</p>
-
-<p>
<b>caption:</b>
<%= h @speech_balloon_template.caption %>
</p>
-<p>
- <b>t:</b>
- <%= @speech_balloon_template.t %>
-</p>
-
-<p>
- <b>settings:</b>
- <%= h @speech_balloon_template.settings %>
-</p>
-
-<%= link_to 'Back', speech_balloon_templates_path %>
+<%= link_to t('link.back'), speech_balloon_templates_path %>
<%= link_to 'system_pictures', :controller => 'system_pictures', :action => :list %>
</td>
</tr>
+ <tr>
+ <td>
+ <%= link_to 'colors', :controller => 'colors', :action => :list %>
+ </td>
+ </tr>
</table>
</div>
+<h1><%= t '.title' -%></h1>
<p id="notice"><%= notice %></p>
+<%= link_to tag(:img, :src => @system_picture.url), @system_picture.url %>
<p>
- <b>Ext:</b>
+ <b><%= t_m 'SystemPicture.id' -%>:</b>
+ <%= @system_picture.id %>
+</p>
+
+<p>
+ <b><%= t_m 'SystemPicture.ext' -%>:</b>
<%= @system_picture.ext %>
</p>
<p>
- <b>Width:</b>
+ <b><%= t_m 'SystemPicture.width' -%>:</b>
<%= @system_picture.width %>
</p>
<p>
- <b>Height:</b>
+ <b><%= t_m 'SystemPicture.height' -%>:</b>
<%= @system_picture.height %>
</p>
<p>
- <b>filesize:</b>
+ <b><%= t_m 'SystemPicture.filesize' -%>:</b>
<%= @system_picture.filesize %>
</p>
-<img src="<%= @system_picture.url -%>">
+<p>
+ <b><%= t_m 'SystemPicture.md5' -%>:</b>
+ <%= @system_picture.md5 %>
+</p>
<p>
-<a href="<%= @system_picture.url %>">browse picture</a>
+ <b><%= t_m 'SystemPicture.created_at' -%>:</b>
+ <%= @system_picture.created_at %>
</p>
-<% if admin_signed_in? -%>
+
<p>
-Replace picture
+ <b><%= t_m 'SystemPicture.updated_at' -%>:</b>
+ <%= @system_picture.updated_at %>
</p>
- <%= form_for(@system_picture, :html => { :multipart => true }) do |f| %>
- <label for="file">File to Upload</label> <%= f.file_field "file" %>
- <div class="actions">
- <%= f.submit 'replace' %>
- </div>
- <% end %>
-<% end -%>
-<%= link_to 'Back', :action => :list %>
+<%= link_to t('link.back'), :action => :list %>
-<h1>Listing system_pictures</h1>
-
-<% if admin_signed_in? -%>
- <%= form_tag( {:action => "create"} , { :multipart => true }) do %>
- <label for="file">File to Upload</label> <%= file_field_tag "system_picture[file]" %>
- <%= submit_tag 'upload' -%>
- <% end -%>
-<% end -%>
+<h1><%= t '.title' -%></h1>
<table>
<tr>
- <th>Ext</th>
- <th>Width</th>
- <th>Height</th>
- <th>filesize</th>
<th></th>
+ <th><%= t_m 'SystemPicture.ext' -%></th>
+ <th><%= t_m 'SystemPicture.width' -%>x<%= t_m 'SystemPicture.height' -%></th>
+ <th><%= t_m 'SystemPicture.filesize' -%></th>
</tr>
<% @system_pictures.each do |system_picture| %>
<tr>
- <td><%= system_picture.ext %></td>
- <td><%= system_picture.width %></td>
- <td><%= system_picture.height %></td>
+ <td><%= link_to tag(:img, :src => system_picture.url), system_picture.url %>(<%= link_to system_picture.id, system_picture_path(system_picture) %>)</td>
+ <td><%= h system_picture.ext %></td>
+ <td><%= system_picture.width %>x<%= system_picture.height %></td>
<td><%= system_picture.filesize %></td>
- <td><%= link_to 'Show', system_picture %></td>
- <td>
- <% if admin_signed_in? -%>
- <%= link_to 'Destroy', system_picture, confirm: 'Are you sure?', method: :delete %>
- <% end -%>
- </td>
</tr>
<% end %>
</table>
-<h1>Listing system_pictures</h1>
-
-<%= form_tag( {:action => "create"} , { :multipart => true }) do %>
- <label for="file">File to Upload</label> <%= file_field_tag "system_picture[file]" %>
- <%= submit_tag 'upload' -%>
-<% end -%>
+<h1><%= t '.title' -%></h1>
<table>
<tr>
- <th>id</th>
- <th>Ext</th>
- <th>Width</th>
- <th>Height</th>
- <th>filesize</th>
- <th>created_at</th>
- <th>updated_at</th>
<th></th>
+ <th><%= t_m 'SystemPicture.id' -%></th>
+ <th><%= t_m 'SystemPicture.ext' -%></th>
+ <th><%= t_m 'SystemPicture.width' -%></th>
+ <th><%= t_m 'SystemPicture.height' -%></th>
+ <th><%= t_m 'SystemPicture.filesize' -%></th>
+ <th><%= t_m 'SystemPicture.md5' -%></th>
+ <th><%= t_m 'SystemPicture.created_at' -%></th>
+ <th><%= t_m 'SystemPicture.updated_at' -%></th>
</tr>
<% @system_pictures.each do |system_picture| %>
<tr>
- <td><%= link_to system_picture.id, :action => :browse, :id => system_picture.id %></td>
- <td><%= system_picture.ext %></td>
+ <td><%= link_to tag(:img, :src => system_picture.url), system_picture.url %></td>
+ <td><%= link_to system_picture.id, browse_system_picture_path(system_picture) %></td>
+ <td><%= h system_picture.ext %></td>
<td><%= system_picture.width %></td>
<td><%= system_picture.height %></td>
<td><%= system_picture.filesize %></td>
- <td><%= system_picture.created_at %></td>
- <td><%= system_picture.updated_at %></td>
- <td>
- <%= link_to 'Destroy', system_picture, confirm: 'Are you sure?', method: :delete %>
- </td>
+ <td><%= h system_picture.md5 %></td>
+ <td><%= l system_picture.created_at %></td>
+ <td><%= l system_picture.updated_at %></td>
</tr>
<% end %>
</table>
+++ /dev/null
-<%= form_tag( {:controller => 'system_pictures',:action => "create"} , { :multipart => true }) do %>
- <label for="file">File to Upload</label> <%= file_field_tag "system_picture[file]" %>
- <%= submit_tag 'upload' -%>
-<% end -%>
+<h1><%= t '.title' -%></h1>
<p id="notice"><%= notice %></p>
+<%= link_to tag(:img, :src => @system_picture.url), @system_picture.url %>
+
<p>
- <b>Ext:</b>
+ <b><%= t_m 'SystemPicture.ext' -%>:</b>
<%= @system_picture.ext %>
</p>
<p>
- <b>Width:</b>
+ <b><%= t_m 'SystemPicture.width' -%>:</b>
<%= @system_picture.width %>
</p>
<p>
- <b>Height:</b>
+ <b><%= t_m 'SystemPicture.height' -%>:</b>
<%= @system_picture.height %>
</p>
<p>
- <b>filesize:</b>
+ <b><%= t_m 'SystemPicture.filesize' -%>:</b>
<%= @system_picture.filesize %>
</p>
-<img src="<%= @system_picture.url -%>">
+<p>
+ <b><%= t_m 'SystemPicture.md5' -%>:</b>
+ <%= h @system_picture.md5 %>
+</p>
<p>
-<a href="<%= @system_picture.url %>">browse picture</a>
+ <b><%= t_m 'SystemPicture.created_at' -%>:</b>
+ <%= l @system_picture.created_at %>
</p>
-<% if admin_signed_in? -%>
+
<p>
-Replace picture
+ <b><%= t_m 'SystemPicture.updated_at' -%>:</b>
+ <%= l @system_picture.updated_at %>
</p>
- <%= form_for(@system_picture, :html => { :multipart => true }) do |f| %>
- <label for="file">File to Upload</label> <%= f.file_field "file" %>
- <div class="actions">
- <%= f.submit 'replace' %>
- </div>
- <% end %>
-<% end -%>
-
-<%= link_to 'Back', system_pictures_path %>
+
+<%= link_to t('link.back'), system_pictures_path %>
get :index
get :show
get :list
- get :browse
end
member do
+ get :browse
delete :destroy
end
end
resources :colors do
collection do
get :index
+ get :list
end
member do
end
collection do
get :index
get :show
- post :create
get :list
- get :browse
end
member do
- put :update
+ get :browse
delete :destroy
end
end