class ArtistsController < ApplicationController
+ before_filter :authenticate_author!, :only => [:index, :show, :create, :update, :destroy]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
+
# GET /artists
# GET /artists.json
def index
end
end
+ def list
+ @artists = Artist.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @artists }
+ end
+ end
+
+ def browse
+ @artist = Artist.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @artist }
+ end
+ end
+
# GET /artists/new
# GET /artists/new.json
def new
class BalloonTemplatesController < ApplicationController
- before_filter :authenticate_admin!, :except => [:index]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /balloon_templates
# GET /balloon_templates.json
format.json { render json: @balloon_templates }
end
end
+
+ def list
+ @balloon_templates = BalloonTemplate.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @balloon_templates }
+ end
+ end
end
class BalloonsController < ApplicationController
- before_filter :authenticate_user!, :except => [:index]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
+
# GET /balloons
# GET /balloons.json
def index
end
end
-=begin
- # GET /balloons/1
- # GET /balloons/1.json
- def show
- @balloon = Balloon.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @balloon }
- end
- end
-
- # GET /balloons/new
- # GET /balloons/new.json
- def new
- @balloon = Balloon.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @balloon }
- end
- end
-
- # GET /balloons/1/edit
- def edit
- @balloon = Balloon.find(params[:id])
- end
-
- # POST /balloons
- # POST /balloons.json
- def create
- @balloon = Balloon.new(params[:balloon])
-
- respond_to do |format|
- if @balloon.save
- format.html { redirect_to @balloon, notice: 'Balloon was successfully created.' }
- format.json { render json: @balloon, status: :created, location: @balloon }
- else
- format.html { render action: "new" }
- format.json { render json: @balloon.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PUT /balloons/1
- # PUT /balloons/1.json
- def update
- @balloon = Balloon.find(params[:id])
-
- respond_to do |format|
- if @balloon.update_attributes(params[:balloon])
- format.html { redirect_to @balloon, notice: 'Balloon was successfully updated.' }
- format.json { head :ok }
- else
- format.html { render action: "edit" }
- format.json { render json: @balloon.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # DELETE /balloons/1
- # DELETE /balloons/1.json
- def destroy
- @balloon = Balloon.find(params[:id])
- @balloon.destroy
+ def list
+ @balloons = Balloon.all
respond_to do |format|
- format.html { redirect_to balloons_url }
- format.json { head :ok }
+ format.html { render layout: 'system' }
+ format.json { render json: @balloons }
end
end
-=end
end
class ComicsController < ApplicationController
- before_filter :authenticate_author!, :except => [:index, :show, :play]
+ before_filter :authenticate_author!, :only => [:top, :index, :show, :play, :create, :update, :destroy]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
private
public
def top
+ @comics = Comic.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ end
end
# GET /comics
# GET /comics.json
def index
- @comics = Comic.all
+ @comics = Comic.find(:all,
+ :include => :author, :conditions => ['visible = 1'], :order => 'updated_at desc', :limit => 20
+ )
respond_to do |format|
format.html # index.html.erb
@comic = Comic.find(params[:id])
respond_to do |format|
- format.html # show.html.erb
+# format.html # show.html.erb
format.json { render json: @comic }
end
end
def play
- @comic = Comic.find(params[:id], include: {:panels => [:panel_pictures => :resource_picture, :balloons => :speaches]}, order: 'panels.t')
+ @comic = Comic.find(params[:id], include: [:author, {:panels => [:panel_pictures => :resource_picture, :balloons => :speaches]}], order: 'panels.t')
respond_to do |format|
format.html # index.html.erb
format.json {
render :json => @comic.to_json(
- :include => {
+ :include => [:author, {
:panels => {:include => {
:panel_pictures => {:include => :resource_picture},
:balloons => {:include => :speaches}
}}
- }
+ }]
)
}
format.jsonp {
end
end
+ def list
+ @comics = Comic.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }# index.html.erb
+ format.json { render json: @comics }
+ end
+ end
+
+ def browse
+ @comic = Comic.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' } # show.html.erb
+ format.json { render json: @comic }
+ end
+ end
+
# GET /comics/new
# GET /comics/new.json
def new
class CommonLisencesController < ApplicationController
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse, :new, :edit, :create, :update, :destroy]
+
# GET /common_lisences
# GET /common_lisences.json
def index
end
end
+ def list
+ @common_lisences = CommonLisence.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @common_lisences }
+ end
+ end
+
+ def browse
+ @common_lisence = CommonLisence.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @common_lisence }
+ end
+ end
+
# GET /common_lisences/new
# GET /common_lisences/new.json
def new
respond_to do |format|
CommonLisence.transaction do
if @common_lisence.save_save
- format.html { redirect_to @common_lisence, notice: 'Common lisence was successfully created.' }
+ format.html { redirect_to :action => :browse, :id => @common_lisence.id, notice: 'Common lisence was successfully created.' }
format.json { render json: @common_lisence, status: :created, location: @common_lisence }
else
format.html { render action: "new" }
respond_to do |format|
if @common_lisence.update_attributes(params[:common_lisence])
- format.html { redirect_to @common_lisence, notice: 'Common lisence was successfully updated.' }
+ format.html { redirect_to :action => :browse, :id => @common_lisence.id, notice: 'Common lisence was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
class LisencesController < ApplicationController
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
+
# GET /lisences
# GET /lisences.json
def index
# GET /lisences/1.json
def show
@lisence = Lisence.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @lisence }
- end
- end
-
- # GET /lisences/new
- # GET /lisences/new.json
- def new
- @lisence = Lisence.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @lisence }
- end
- end
-
- # GET /lisences/1/edit
- def edit
- @lisence = Lisence.find(params[:id])
- end
-
- # POST /lisences
- # POST /lisences.json
- def create
- @lisence = Lisence.new(params[:lisence])
-
- respond_to do |format|
- if @lisence.save
- format.html { redirect_to @lisence, notice: 'Lisence was successfully created.' }
- format.json { render json: @lisence, status: :created, location: @lisence }
- else
- format.html { render action: "new" }
- format.json { render json: @lisence.errors, status: :unprocessable_entity }
- end
+ if @lisence.common_lisence
+ redirect_to :controller => 'common_lisences', :action => :browse, :id => @lisence.common_lisence.id
+ else
+ redirect_to :controller => 'original_lisences', :action => :browse, :id => @lisence.original_lisence.id
end
end
- # PUT /lisences/1
- # PUT /lisences/1.json
- def update
- @lisence = Lisence.find(params[:id])
+ def list
+ @lisences = Lisence.all
respond_to do |format|
- if @lisence.update_attributes(params[:lisence])
- format.html { redirect_to @lisence, notice: 'Lisence was successfully updated.' }
- format.json { head :ok }
- else
- format.html { render action: "edit" }
- format.json { render json: @lisence.errors, status: :unprocessable_entity }
- end
+ format.html { render layout: 'system' }
+ format.json { render json: @lisences }
end
end
- # DELETE /lisences/1
- # DELETE /lisences/1.json
- def destroy
+ def browse
@lisence = Lisence.find(params[:id])
- @lisence.destroy
respond_to do |format|
- format.html { redirect_to lisences_url }
- format.json { head :ok }
+ format.html { render layout: 'system' }
+ format.json { render json: @lisence }
end
end
end
class OriginalLisencesController < ApplicationController
- before_filter :authenticate_author!, :except => [:index]
+ before_filter :authenticate_author!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /original_lisences
# GET /original_lisences.json
end
end
+ def list
+ @original_lisences = OriginalLisence.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @original_lisences }
+ end
+ end
+
+ def browse
+ @original_lisence = OriginalLisence.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @original_lisence }
+ end
+ end
+
# GET /original_lisences/new
# GET /original_lisences/new.json
def new
class OriginalPicturesController < ApplicationController
- before_filter :authenticate_author!, :except => [:index, :show]
+ before_filter :authenticate_author!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
private
# GET /original_pictures
# GET /original_pictures.json
def index
- @original_pictures = OriginalPicture.all
+ @original_pictures = OriginalPicture.find(:all,
+ :include => [:artist, :lisence, :resource_picture], :order => 'updated_at', :limit => 20
+ )
respond_to do |format|
format.html # index.html.erb
- format.json { render json: @original_pictures }
+ format.json { render :json => @original_pictures.to_json(
+ :include => [:resource_picture, :artist, :lisence]
+ ) }
end
end
end
end
+ def list
+ @original_pictures = OriginalPicture.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @original_pictures }
+ end
+ end
+
+ def browse
+ @original_picture = OriginalPicture.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @original_picture }
+ end
+ end
+
def refresh
@original_picture = OriginalPicture.find(params[:id])
img = Magick::Image.from_blob(@original_picture.restore).shift
@original_picture = OriginalPicture.new
img = set_image params
@original_picture.artist_id = current_author.artist.id
+ @original_picture.lisence_id = current_author.artist.default_lisence_id
respond_to do |format|
OriginalPicture.transaction do
class PanelPicturesController < ApplicationController
- before_filter :authenticate_author!, :except => [:index]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /panel_pictures
# GET /panel_pictures.json
end
end
+ def list
+ @panel_pictures = PanelPicture.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @panel_pictures }
+ end
+ end
+
end
class PanelsController < ApplicationController
- before_filter :authenticate_author!, :except => [:index, :show]
+ before_filter :authenticate_author!, :only => [:index, :show, :create, :update, :destroy]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
private
# GET /panels
# GET /panels.json
def index
- @panels = Panel.all :order => 'updated_at'
+ @panels = Panel.find(:all, :include => [:comic, :author], :order => 'updated_at', :limit => 20)
respond_to do |format|
format.html # index.html.erb
- format.json { render json: @panels }
+ format.json { render :json => @panels.to_json(
+ :include => [:comic, :author]
+ ) }
end
end
# format.json { render :json => @frame.to_json(include: {
# :comic => {:only => :title}, :panel_pictures => {:include => {:image => {:only => [:width]}},:only => [:width, :height, :z, :image_id]}
# }, only: [:border]) }
- end
+ end
end
- # GET /panels/new
- # GET /panels/new.json
- def new
- @panel = Panel.new
+ def list
+ @panels = Panel.all :order => 'updated_at'
respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @panel }
+ format.html { render layout: 'system' }
+ format.json { render json: @panels }
end
end
- # GET /panels/1/edit
- def edit
+ def browse
@panel = Panel.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ end
end
# POST /panels
class ResourcePicturesController < ApplicationController
- before_filter :authenticate_author!, :except => [:index, :show]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /resource_pictures
# GET /resource_pictures.json
def index
- @resource_pictures = ResourcePicture.all
+ @resource_pictures = ResourcePicture.find(:all,
+ :include => {:original_picture => [:artist, :lisence]}, :order => 'updated_at', :limit => 20
+ )
respond_to do |format|
format.html # index.html.erb
- format.json { render json: @resource_pictures }
+ format.json { render :json => @resource_pictures.to_json(
+ :include => [:original_picture, :artist, :lisence]
+ ) }
end
end
end
end
-=begin
- # GET /resource_pictures/new
- # GET /resource_pictures/new.json
- def new
- @resource_picture = ResourcePicture.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @resource_picture }
- end
- end
-
- # GET /resource_pictures/1/edit
- def edit
- @resource_picture = ResourcePicture.find(params[:id])
- end
-
- # POST /resource_pictures
- # POST /resource_pictures.json
- def create
- @resource_picture = ResourcePicture.new(params[:resource_picture])
+ def list
+ @resource_pictures = ResourcePicture.all
respond_to do |format|
- if @resource_picture.save
- format.html { redirect_to @resource_picture, notice: 'Resource picture was successfully created.' }
- format.json { render json: @resource_picture, status: :created, location: @resource_picture }
- else
- format.html { render action: "new" }
- format.json { render json: @resource_picture.errors, status: :unprocessable_entity }
- end
+ format.html { render layout: 'system' }
+ format.json { render json: @resource_pictures }
end
end
- # PUT /resource_pictures/1
- # PUT /resource_pictures/1.json
- def update
+ def browse
@resource_picture = ResourcePicture.find(params[:id])
respond_to do |format|
- if @resource_picture.update_attributes(params[:resource_picture])
- format.html { redirect_to @resource_picture, notice: 'Resource picture was successfully updated.' }
- format.json { head :ok }
- else
- format.html { render action: "edit" }
- format.json { render json: @resource_picture.errors, status: :unprocessable_entity }
- end
+ format.html { render layout: 'system' }
+ format.json { render json: @resource_picture }
end
end
- # DELETE /resource_pictures/1
- # DELETE /resource_pictures/1.json
- def destroy
- @resource_picture = ResourcePicture.find(params[:id])
- @resource_picture.destroy
-
- respond_to do |format|
- format.html { redirect_to resource_pictures_url }
- format.json { head :ok }
- end
- end
-=end
end
class SpeachBalloonsController < ApplicationController
- before_filter :authenticate_author!, :only => [:index]
- before_filter :authenticate_admin!, :except => [:index]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse, :create, :update, :destroy]
private
res
end
- public # GET /speach_balloons
+ public
+ # GET /speach_balloons
# GET /speach_balloons.json
def index
@speach_balloons = SpeachBalloon.all
end
end
- # GET /speach_balloons/new
- # GET /speach_balloons/new.json
- def new
- @speach_balloon = SpeachBalloon.new
+ def list
+ @speach_balloons = SpeachBalloon.all
respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @speach_balloon }
+ format.html { render layout: 'system' }
+ format.json { render json: @speach_balloons }
end
end
- # GET /speach_balloons/1/edit
- def edit
+ def browse
@speach_balloon = SpeachBalloon.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @speach_balloon }
+ end
end
# POST /speach_balloons
class SpeachTemplatesController < ApplicationController
- before_filter :authenticate_admin!, :except => [:index]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /speach_templates
# GET /speach_templates.json
end
end
+ def list
+ @speach_templates = SpeachTemplate.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @speach_templates }
+ end
+ end
+
end
class SpeachesController < ApplicationController
- before_filter :authenticate_author!, :except => [:index]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /speaches
# GET /speaches.json
end
end
-=begin
- # GET /speaches/1
- # GET /speaches/1.json
- def show
- @speach = Speach.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @speach }
- end
- end
-
- # GET /speaches/new
- # GET /speaches/new.json
- def new
- @speach = Speach.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @speach }
- end
- end
-
- # GET /speaches/1/edit
- def edit
- @speach = Speach.find(params[:id])
- end
-
- # POST /speaches
- # POST /speaches.json
- def create
- @speach = Speach.new(params[:speach])
-
- respond_to do |format|
- if @speach.save
- format.html { redirect_to @speach, notice: 'Speach was successfully created.' }
- format.json { render json: @speach, status: :created, location: @speach }
- else
- format.html { render action: "new" }
- format.json { render json: @speach.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PUT /speaches/1
- # PUT /speaches/1.json
- def update
- @speach = Speach.find(params[:id])
-
- respond_to do |format|
- if @speach.update_attributes(params[:speach])
- format.html { redirect_to @speach, notice: 'Speach was successfully updated.' }
- format.json { head :ok }
- else
- format.html { render action: "edit" }
- format.json { render json: @speach.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # DELETE /speaches/1
- # DELETE /speaches/1.json
- def destroy
- @speach = Speach.find(params[:id])
- @speach.destroy
+ def list
+ @speaches = Speach.all
respond_to do |format|
- format.html { redirect_to speaches_url }
- format.json { head :ok }
+ format.html { render layout: 'system' }
+ format.json { render json: @speaches }
end
end
-=end
end
class SystemController < ApplicationController
before_filter :authenticate_admin!, :except => [:start]
- layout false, :only => :start
+
+ #layout :system
def start
def index
end
+ def browse
+ end
+
+ def auth_token
+ end
+
+ def approbe
+ end
+
def waiting_list
@newadmins = Admin.find(:all, :conditions => ['activate = 0'])
end
class SystemPicturesController < ApplicationController
- before_filter :authenticate_admin!, :except => [:index, :show]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse, :create, :update, :destroy]
private
end
end
- # GET /system_pictures/new
- # GET /system_pictures/new.json
- def new
- @system_picture = SystemPicture.new
+ def list
+ @system_pictures = SystemPicture.all
respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @system_picture }
+ format.html { render layout: 'system' }
+ format.json { render json: @system_pictures }
end
end
- # GET /system_pictures/1/edit
- def edit
+ def browse
@system_picture = SystemPicture.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @system_picture}
+ end
end
+
# POST /system_pictures
# POST /system_pictures.json
def create
class Comic < ActiveRecord::Base
has_many :panels, :dependent => :destroy
+ belongs_to :author
def own? author
return false unless author
self.author_id == author.id
end
+ def disp_editable
+ editable == 1 ? 'O' : 'X'
+ end
+
end
class Panel < ActiveRecord::Base
belongs_to :comic
+ belongs_to :author
has_many :panel_pictures, :dependent => :destroy
has_many :balloons, :dependent => :destroy
accepts_nested_attributes_for :panel_pictures, :allow_destroy => true
resource_picture = ResourcePicture.new(
width: original_picture.width, height: original_picture.height,
ext: original_picture.ext, filesize: original_picture.filesize,
- original_picture_id: original_picture.id
+ original_picture_id: original_picture.id, artist_id: original_picture.artist_id,
+ lisence_id: original_picture.lisence_id
)
res = if resource_picture.save
if resource_picture.store(img)
<h1>Listing comics</h1>
-<table>
- <tr>
- <th>id</th>
- <th>Title</th>
- <th>width</th>
- <th>height</th>
- <th>visible</th>
- <th>editable</th>
- <th>author_id</th>
- <th>updated_at</th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
-
<% @comics.each do |comic| %>
- <tr>
- <td><%= comic.id %></td>
- <td><%= h comic.title %></td>
- <td><%= comic.width %></td>
- <td><%= comic.height %></td>
- <td><%= comic.visible %></td>
- <td><%= comic.editable %></td>
- <td><%= comic.author_id%></td>
- <td><%= comic.updated_at %></td>
- <td><%= link_to 'Show', comic %></td>
- <td><%= link_to 'Play', :action => :play, :id => comic.id %></td>
- <td>
- <% if author_signed_in? -%>
- <% if comic.own? current_author -%>
- <%= link_to 'Destroy', comic, confirm: 'Are you sure?', method: :delete %>
- <% end -%>
- <% end -%>
- </td>
- </tr>
+ <div>
+ <div>
+ <%= link_to h(comic.title), :action => :play, :id => comic.id %>
+ 一般投稿:<%= comic.disp_editable %>
+ </div>
+ <div>
+ 作家:<%= h comic.author.name %>
+ 更新:<%= comic.updated_at %>
+ </div>
+ </div>
<% end %>
-</table>
-
-<p id="notice"><%= notice %></p>
+<h1><%= h @comic.title %></h1>
+<% if author_signed_in? -%>
+ <% if @comic.own? current_author -%>
+ <div>
+ <p id="notice"><%= notice %></p>
+ <p>
+ <b>Title:</b>
+ <%= h @comic.title %>
+ </p>
+ <p>
+ <b>visible:</b>
+ <%= @comic.visible %>
+ </p>
+ <p>
+ <b>editable:</b>
+ <%= @comic.editable %>
+ </p>
+ <%= link_to 'Destroy', @comic, confirm: 'Are you sure?', method: :delete %>
+ </div>
+ <% end -%>
+<% end -%>
-<p>
- <b>Title:</b>
- <%= h @comic.title %>
-</p>
-
-<p>
- <b>Default width:</b>
- <%= @comic.width %>
-</p>
-
-<p>
- <b>Default height:</b>
- <%= @comic.height %>
-</p>
<% @comic.panels.each do |panel| %>
<% @panel = panel %>
<%= render 'panels/standard' %>
-<h1>PettanR</h1>
+<h1><%= link_to '新着', comics_path %></h1>
+
+<table>
+ <tr>
+ <th>Title</th>
+ <th>editable</th>
+ <th>author_id</th>
+ <th>updated_at</th>
+ <th></th>
+ </tr>
+
+<% @comics.each do |comic| %>
+ <tr>
+ <td><%= link_to h(comic.title), :action => :play, :id => comic.id %></td>
+ <td><%= comic.editable %></td>
+ <td><%= comic.author_id%></td>
+ <td><%= comic.updated_at %></td>
+ <td>
+ <% if author_signed_in? -%>
+ <% if comic.own? current_author -%>
+ <%= link_to 'Destroy', comic, confirm: 'Are you sure?', method: :delete %>
+ <% end -%>
+ <% end -%>
+ </td>
+ </tr>
+<% end %>
+</table>
+<h1>人気</h1>
-
<%= render 'form' %>
-<%= link_to 'Show', @common_lisence %> |
-<%= link_to 'Back', lisences_path %>
+<%= link_to 'Show', :controller => 'common_lisences', :action => :browse, :id => @common_lisence.id %> |
+<%= link_to 'Back', :action => :list %>
<%= render 'form' %>
-<%= link_to 'Back', common_lisences_path %>
+<%= link_to 'Back', :action => :list %>
</head>
<body>
+<a href="/">ぺったんR</a>
<div>
<% if author_signed_in? %>
<%= link_to "my home", :controller => '/home' %>
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
</div>
+<%= link_to "comics", comics_path %>
+<%= link_to "panels", panels_path %>
+<%= link_to "pictures", original_pictures_path %>
+<%= link_to "lisences", lisences_path %>
<%= yield %>
</body>
+++ /dev/null
-<%= form_for(@lisence) do |f| %>
- <% if @lisence.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@lisence.errors.count, "error") %> prohibited this lisence from being saved:</h2>
-
- <ul>
- <% @lisence.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <div class="actions">
- <%= f.submit %>
- </div>
-<% end %>
+++ /dev/null
-<h1>Editing lisence</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Show', @lisence %> |
-<%= link_to 'Back', lisences_path %>
+++ /dev/null
-<h1>New lisence</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Back', lisences_path %>
<h1>Listing original_pictures</h1>
<%= render 'uploader' %>
-<table>
- <tr>
- <th>Ext</th>
- <th>Width</th>
- <th>Height</th>
- <th>filesize</th>
- <th>artist</th>
- <th></th>
- </tr>
-
<% @original_pictures.each do |original_picture| %>
- <tr>
- <td><%= original_picture.ext %></td>
- <td><%= original_picture.width %></td>
- <td><%= original_picture.height %></td>
- <td><%= original_picture.filesize %></td>
- <td><%= original_picture.artist_id %></td>
- <td><%= link_to 'Show', original_picture %></td>
- <td>
- <% if author_signed_in? -%>
- <% if original_picture.own? current_author -%>
- <%= link_to 'Destroy', original_picture, confirm: 'Are you sure?', method: :delete %>
- <% end -%>
- <% end -%>
- </td>
- </tr>
+ <div>
+ <%= original_picture.filename %>
+ <img src="<%= original_picture.resource_picture.url('thumbnail') -%>">
+ <%= original_picture.width %>x<%= original_picture.height %>
+ <%= original_picture.filesize %>bytes
+ 画:<%= h original_picture.artist.name %>
+ </div>
<% end %>
-</table>
-<h1>Listing panels</h1>
-
-<table>
- <tr>
- <th>id</th>
- <th>Comic</th>
- <th>bg</th>
- <th>Width</th>
- <th>Height</th>
- <th>Border</th>
- <th>x</th>
- <th>y</th>
- <th>z</th>
- <th>t</th>
- <th>author_id</th>
- <th>updated_at</th>
- <th></th>
- <th></th>
- </tr>
-
+<h1>Listing panels 最近の投稿</h1>
<% @panels.each do |panel| %>
- <tr>
- <td><%= panel.id %></td>
- <td><%= panel.comic_id %></td>
- <td><%= panel.resource_picture_id %></td>
- <td><%= panel.width %></td>
- <td><%= panel.height %></td>
- <td><%= panel.border %></td>
- <td><%= panel.x %></td>
- <td><%= panel.y %></td>
- <td><%= panel.z %></td>
- <td><%= panel.t %></td>
- <td><%= panel.author_id %></td>
- <td><%= panel.updated_at %></td>
- <td><%= link_to 'Show', panel %></td>
- <td>
- <% if author_signed_in? -%>
- <% if panel.own? current_author -%>
- <%= link_to 'Destroy', panel, confirm: 'Are you sure?', method: :delete %>
- <% end -%>
- <% end -%>
- </td>
- </tr>
+ <div>
+ <%= link_to h(panel.comic.title), panel.comic %>t:<%= panel.t %>
+<div class="panel" style="width:<%= panel.width %>px;height:<%= panel.height %>px;overflow:hidden; border:solid black <%= panel.border %>px; background:white;">
+ <% panel.panel_pictures.each do |panel_picture| %>
+ <div id="vPicture<%= panel_picture.id -%>" class="panel_picture" style="position:relative; top:<%= panel_picture.y -%>px; left:<%= panel_picture.x -%>px; z-index:<%= panel_picture.z -%>; ">
+ <img style=" position:absolute; width:<%= panel_picture.width -%>px; height:<%= panel_picture.height -%>px; " src="<%= panel_picture.url -%>">
+ </div>
+ <% end %>
+ <% panel.balloons.each do |balloon| %>
+ <div id="vballoon<%= balloon.id -%>" class="balloon" style="position:relative; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= balloon.z -%>; ">
+ <img style=" position:absolute; width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; " src="<%= balloon.system_picture.url -%>">
+ <% balloon.speaches.each do |speach| %>
+ <div style="position:relative; top:<%= speach.y -%>px; left:<%= speach.x -%>px;width:<%= speach.width -%>px; height:<%= speach.height -%>px; top:1px; left:1px; z-index:1; ">
+ <%= h speach.content -%>
+ </div>
+ <% end %>
+ </div>
+ <% end %>
+</div>
+ <%= h panel.author.name %> <%= panel.updated_at %>
+ </div>
<% end %>
-</table>
<h1>Listing resource_pictures</h1>
-
-<table>
- <tr>
- <th>Ext</th>
- <th>Width</th>
- <th>Height</th>
- <th>filesize</th>
- </tr>
-
<% @resource_pictures.each do |resource_picture| %>
- <tr>
- <td><%= resource_picture.ext %></td>
- <td><%= resource_picture.width %></td>
- <td><%= resource_picture.height %></td>
- <td><%= resource_picture.filesize %></td>
- <td>
- <%= link_to 'show', resource_picture %>
- </td>
- </tr>
+ <div>
+ <%= resource_picture.filename %>
+ <img src="<%= resource_picture.url('thumbnail') -%>">
+ <%= resource_picture.width %>x<%= resource_picture.height %>
+ <%= resource_picture.filesize %>bytes
+ 画:<%= h resource_picture.original_picture.artist.name %>
+ </div>
<% end %>
-</table>
-authentication_token:<%= current_admin.authentication_token %>
-
<div>
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
-<%= link_to 'comics', comics_path %>
-<%= link_to 'panels', panels_path %>
-<%= link_to 'original_pictures', original_pictures_path %>
-<%= link_to 'resource_pictures', resource_pictures_path %>
-<%= link_to 'panel_pictures', panel_pictures_path %>
-<%= link_to 'balloons', balloons_path %>
-<%= link_to 'speaches', speaches_path %>
- :
-<%= link_to 'speach_balloons', speach_balloons_path %>
-<%= link_to 'balloon_templates', balloon_templates_path %>
-<%= link_to 'speach_templates', speach_templates_path %>
- :
-<%= link_to 'artists', artists_path %>
-<%= link_to 'lesences', lisences_path %>
-(<%= link_to 'common', common_lisences_path %> <%= link_to 'original', original_lisences_path %>)
-<%= link_to 'system_pictures', system_pictures_path %>
+</div>
+<div>
+ <%= link_to 'browse', :action => :browse %>
+</div>
+<div>
+ <%= link_to 'auth token', :action => :auth_token %>
+</div>
+<div>
+フキダシの管理
+</div>
+<div>
+コモンライセンスの管理
+</div>
+<div>
+システム画像の管理
</div>
match 'original_pictures/:id(.:format)/refresh' => 'original_pictures#refresh'
- resources :artists, except: [:new, :edit]
- resources :speaches, only: [:index]
- resources :balloons, only: [:index]
- resources :speach_templates, only: [:index]
- resources :balloon_templates, only: [:index]
- resources :speach_balloons, except: [:new, :edit]
- resources :panel_pictures, only: [:index]
- resources :resource_pictures, only: [:index, :show]
- resources :original_pictures, except: [:new]
- resources :panels, except: [:new, :edit]
- resources :comics, except: [:new, :edit]
- resources :lisences, only: [:index]
- resources :original_lisences
- resources :common_lisences
- resources :system_pictures, except: [:new, :edit]
+ resources :artists do
+ collection do
+ get :index
+ get :show
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ put :update
+ delete :destroy
+ end
+ end
+ resources :speaches do
+ collection do
+ get :index
+ get :show
+ get :list
+ get :browse
+ end
+ member do
+ end
+ end
+ resources :balloons do
+ collection do
+ get :index
+ get :show
+ get :list
+ get :browse
+ end
+ member do
+ end
+ end
+ resources :speach_templates do
+ collection do
+ get :index
+ get :show
+ get :list
+ get :browse
+ end
+ member do
+ end
+ end
+ resources :balloon_templates do
+ collection do
+ get :index
+ get :show
+ get :list
+ get :browse
+ end
+ member do
+ end
+ end
+ resources :speach_balloons do
+ collection do
+ get :index
+ get :show
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ put :update
+ delete :destroy
+ end
+ end
+ resources :panel_pictures do
+ collection do
+ get :index
+ get :show
+ get :list
+ get :browse
+ end
+ member do
+ end
+ end
+ resources :resource_pictures do
+ collection do
+ get :index
+ get :show
+ get :list
+ get :browse
+ end
+ member do
+ end
+ end
+ resources :original_pictures do
+ collection do
+ get :index
+ get :show
+ get :new
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ get :edit
+ put :update
+ delete :destroy
+ end
+ end
+ resources :panels do
+ collection do
+ get :index
+ get :show
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ put :update
+ delete :destroy
+ end
+ end
+ resources :comics do #, except: [:new, :edit]
+ collection do
+ get :index
+ get :show
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ put :update
+ delete :destroy
+ end
+ end
+ resources :lisences do
+ collection do
+ get :index
+ get :show
+ get :list
+ get :browse
+ end
+ end
+ resources :original_lisences do
+ collection do
+ get :index
+ get :show
+ get :new
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ get :edit
+ put :update
+ delete :destroy
+ end
+ end
+ resources :common_lisences do
+ collection do
+ get :index
+ get :show
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ put :update
+ delete :destroy
+ end
+ end
+ resources :system_pictures do
+ collection do
+ get :index
+ get :show
+ post :create
+ get :list
+ get :browse
+ end
+ member do
+ put :update
+ delete :destroy
+ end
+ end
# The priority is based upon order of creation:
# first created -> highest priority.
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
-# match ':controller(/:action(/:id(.:format)))'
+ #match ':controller(/:action(/:id(.:format)))'
end