end
before_filter :authenticate_admin!, :only => [:list, :browse]
- def top
- respond_to do |format|
- format.html
- end
- end
-
def index
@page = Comic.page params[:page]
@page_size = Comic.page_size params[:page_size]
@panel.supply_default
respond_to do |format|
- format.html { render layout: 'metro' }
+ format.html
format.js
format.json { render json: @panel.panel_elements_as_json }
end
--- /dev/null
+class TopController < ApplicationController
+ layout 'test' if MagicNumber['test_layout']
+ if MagicNumber['run_mode'] == 0
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
+ else
+ before_filter :authenticate_reader, :only => [:index, :metro]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
+ end
+
+ def index
+ respond_to do |format|
+ format.html
+ end
+ end
+
+ def metro
+ respond_to do |format|
+ format.html { render layout: 'metro' }
+ end
+ end
+
+end
--- /dev/null
+module TopHelper
+end
<div width="100%">\r
<table class="no-border">\r
<tr>\r
- <td width="80%">\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
<%= form_for(@panel) do |f| %>
<%= render 'system/error_explanation', :obj => @panel %>
+ <div class="field">
+ <%= f.label :caption %><br />
+ <%= f.text_field :caption %>
+ </div>
+ <div class="field">
+ <%= f.label :width %><br />
+ <%= f.number_field :width %>
+ </div>
+ <div class="field">
+ <%= f.label :height %><br />
+ <%= f.number_field :height %>
+ </div>
+ <div class="field">
+ <%= f.label :border %><br />
+ <%= f.number_field :border %>
+ </div>
+ <div class="field">
+ <%= f.label :publish %><br />
+ <%= f.collection_select :publish, t_select_items(MagicNumber['panel_visible_items']), :last, :first, :html => {:selected => @panel.publish} %>
+ </div>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
+
+<h2><%= t 'panels.create_from_json' -%></h2>
+<%= form_for(@panel) do |f| %>
+ <%= render 'system/error_explanation', :obj => @panel %>
+
<div>
<label for="json">json data</label>
</div>
<h1><%= t '.title' -%></h1>
<%= render 'form' %>
-<p><%= link_to 'top', root_path %></p>
<h1><%= t '.title' -%></h1>\r
<p id="notice"><%= notice %></p>\r
\r
-<h2><%= t('comics.top.user_resources') -%></h2>\r
+<h2><%= t('top.user_resources') -%></h2>\r
<table>\r
<tr height="100px">\r
<td width="200px" align="center" valign="middle">\r
</td>\r
</tr>\r
</table>\r
-<h2><%= t('comics.top.human_resources') -%></h2>\r
+<h2><%= t('top.human_resources') -%></h2>\r
<table>\r
<tr height="100px">\r
<td width="200px" align="center" valign="middle">\r
</td>\r
</tr>\r
</table>\r
-<h2><%= t('comics.top.system_resources') -%></h2>\r
+<h2><%= t('top.system_resources') -%></h2>\r
<table>\r
<tr height="100px">\r
<td width="200px" align="center" valign="middle">\r
--- /dev/null
+<h1><%= t '.title' -%></h1>\r
+ \r
+ <%= link_to t('top.return'), root_path %>\r
title: ログアウト
sign_in:
title: ログイン
+ top:
+ index:
+ title: 読む・探す
+ metro:
+ title: デスクトップアプリ風metroで体験
+ user_resources: 発表作品から
+ human_resources: 人物から
+ system_resources: システムリソースから
+ return: シンプル版に戻る
comics:
index:
title: コミック一覧
title: コミック 生一覧
browse:
title: コミック 生単票
- top:
- title: 読む・探す
- user_resources: 発表作品から
- human_resources: 人物から
- system_resources: システムリソースから
stories:
index:
title: ストーリー一覧
# Keep in mind you can assign values other than :controller and :action
match 'resource_pictures/:subdir/:id(.:format)/' => 'resource_pictures#show'
match 'pictures/:subdir/:id(.:format)/' => 'pictures#show'
- match 'stories/comic/:id(.:format)' => 'stories#comic'
+ #match 'stories/comic/:id(.:format)' => 'stories#comic'
+ match 'top/(:action)', :controller => 'top'
match 'home/(:action)', :controller => 'home'
match 'system/(:action)', :controller => 'system'
- match 'authors/(:action(/:id))', :controller => 'authors'
+ #match 'authors/(:action(/:id))', :controller => 'authors'
# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
- root :to => 'comics#top'
+ root :to => 'top#index'
# See how all your routes lay out with "rake routes"
--- /dev/null
+require 'spec_helper'
+
+describe TopController do
+
+end
--- /dev/null
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the TopHelper. For example:
+#
+# describe TopHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# helper.concat_strings("this","that").should == "this that"
+# end
+# end
+# end
+describe TopHelper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end