OSDN Git Service

import all source code
authoryasushiito <yas@pen-chan.jp>
Fri, 23 Dec 2011 00:57:29 +0000 (09:57 +0900)
committeryasushiito <yas@pen-chan.jp>
Fri, 23 Dec 2011 00:57:29 +0000 (09:57 +0900)
402 files changed:
.gitignore [new file with mode: 0644]
.rspec [new file with mode: 0644]
ERD.dot [new file with mode: 0644]
Gemfile [new file with mode: 0644]
Gemfile.lock [new file with mode: 0644]
LISENCE.txt [new file with mode: 0644]
README.rails [new file with mode: 0644]
Rakefile [new file with mode: 0644]
app/assets/images/rails.png [new file with mode: 0644]
app/assets/javascripts/admins/sessions.js.coffee [new file with mode: 0644]
app/assets/javascripts/application.js [new file with mode: 0644]
app/assets/javascripts/artists.js.coffee [new file with mode: 0644]
app/assets/javascripts/authors/sessions.js.coffee [new file with mode: 0644]
app/assets/javascripts/baloon_templates.js.coffee [new file with mode: 0644]
app/assets/javascripts/baloon_types.js.coffee [new file with mode: 0644]
app/assets/javascripts/baloons.js.coffee [new file with mode: 0644]
app/assets/javascripts/comics.js.coffee [new file with mode: 0644]
app/assets/javascripts/common_lisences.js.coffee [new file with mode: 0644]
app/assets/javascripts/help.js.coffee [new file with mode: 0644]
app/assets/javascripts/home.js.coffee [new file with mode: 0644]
app/assets/javascripts/lisences.js.coffee [new file with mode: 0644]
app/assets/javascripts/original_lisences.js.coffee [new file with mode: 0644]
app/assets/javascripts/original_pictures.js.coffee [new file with mode: 0644]
app/assets/javascripts/panels.js.coffee [new file with mode: 0644]
app/assets/javascripts/pictures.js.coffee [new file with mode: 0644]
app/assets/javascripts/source_pictures.js.coffee [new file with mode: 0644]
app/assets/javascripts/speach_baloons.js.coffee [new file with mode: 0644]
app/assets/javascripts/speach_templates.js.coffee [new file with mode: 0644]
app/assets/javascripts/speachbaloons.js.coffee [new file with mode: 0644]
app/assets/javascripts/speaches.js.coffee [new file with mode: 0644]
app/assets/javascripts/system.js.coffee [new file with mode: 0644]
app/assets/stylesheets/admins/sessions.css.scss [new file with mode: 0644]
app/assets/stylesheets/application.css [new file with mode: 0644]
app/assets/stylesheets/artists.css.scss [new file with mode: 0644]
app/assets/stylesheets/authors/sessions.css.scss [new file with mode: 0644]
app/assets/stylesheets/baloon_templates.css.scss [new file with mode: 0644]
app/assets/stylesheets/baloon_types.css.scss [new file with mode: 0644]
app/assets/stylesheets/baloons.css.scss [new file with mode: 0644]
app/assets/stylesheets/comics.css.scss [new file with mode: 0644]
app/assets/stylesheets/common_lisences.css.scss [new file with mode: 0644]
app/assets/stylesheets/help.css.scss [new file with mode: 0644]
app/assets/stylesheets/home.css.scss [new file with mode: 0644]
app/assets/stylesheets/lisences.css.scss [new file with mode: 0644]
app/assets/stylesheets/original_lisences.css.scss [new file with mode: 0644]
app/assets/stylesheets/original_pictures.css.scss [new file with mode: 0644]
app/assets/stylesheets/panels.css.scss [new file with mode: 0644]
app/assets/stylesheets/pictures.css.scss [new file with mode: 0644]
app/assets/stylesheets/scaffolds.css.scss [new file with mode: 0644]
app/assets/stylesheets/source_pictures.css.scss [new file with mode: 0644]
app/assets/stylesheets/speach_baloons.css.scss [new file with mode: 0644]
app/assets/stylesheets/speach_templates.css.scss [new file with mode: 0644]
app/assets/stylesheets/speachbaloons.css.scss [new file with mode: 0644]
app/assets/stylesheets/speaches.css.scss [new file with mode: 0644]
app/assets/stylesheets/system.css.scss [new file with mode: 0644]
app/controllers/application_controller.rb [new file with mode: 0644]
app/controllers/artists_controller.rb [new file with mode: 0644]
app/controllers/balloon_templates_controller.rb [new file with mode: 0644]
app/controllers/balloons_controller.rb [new file with mode: 0644]
app/controllers/comics_controller.rb [new file with mode: 0644]
app/controllers/common_lisences_controller.rb [new file with mode: 0644]
app/controllers/help_controller.rb [new file with mode: 0644]
app/controllers/home_controller.rb [new file with mode: 0644]
app/controllers/lisences_controller.rb [new file with mode: 0644]
app/controllers/original_lisences_controller.rb [new file with mode: 0644]
app/controllers/original_pictures_controller.rb [new file with mode: 0644]
app/controllers/panel_pictures_controller.rb [new file with mode: 0644]
app/controllers/panels_controller.rb [new file with mode: 0644]
app/controllers/resource_pictures_controller.rb [new file with mode: 0644]
app/controllers/speach_balloons_controller.rb [new file with mode: 0644]
app/controllers/speach_templates_controller.rb [new file with mode: 0644]
app/controllers/speaches_controller.rb [new file with mode: 0644]
app/controllers/system_controller.rb [new file with mode: 0644]
app/helpers/application_helper.rb [new file with mode: 0644]
app/helpers/artists_helper.rb [new file with mode: 0644]
app/helpers/balloon_templates_helper.rb [new file with mode: 0644]
app/helpers/balloon_types_helper.rb [new file with mode: 0644]
app/helpers/balloons_helper.rb [new file with mode: 0644]
app/helpers/comics_helper.rb [new file with mode: 0644]
app/helpers/common_lisences_helper.rb [new file with mode: 0644]
app/helpers/help_helper.rb [new file with mode: 0644]
app/helpers/home_helper.rb [new file with mode: 0644]
app/helpers/lisences_helper.rb [new file with mode: 0644]
app/helpers/original_lisences_helper.rb [new file with mode: 0644]
app/helpers/original_pictures_helper.rb [new file with mode: 0644]
app/helpers/panel_pictures_helper.rb [new file with mode: 0644]
app/helpers/panels_helper.rb [new file with mode: 0644]
app/helpers/resource_pictures_helper.rb [new file with mode: 0644]
app/helpers/speach_balloons_helper.rb [new file with mode: 0644]
app/helpers/speach_templates_helper.rb [new file with mode: 0644]
app/helpers/speaches_helper.rb [new file with mode: 0644]
app/helpers/system_helper.rb [new file with mode: 0644]
app/mailers/.gitkeep [new file with mode: 0644]
app/models/.gitkeep [new file with mode: 0644]
app/models/admin.rb [new file with mode: 0644]
app/models/artist.rb [new file with mode: 0644]
app/models/author.rb [new file with mode: 0644]
app/models/balloon.rb [new file with mode: 0644]
app/models/balloon_template.rb [new file with mode: 0644]
app/models/comic.rb [new file with mode: 0644]
app/models/common_lisence.rb [new file with mode: 0644]
app/models/lisence.rb [new file with mode: 0644]
app/models/original_lisence.rb [new file with mode: 0644]
app/models/original_picture.rb [new file with mode: 0644]
app/models/panel.rb [new file with mode: 0644]
app/models/panel_picture.rb [new file with mode: 0644]
app/models/resource_picture.rb [new file with mode: 0644]
app/models/speach.rb [new file with mode: 0644]
app/models/speach_balloon.rb [new file with mode: 0644]
app/models/speach_template.rb [new file with mode: 0644]
app/views/admins/confirmations/new.html.erb [new file with mode: 0644]
app/views/admins/mailer/confirmation_instructions.html.erb [new file with mode: 0644]
app/views/admins/mailer/reset_password_instructions.html.erb [new file with mode: 0644]
app/views/admins/mailer/unlock_instructions.html.erb [new file with mode: 0644]
app/views/admins/passwords/edit.html.erb [new file with mode: 0644]
app/views/admins/passwords/new.html.erb [new file with mode: 0644]
app/views/admins/registrations/edit.html.erb [new file with mode: 0644]
app/views/admins/registrations/new.html.erb [new file with mode: 0644]
app/views/admins/sessions/new.html.erb [new file with mode: 0644]
app/views/admins/shared/_links.erb [new file with mode: 0644]
app/views/admins/unlocks/new.html.erb [new file with mode: 0644]
app/views/artists/_form.html.erb [new file with mode: 0644]
app/views/artists/edit.html.erb [new file with mode: 0644]
app/views/artists/index.html.erb [new file with mode: 0644]
app/views/artists/new.html.erb [new file with mode: 0644]
app/views/artists/show.html.erb [new file with mode: 0644]
app/views/authors/confirmations/new.html.erb [new file with mode: 0644]
app/views/authors/mailer/confirmation_instructions.html.erb [new file with mode: 0644]
app/views/authors/mailer/reset_password_instructions.html.erb [new file with mode: 0644]
app/views/authors/mailer/unlock_instructions.html.erb [new file with mode: 0644]
app/views/authors/passwords/edit.html.erb [new file with mode: 0644]
app/views/authors/passwords/new.html.erb [new file with mode: 0644]
app/views/authors/registrations/edit.html.erb [new file with mode: 0644]
app/views/authors/registrations/new.html.erb [new file with mode: 0644]
app/views/authors/sessions/new.html.erb [new file with mode: 0644]
app/views/authors/shared/_links.erb [new file with mode: 0644]
app/views/authors/unlocks/new.html.erb [new file with mode: 0644]
app/views/balloon_templates/index.html.erb [new file with mode: 0644]
app/views/balloons/index.html.erb [new file with mode: 0644]
app/views/comics/index.html.erb [new file with mode: 0644]
app/views/comics/play.html.erb [new file with mode: 0644]
app/views/comics/show.html.erb [new file with mode: 0644]
app/views/comics/top.html.erb [new file with mode: 0644]
app/views/common_lisences/_form.html.erb [new file with mode: 0644]
app/views/common_lisences/edit.html.erb [new file with mode: 0644]
app/views/common_lisences/index.html.erb [new file with mode: 0644]
app/views/common_lisences/new.html.erb [new file with mode: 0644]
app/views/common_lisences/show.html.erb [new file with mode: 0644]
app/views/home/index.html.erb [new file with mode: 0644]
app/views/layouts/application.html.erb [new file with mode: 0644]
app/views/lisences/_form.html.erb [new file with mode: 0644]
app/views/lisences/edit.html.erb [new file with mode: 0644]
app/views/lisences/index.html.erb [new file with mode: 0644]
app/views/lisences/new.html.erb [new file with mode: 0644]
app/views/lisences/show.html.erb [new file with mode: 0644]
app/views/original_lisences/_form.html.erb [new file with mode: 0644]
app/views/original_lisences/edit.html.erb [new file with mode: 0644]
app/views/original_lisences/index.html.erb [new file with mode: 0644]
app/views/original_lisences/new.html.erb [new file with mode: 0644]
app/views/original_lisences/show.html.erb [new file with mode: 0644]
app/views/original_pictures/_artist_register.html.erb [new file with mode: 0644]
app/views/original_pictures/_uploader.html.erb [new file with mode: 0644]
app/views/original_pictures/index.html.erb [new file with mode: 0644]
app/views/original_pictures/show.html.erb [new file with mode: 0644]
app/views/panel_pictures/index.html.erb [new file with mode: 0644]
app/views/panels/_standard.html.erb [new file with mode: 0644]
app/views/panels/index.html.erb [new file with mode: 0644]
app/views/panels/show.html.erb [new file with mode: 0644]
app/views/resource_pictures/index.html.erb [new file with mode: 0644]
app/views/resource_pictures/show.html.erb [new file with mode: 0644]
app/views/speach_balloons/index.html.erb [new file with mode: 0644]
app/views/speach_balloons/show.html.erb [new file with mode: 0644]
app/views/speach_templates/index.html.erb [new file with mode: 0644]
app/views/speaches/index.html.erb [new file with mode: 0644]
app/views/system/start.html.erb [new file with mode: 0644]
app/views/system/waiting_list.html.erb [new file with mode: 0644]
config.ru [new file with mode: 0644]
config/application.rb [new file with mode: 0644]
config/aws.yaml.org [new file with mode: 0644]
config/boot.rb [new file with mode: 0644]
config/cucumber.yml [new file with mode: 0644]
config/database.yml [new file with mode: 0644]
config/environment.rb [new file with mode: 0644]
config/environments/development.rb [new file with mode: 0644]
config/environments/production.rb [new file with mode: 0644]
config/environments/test.rb [new file with mode: 0644]
config/initializers/backtrace_silencers.rb [new file with mode: 0644]
config/initializers/devise.rb [new file with mode: 0644]
config/initializers/inflections.rb [new file with mode: 0644]
config/initializers/mime_types.rb [new file with mode: 0644]
config/initializers/secret_token.rb [new file with mode: 0644]
config/initializers/session_store.rb [new file with mode: 0644]
config/initializers/wrap_parameters.rb [new file with mode: 0644]
config/locales/devise.en.yml [new file with mode: 0644]
config/locales/en.yml [new file with mode: 0644]
config/routes.rb [new file with mode: 0644]
db/migrate/20111206091950_devise_create_authors.rb [new file with mode: 0644]
db/migrate/20111206092734_devise_create_admins.rb [new file with mode: 0644]
db/migrate/20111206095746_create_artists.rb [new file with mode: 0644]
db/migrate/20111206100750_create_lisences.rb [new file with mode: 0644]
db/migrate/20111206105022_create_original_lisences.rb [new file with mode: 0644]
db/migrate/20111206105830_create_comics.rb [new file with mode: 0644]
db/migrate/20111206111202_create_panels.rb [new file with mode: 0644]
db/migrate/20111206112042_create_original_pictures.rb [new file with mode: 0644]
db/migrate/20111206112949_create_resource_pictures.rb [new file with mode: 0644]
db/migrate/20111206113803_create_panel_pictures.rb [new file with mode: 0644]
db/migrate/20111206115439_create_balloon_templates.rb [new file with mode: 0644]
db/migrate/20111206120252_create_speach_templates.rb [new file with mode: 0644]
db/migrate/20111206121123_create_balloons.rb [new file with mode: 0644]
db/migrate/20111206130635_create_speaches.rb [new file with mode: 0644]
db/migrate/20111208235818_create_speach_balloons.rb [new file with mode: 0644]
db/migrate/20111211052544_add_author_id_on_artist.rb [new file with mode: 0644]
db/migrate/20111213073529_create_common_lisences.rb [new file with mode: 0644]
db/schema.rb [new file with mode: 0644]
db/seeds.rb [new file with mode: 0644]
doc/README_FOR_APP [new file with mode: 0644]
features/support/env.rb [new file with mode: 0644]
lib/DMagick.rb [new file with mode: 0644]
lib/assets/.gitkeep [new file with mode: 0644]
lib/local_picture.rb [new file with mode: 0644]
lib/picture_io.rb [new file with mode: 0644]
lib/s3_picture.rb [new file with mode: 0644]
lib/tasks/.gitkeep [new file with mode: 0644]
lib/tasks/cucumber.rake [new file with mode: 0644]
log/.gitkeep [new file with mode: 0644]
public/404.html [new file with mode: 0644]
public/422.html [new file with mode: 0644]
public/500.html [new file with mode: 0644]
public/assets/application-00960e5186894b532975562d59176a6a.css [new file with mode: 0644]
public/assets/application-00960e5186894b532975562d59176a6a.css.gz [new file with mode: 0644]
public/assets/application-fd525bbd17efb79c1bb774c528fe1959.js [new file with mode: 0644]
public/assets/application-fd525bbd17efb79c1bb774c528fe1959.js.gz [new file with mode: 0644]
public/assets/application.css [new file with mode: 0644]
public/assets/application.css.gz [new file with mode: 0644]
public/assets/application.js [new file with mode: 0644]
public/assets/application.js.gz [new file with mode: 0644]
public/assets/manifest.yml [new file with mode: 0644]
public/assets/rails-e4b51606cd77fda2615e7439907bfc92.png [new file with mode: 0644]
public/assets/rails.png [new file with mode: 0644]
public/favicon.ico [new file with mode: 0644]
public/robots.txt [new file with mode: 0644]
script/cucumber [new file with mode: 0644]
script/encode64.rb [new file with mode: 0644]
script/rails [new file with mode: 0644]
spec/controllers/admins/sessions_controller_spec.rb [new file with mode: 0644]
spec/controllers/artists_controller_spec.rb [new file with mode: 0644]
spec/controllers/authors/sessions_controller_spec.rb [new file with mode: 0644]
spec/controllers/baloon_templates_controller_spec.rb [new file with mode: 0644]
spec/controllers/baloon_types_controller_spec.rb [new file with mode: 0644]
spec/controllers/baloons_controller_spec.rb [new file with mode: 0644]
spec/controllers/comics_controller_spec.rb [new file with mode: 0644]
spec/controllers/common_lisences_controller_spec.rb [new file with mode: 0644]
spec/controllers/help_controller_spec.rb [new file with mode: 0644]
spec/controllers/home_controller_spec.rb [new file with mode: 0644]
spec/controllers/lisences_controller_spec.rb [new file with mode: 0644]
spec/controllers/original_lisences_controller_spec.rb [new file with mode: 0644]
spec/controllers/original_pictures_controller_spec.rb [new file with mode: 0644]
spec/controllers/panels_controller_spec.rb [new file with mode: 0644]
spec/controllers/pictures_controller_spec.rb [new file with mode: 0644]
spec/controllers/source_pictures_controller_spec.rb [new file with mode: 0644]
spec/controllers/speach_baloons_controller_spec.rb [new file with mode: 0644]
spec/controllers/speach_templates_controller_spec.rb [new file with mode: 0644]
spec/controllers/speachbaloons_controller_spec.rb [new file with mode: 0644]
spec/controllers/speaches_controller_spec.rb [new file with mode: 0644]
spec/controllers/system_controller_spec.rb [new file with mode: 0644]
spec/helpers/admins/sessions_helper_spec.rb [new file with mode: 0644]
spec/helpers/artists_helper_spec.rb [new file with mode: 0644]
spec/helpers/authors/sessions_helper_spec.rb [new file with mode: 0644]
spec/helpers/baloon_templates_helper_spec.rb [new file with mode: 0644]
spec/helpers/baloon_types_helper_spec.rb [new file with mode: 0644]
spec/helpers/baloons_helper_spec.rb [new file with mode: 0644]
spec/helpers/comics_helper_spec.rb [new file with mode: 0644]
spec/helpers/common_lisences_helper_spec.rb [new file with mode: 0644]
spec/helpers/help_helper_spec.rb [new file with mode: 0644]
spec/helpers/home_helper_spec.rb [new file with mode: 0644]
spec/helpers/lisences_helper_spec.rb [new file with mode: 0644]
spec/helpers/original_lisences_helper_spec.rb [new file with mode: 0644]
spec/helpers/original_pictures_helper_spec.rb [new file with mode: 0644]
spec/helpers/panels_helper_spec.rb [new file with mode: 0644]
spec/helpers/pictures_helper_spec.rb [new file with mode: 0644]
spec/helpers/source_pictures_helper_spec.rb [new file with mode: 0644]
spec/helpers/speach_baloons_helper_spec.rb [new file with mode: 0644]
spec/helpers/speach_templates_helper_spec.rb [new file with mode: 0644]
spec/helpers/speachbaloons_helper_spec.rb [new file with mode: 0644]
spec/helpers/speaches_helper_spec.rb [new file with mode: 0644]
spec/helpers/system_helper_spec.rb [new file with mode: 0644]
spec/models/admin_spec.rb [new file with mode: 0644]
spec/models/artist_spec.rb [new file with mode: 0644]
spec/models/author_spec.rb [new file with mode: 0644]
spec/models/baloon_spec.rb [new file with mode: 0644]
spec/models/baloon_template_spec.rb [new file with mode: 0644]
spec/models/baloon_type_spec.rb [new file with mode: 0644]
spec/models/comic_spec.rb [new file with mode: 0644]
spec/models/common_lisence_spec.rb [new file with mode: 0644]
spec/models/lisence_spec.rb [new file with mode: 0644]
spec/models/original_lisence_spec.rb [new file with mode: 0644]
spec/models/original_picture_spec.rb [new file with mode: 0644]
spec/models/panel_spec.rb [new file with mode: 0644]
spec/models/picture_spec.rb [new file with mode: 0644]
spec/models/source_picture_spec.rb [new file with mode: 0644]
spec/models/speach_baloon_spec.rb [new file with mode: 0644]
spec/models/speach_spec.rb [new file with mode: 0644]
spec/models/speach_template_spec.rb [new file with mode: 0644]
spec/models/speachbaloon_spec.rb [new file with mode: 0644]
spec/requests/artists_spec.rb [new file with mode: 0644]
spec/requests/baloon_templates_spec.rb [new file with mode: 0644]
spec/requests/baloon_types_spec.rb [new file with mode: 0644]
spec/requests/baloons_spec.rb [new file with mode: 0644]
spec/requests/comics_spec.rb [new file with mode: 0644]
spec/requests/common_lisences_spec.rb [new file with mode: 0644]
spec/requests/lisences_spec.rb [new file with mode: 0644]
spec/requests/original_lisences_spec.rb [new file with mode: 0644]
spec/requests/original_pictures_spec.rb [new file with mode: 0644]
spec/requests/panels_spec.rb [new file with mode: 0644]
spec/requests/pictures_spec.rb [new file with mode: 0644]
spec/requests/source_pictures_spec.rb [new file with mode: 0644]
spec/requests/speach_baloons_spec.rb [new file with mode: 0644]
spec/requests/speach_templates_spec.rb [new file with mode: 0644]
spec/requests/speachbaloons_spec.rb [new file with mode: 0644]
spec/requests/speaches_spec.rb [new file with mode: 0644]
spec/routing/artists_routing_spec.rb [new file with mode: 0644]
spec/routing/baloon_templates_routing_spec.rb [new file with mode: 0644]
spec/routing/baloon_types_routing_spec.rb [new file with mode: 0644]
spec/routing/baloons_routing_spec.rb [new file with mode: 0644]
spec/routing/comics_routing_spec.rb [new file with mode: 0644]
spec/routing/common_lisences_routing_spec.rb [new file with mode: 0644]
spec/routing/lisences_routing_spec.rb [new file with mode: 0644]
spec/routing/original_lisences_routing_spec.rb [new file with mode: 0644]
spec/routing/original_pictures_routing_spec.rb [new file with mode: 0644]
spec/routing/panels_routing_spec.rb [new file with mode: 0644]
spec/routing/pictures_routing_spec.rb [new file with mode: 0644]
spec/routing/source_pictures_routing_spec.rb [new file with mode: 0644]
spec/routing/speach_baloons_routing_spec.rb [new file with mode: 0644]
spec/routing/speach_templates_routing_spec.rb [new file with mode: 0644]
spec/routing/speachbaloons_routing_spec.rb [new file with mode: 0644]
spec/routing/speaches_routing_spec.rb [new file with mode: 0644]
spec/spec_helper.rb [new file with mode: 0644]
spec/views/artists/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/artists/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/artists/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/artists/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_templates/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_templates/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_templates/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_templates/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_types/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_types/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_types/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloon_types/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloons/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloons/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloons/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/baloons/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/comics/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/comics/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/comics/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/comics/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/common_lisences/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/common_lisences/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/common_lisences/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/common_lisences/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/lisences/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/lisences/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/lisences/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/lisences/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_lisences/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_lisences/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_lisences/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_lisences/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_pictures/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_pictures/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_pictures/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/original_pictures/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/panels/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/panels/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/panels/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/panels/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/pictures/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/pictures/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/pictures/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/pictures/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/source_pictures/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/source_pictures/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/source_pictures/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/source_pictures/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_baloons/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_baloons/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_baloons/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_baloons/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_templates/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_templates/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_templates/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/speach_templates/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/speachbaloons/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/speachbaloons/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/speachbaloons/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/speachbaloons/show.html.erb_spec.rb [new file with mode: 0644]
spec/views/speaches/edit.html.erb_spec.rb [new file with mode: 0644]
spec/views/speaches/index.html.erb_spec.rb [new file with mode: 0644]
spec/views/speaches/new.html.erb_spec.rb [new file with mode: 0644]
spec/views/speaches/show.html.erb_spec.rb [new file with mode: 0644]
vendor/assets/stylesheets/.gitkeep [new file with mode: 0644]
vendor/plugins/.gitkeep [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..5aff11a
--- /dev/null
@@ -0,0 +1,7 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/
+.sass-cache/
+public/image/*
+config/aws.yaml
diff --git a/.rspec b/.rspec
new file mode 100644 (file)
index 0000000..53607ea
--- /dev/null
+++ b/.rspec
@@ -0,0 +1 @@
+--colour
diff --git a/ERD.dot b/ERD.dot
new file mode 100644 (file)
index 0000000..e955cc0
--- /dev/null
+++ b/ERD.dot
@@ -0,0 +1,245 @@
+digraph Pettanr {\r
+  rankdir = "LR"; ranksep = "0.5"; nodesep = "0.4"; pad = "0.4,0.4"; margin = "0,0"; concentrate = "true"; labelloc = "t"; fontsize = "13"; fontname = "Arial Bold";\r
+  node [shape = "Mrecord", fontsize = "10", fontname = "Arial", margin = "0.07,0.05", penwidth = "1.0"];\r
+  edge [fontname = "Arial", fontsize = "7", dir = "both", arrowsize = "0.9", penwidth = "1.0", labelangle = "32", labeldistance = "1.8"];\r
+  label = "Pettanr domain model\n\n";\r
+  m_Admin [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Admin</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="activate">activate <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="current_sign_in_at">current_sign_in_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="current_sign_in_ip">current_sign_in_ip <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="email">email <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="encrypted_password">encrypted_password <font face="Arial Italic" color="grey60">string (128)caA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="last_sign_in_at">last_sign_in_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="last_sign_in_ip">last_sign_in_ip <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="remember_created_at">remember_created_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="reset_password_sent_at">reset_password_sent_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="reset_password_token">reset_password_token <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="sign_in_count">sign_in_count <font face="Arial Italic" color="grey60">integer</font></td></tr>\r
+</table>\r
+>];\r
+  m_Artist [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Artist</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="api_url">api_url <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="crowled_at">crowled_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="default_lisence_id">default_lisence_id <font face="Arial Italic" color="grey60">integer</font></td></tr>\r
+  <tr><td align="left" width="130" port="email">email <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="homepage_url">homepage_url <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="name">name <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+</table>\r
+>];\r
+  m_Author [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Author</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="authentication_token">authentication_token <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="confirmation_sent_at">confirmation_sent_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="confirmation_token">confirmation_token <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="confirmed_at">confirmed_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="current_sign_in_at">current_sign_in_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="current_sign_in_ip">current_sign_in_ip <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="email">email <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="encrypted_password">encrypted_password <font face="Arial Italic" color="grey60">string (128)caA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="last_sign_in_at">last_sign_in_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="last_sign_in_ip">last_sign_in_ip <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="remember_created_at">remember_created_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="reset_password_sent_at">reset_password_sent_at <font face="Arial Italic" color="grey60">datetime</font></td></tr>\r
+  <tr><td align="left" width="130" port="reset_password_token">reset_password_token <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="sign_in_count">sign_in_count <font face="Arial Italic" color="grey60">integer</font></td></tr>\r
+</table>\r
+>];\r
+  m_Balloon [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Balloon</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="balloon_template_id">balloon_template_id <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="border">border <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="height">height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="left_offset">left_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="tail">tail <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="top_offset">top_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="width">width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="zindex">zindex <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_BalloonTemplate [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">BalloonTemplate</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="border">border <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="max_height">max_height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="max_width">max_width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="min_height">min_height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="min_width">min_width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="tail">tail <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_Comic [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Comic</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="author_id">author_id <font face="Arial Italic" color="grey60">integer</font></td></tr>\r
+  <tr><td align="left" width="130" port="default_height">default_height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="default_width">default_width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="title">title <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+</table>\r
+>];\r
+  m_CommonLisence [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">CommonLisence</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="cc_by">cc_by <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_nc">cc_nc <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_nd">cc_nd <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_sa">cc_sa <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="keep_aspect_ratio">keep_aspect_ratio <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="name">name <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="no_flip">no_flip <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="no_resize">no_resize <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="url">url <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_Lisence [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Lisence</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="cc_by">cc_by <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_nc">cc_nc <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_nd">cc_nd <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_sa">cc_sa <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="keep_aspect_ratio">keep_aspect_ratio <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="name">name <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="no_flip">no_flip <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="no_resize">no_resize <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="url">url <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_OriginalLisence [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">OriginalLisence</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="artist_id">artist_id <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_by">cc_by <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_nc">cc_nc <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_nd">cc_nd <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="cc_sa">cc_sa <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="keep_aspect_ratio">keep_aspect_ratio <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="name">name <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="no_flip">no_flip <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="no_resize">no_resize <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="url">url <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_OriginalPicture [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">OriginalPicture</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="ext">ext <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="filesize">filesize <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="height">height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="width">width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_Panel [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Panel</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="author_id">author_id <font face="Arial Italic" color="grey60">integer</font></td></tr>\r
+  <tr><td align="left" width="130" port="border">border <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="height">height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="resource_picture_id">resource_picture_id <font face="Arial Italic" color="grey60">integer</font></td></tr>\r
+  <tr><td align="left" width="130" port="seqno">seqno <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="width">width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_PanelPicture [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">PanelPicture</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="h">h <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="height">height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="left_offset">left_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="top_offset">top_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="v">v <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="width">width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="zindex">zindex <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_ResourcePicture [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">ResourcePicture</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="ext">ext <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="filesize">filesize <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="height">height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="width">width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_Speach [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">Speach</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="content">content <font face="Arial Italic" color="grey60">string</font></td></tr>\r
+  <tr><td align="left" width="130" port="height">height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="left_offset">left_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="top_offset">top_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="width">width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_SpeachBalloon [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">SpeachBalloon</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="border_limit">border_limit <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="name">name <font face="Arial Italic" color="grey60">stringcaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="tail_limit">tail_limit <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_SpeachTemplate [label = <<table border="0" align="center" cellspacing="0.5" cellpadding="0" width="134">\r
+  <tr><td align="center" valign="bottom" width="130"><font face="Arial Bold" point-size="11">SpeachTemplate</font></td></tr>\r
+</table>\r
+|\r
+<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">\r
+  <tr><td align="left" width="130" port="height">height <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="left_offset">left_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="top_offset">top_offset <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+  <tr><td align="left" width="130" port="width">width <font face="Arial Italic" color="grey60">integercaA\81÷a2c</font></td></tr>\r
+</table>\r
+>];\r
+  m_Author -> m_Artist [arrowhead = "none", arrowtail = "none", weight = "2"]\r
+  m_SpeachBalloon -> m_BalloonTemplate [arrowhead = "normal", arrowtail = "none", weight = "2"]\r
+  m_BalloonTemplate -> m_SpeachTemplate [arrowhead = "normal", arrowtail = "none", weight = "2"]\r
+  m_ResourcePicture -> m_BalloonTemplate [arrowhead = "normal", arrowtail = "none", weight = "1"]\r
+  m_Balloon -> m_Speach [arrowhead = "normal", arrowtail = "none", weight = "2"]\r
+  m_Panel -> m_Balloon [arrowhead = "normal", arrowtail = "none", weight = "2"]\r
+  m_ResourcePicture -> m_Balloon [arrowhead = "normal", arrowtail = "none", weight = "1"]\r
+  m_Comic -> m_Panel [arrowhead = "normal", arrowtail = "none", weight = "2"]\r
+  m_Lisence -> m_CommonLisence [arrowhead = "none", arrowtail = "none", weight = "2"]\r
+  m_Lisence -> m_OriginalLisence [arrowhead = "none", arrowtail = "none", weight = "2"]\r
+  m_Artist -> m_OriginalPicture [arrowhead = "normal", arrowtail = "none", weight = "1"]\r
+  m_Lisence -> m_OriginalPicture [arrowhead = "normal", arrowtail = "none", weight = "1"]\r
+  m_OriginalPicture -> m_ResourcePicture [arrowhead = "none", arrowtail = "none", weight = "2"]\r
+  m_Panel -> m_PanelPicture [arrowhead = "normal", arrowtail = "none", weight = "2"]\r
+  m_ResourcePicture -> m_PanelPicture [arrowhead = "normal", arrowtail = "none", weight = "2"]\r
+  m_Artist -> m_ResourcePicture [arrowhead = "normal", arrowtail = "none", weight = "1"]\r
+  m_Lisence -> m_ResourcePicture [arrowhead = "normal", arrowtail = "none", weight = "1"]\r
+}\r
diff --git a/Gemfile b/Gemfile
new file mode 100644 (file)
index 0000000..46c6d45
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,50 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.1.1'
+gem 'devise'
+gem 'aws-s3'
+
+# Bundle edge Rails instead:
+# gem 'rails',     :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+  gem 'sass-rails',   '~> 3.1.4'
+  gem 'coffee-rails', '~> 3.1.1'
+  gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
+
+group :production do
+  gem 'pg'
+  gem 'therubyracer-heroku'
+  gem 'rmagick', '=2.12.0', :require => 'RMagick'
+end
+
+group :development, :test do
+  gem 'webrat'
+  gem 'rspec'
+   gem 'rspec-rails'
+   gem 'cucumber'
+   gem 'cucumber-rails'
+  gem 'moro-miso'
+  gem 'database_cleaner'
+  gem 'rails-erd'
+end
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644 (file)
index 0000000..8c9ad92
--- /dev/null
@@ -0,0 +1,200 @@
+GEM
+  remote: http://rubygems.org/
+  specs:
+    actionmailer (3.1.1)
+      actionpack (= 3.1.1)
+      mail (~> 2.3.0)
+    actionpack (3.1.1)
+      activemodel (= 3.1.1)
+      activesupport (= 3.1.1)
+      builder (~> 3.0.0)
+      erubis (~> 2.7.0)
+      i18n (~> 0.6)
+      rack (~> 1.3.2)
+      rack-cache (~> 1.1)
+      rack-mount (~> 0.8.2)
+      rack-test (~> 0.6.1)
+      sprockets (~> 2.0.2)
+    activemodel (3.1.1)
+      activesupport (= 3.1.1)
+      builder (~> 3.0.0)
+      i18n (~> 0.6)
+    activerecord (3.1.1)
+      activemodel (= 3.1.1)
+      activesupport (= 3.1.1)
+      arel (~> 2.2.1)
+      tzinfo (~> 0.3.29)
+    activeresource (3.1.1)
+      activemodel (= 3.1.1)
+      activesupport (= 3.1.1)
+    activesupport (3.1.1)
+      multi_json (~> 1.0)
+    arel (2.2.1)
+    aws-s3 (0.6.2)
+      builder
+      mime-types
+      xml-simple
+    bcrypt-ruby (3.0.1-x86-mingw32)
+    builder (3.0.0)
+    capybara (1.1.2)
+      mime-types (>= 1.16)
+      nokogiri (>= 1.3.3)
+      rack (>= 1.0.0)
+      rack-test (>= 0.5.4)
+      selenium-webdriver (~> 2.0)
+      xpath (~> 0.1.4)
+    childprocess (0.2.3)
+      ffi (~> 1.0.6)
+    coffee-rails (3.1.1)
+      coffee-script (>= 2.2.0)
+      railties (~> 3.1.0)
+    coffee-script (2.2.0)
+      coffee-script-source
+      execjs
+    coffee-script-source (1.1.3)
+    cucumber (1.1.3)
+      builder (>= 2.1.2)
+      diff-lcs (>= 1.1.2)
+      gherkin (~> 2.6.7)
+      json (>= 1.4.6)
+      term-ansicolor (>= 1.0.6)
+    cucumber-rails (1.2.1)
+      capybara (>= 1.1.2)
+      cucumber (>= 1.1.3)
+      nokogiri (>= 1.5.0)
+    database_cleaner (0.7.0)
+    devise (1.5.2)
+      bcrypt-ruby (~> 3.0)
+      orm_adapter (~> 0.0.3)
+      warden (~> 1.1)
+    diff-lcs (1.1.3)
+    erubis (2.7.0)
+    execjs (1.2.11)
+      multi_json (~> 1.0)
+    ffi (1.0.11-x86-mingw32)
+    gherkin (2.6.9-x86-mingw32)
+      json (>= 1.4.6)
+    hike (1.2.1)
+    i18n (0.6.0)
+    jquery-rails (1.0.19)
+      railties (~> 3.0)
+      thor (~> 0.14)
+    json (1.6.3)
+    mail (2.3.0)
+      i18n (>= 0.4.0)
+      mime-types (~> 1.16)
+      treetop (~> 1.4.8)
+    mime-types (1.17.2)
+    moro-miso (0.0.6)
+    multi_json (1.0.4)
+    nokogiri (1.5.0-x86-mingw32)
+    orm_adapter (0.0.5)
+    pg (0.11.0-x86-mingw32)
+    polyglot (0.3.3)
+    rack (1.3.5)
+    rack-cache (1.1)
+      rack (>= 0.4)
+    rack-mount (0.8.3)
+      rack (>= 1.0.0)
+    rack-ssl (1.3.2)
+      rack
+    rack-test (0.6.1)
+      rack (>= 1.0)
+    rails (3.1.1)
+      actionmailer (= 3.1.1)
+      actionpack (= 3.1.1)
+      activerecord (= 3.1.1)
+      activeresource (= 3.1.1)
+      activesupport (= 3.1.1)
+      bundler (~> 1.0)
+      railties (= 3.1.1)
+    rails-erd (0.4.5)
+      activerecord (~> 3.0)
+      activesupport (~> 3.0)
+      ruby-graphviz (~> 0.9.18)
+    railties (3.1.1)
+      actionpack (= 3.1.1)
+      activesupport (= 3.1.1)
+      rack-ssl (~> 1.3.2)
+      rake (>= 0.8.7)
+      rdoc (~> 3.4)
+      thor (~> 0.14.6)
+    rake (0.9.2.2)
+    rdoc (3.11)
+      json (~> 1.4)
+    rmagick (2.12.0)
+    rspec (2.7.0)
+      rspec-core (~> 2.7.0)
+      rspec-expectations (~> 2.7.0)
+      rspec-mocks (~> 2.7.0)
+    rspec-core (2.7.1)
+    rspec-expectations (2.7.0)
+      diff-lcs (~> 1.1.2)
+    rspec-mocks (2.7.0)
+    rspec-rails (2.7.0)
+      actionpack (~> 3.0)
+      activesupport (~> 3.0)
+      railties (~> 3.0)
+      rspec (~> 2.7.0)
+    ruby-graphviz (0.9.21)
+    rubyzip (0.9.5)
+    sass (3.1.11)
+    sass-rails (3.1.5)
+      actionpack (~> 3.1.0)
+      railties (~> 3.1.0)
+      sass (~> 3.1.10)
+      tilt (~> 1.3.2)
+    selenium-webdriver (2.14.0)
+      childprocess (>= 0.2.1)
+      ffi (~> 1.0.9)
+      multi_json (~> 1.0.4)
+      rubyzip
+    sprockets (2.0.3)
+      hike (~> 1.2)
+      rack (~> 1.0)
+      tilt (!= 1.3.0, ~> 1.1)
+    sqlite3 (1.3.5-x86-mingw32)
+    term-ansicolor (1.0.7)
+    therubyracer-heroku (0.8.1.pre3)
+    thor (0.14.6)
+    tilt (1.3.3)
+    treetop (1.4.10)
+      polyglot
+      polyglot (>= 0.3.1)
+    tzinfo (0.3.31)
+    uglifier (1.1.0)
+      execjs (>= 0.3.0)
+      multi_json (>= 1.0.2)
+    warden (1.1.0)
+      rack (>= 1.0)
+    webrat (0.7.3)
+      nokogiri (>= 1.2.0)
+      rack (>= 1.0)
+      rack-test (>= 0.5.3)
+    xml-simple (1.1.1)
+    xpath (0.1.4)
+      nokogiri (~> 1.3)
+
+PLATFORMS
+  x86-mingw32
+
+DEPENDENCIES
+  aws-s3
+  coffee-rails (~> 3.1.1)
+  cucumber
+  cucumber-rails
+  database_cleaner
+  devise
+  jquery-rails
+  moro-miso
+  pg
+  rails (= 3.1.1)
+  rails-erd
+  rmagick (= 2.12.0)
+  rspec
+  rspec-rails
+  sass-rails (~> 3.1.4)
+  sqlite3
+  therubyracer-heroku
+  uglifier (>= 1.0.3)
+  webrat
diff --git a/LISENCE.txt b/LISENCE.txt
new file mode 100644 (file)
index 0000000..3fe62b5
--- /dev/null
@@ -0,0 +1,25 @@
+Copyright (c) 2011, Team Pettan (http://sourceforge.jp/projects/pettanr/)\r
+All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without \r
+modification, are permitted provided that the following conditions are met:\r
+\r
+・Redistributions of source code must retain the above copyright notice, this \r
+  list of conditions and the following disclaimer.\r
+・Redistributions in binary form must reproduce the above copyright notice, \r
+  this list of conditions and the following disclaimer in the documentation \r
+  and/or other materials provided with the distribution.\r
+・Neither the name of the pettanR nor the names of its contributors may be used \r
+  to endorse or promote products derived from this software without specific \r
+  prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" \r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE \r
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE \r
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL \r
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR \r
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER \r
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, \r
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/README.rails b/README.rails
new file mode 100644 (file)
index 0000000..7c36f23
--- /dev/null
@@ -0,0 +1,261 @@
+== Welcome to Rails
+
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+
+This pattern splits the view (also called the presentation) into "dumb"
+templates that are primarily responsible for inserting pre-built data in between
+HTML tags. The model contains the "smart" domain objects (such as Account,
+Product, Person, Post) that holds all the business logic and knows how to
+persist themselves to a database. The controller handles the incoming requests
+(such as Save New Account, Update Product, Show Post) by manipulating the model
+and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting Started
+
+1. At the command prompt, create a new Rails application:
+       <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
+
+2. Change directory to <tt>myapp</tt> and start the web server:
+       <tt>cd myapp; rails server</tt> (run with --help for options)
+
+3. Go to http://localhost:3000/ and you'll see:
+       "Welcome aboard: You're riding Ruby on Rails!"
+
+4. Follow the guidelines to start developing your application. You can find
+the following resources handy:
+
+* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
+* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands
+running on the server.log and development.log. Rails will automatically display
+debugging and runtime information to these files. Debugging info will also be
+shown in the browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code
+using the Ruby logger class from inside your controllers. Example:
+
+  class WeblogController < ActionController::Base
+    def destroy
+      @weblog = Weblog.find(params[:id])
+      @weblog.destroy
+      logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+    end
+  end
+
+The result will be a message in your log file along the lines of:
+
+  Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
+several books available online as well:
+
+* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two books will bring you up to speed on the Ruby language and also on
+programming in general.
+
+
+== Debugger
+
+Debugger support is available through the debugger command when you start your
+Mongrel or WEBrick server with --debugger. This means that you can break out of
+execution at any point in the code, investigate and change the model, and then,
+resume execution! You need to install ruby-debug to run the server in debugging
+mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
+
+  class WeblogController < ActionController::Base
+    def index
+      @posts = Post.all
+      debugger
+    end
+  end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the server window. Here you can do things like:
+
+  >> @posts.inspect
+  => "[#<Post:0x14a6be8
+          @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
+       #<Post:0x14a6620
+          @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
+  >> @posts.first.title = "hello from a debugger"
+  => "hello from a debugger"
+
+...and even better, you can examine how your runtime objects actually work:
+
+  >> f = @posts.first
+  => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+  >> f.
+  Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you can enter "cont".
+
+
+== Console
+
+The console is a Ruby shell, which allows you to interact with your
+application's domain model. Here you'll have all parts of the application
+configured, just like it is when the application is running. You can inspect
+domain models, change values, and save to the database. Starting the script
+without arguments will launch it in the development environment.
+
+To start the console, run <tt>rails console</tt> from the application
+directory.
+
+Options:
+
+* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
+  made to the database.
+* Passing an environment name as an argument will load the corresponding
+  environment. Example: <tt>rails console production</tt>.
+
+To reload your controllers and models after launching the console run
+<tt>reload!</tt>
+
+More information about irb can be found at:
+link:http://www.rubycentral.org/pickaxe/irb.html
+
+
+== dbconsole
+
+You can go to the command line of your database directly through <tt>rails
+dbconsole</tt>. You would be connected to the database with the credentials
+defined in database.yml. Starting the script without arguments will connect you
+to the development database. Passing an argument will connect you to a different
+database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
+PostgreSQL and SQLite 3.
+
+== Description of Contents
+
+The default directory structure of a generated Ruby on Rails application:
+
+  |-- app
+  |   |-- assets
+  |       |-- images
+  |       |-- javascripts
+  |       `-- stylesheets
+  |   |-- controllers
+  |   |-- helpers
+  |   |-- mailers
+  |   |-- models
+  |   `-- views
+  |       `-- layouts
+  |-- config
+  |   |-- environments
+  |   |-- initializers
+  |   `-- locales
+  |-- db
+  |-- doc
+  |-- lib
+  |   `-- tasks
+  |-- log
+  |-- public
+  |-- script
+  |-- test
+  |   |-- fixtures
+  |   |-- functional
+  |   |-- integration
+  |   |-- performance
+  |   `-- unit
+  |-- tmp
+  |   |-- cache
+  |   |-- pids
+  |   |-- sessions
+  |   `-- sockets
+  `-- vendor
+      |-- assets
+          `-- stylesheets
+      `-- plugins
+
+app
+  Holds all the code that's specific to this particular application.
+
+app/assets
+  Contains subdirectories for images, stylesheets, and JavaScript files.
+
+app/controllers
+  Holds controllers that should be named like weblogs_controller.rb for
+  automated URL mapping. All controllers should descend from
+  ApplicationController which itself descends from ActionController::Base.
+
+app/models
+  Holds models that should be named like post.rb. Models descend from
+  ActiveRecord::Base by default.
+
+app/views
+  Holds the template files for the view that should be named like
+  weblogs/index.html.erb for the WeblogsController#index action. All views use
+  eRuby syntax by default.
+
+app/views/layouts
+  Holds the template files for layouts to be used with views. This models the
+  common header/footer method of wrapping views. In your views, define a layout
+  using the <tt>layout :default</tt> and create a file named default.html.erb.
+  Inside default.html.erb, call <% yield %> to render the view using this
+  layout.
+
+app/helpers
+  Holds view helpers that should be named like weblogs_helper.rb. These are
+  generated for you automatically when using generators for controllers.
+  Helpers can be used to wrap functionality for your views into methods.
+
+config
+  Configuration files for the Rails environment, the routing map, the database,
+  and other dependencies.
+
+db
+  Contains the database schema in schema.rb. db/migrate contains all the
+  sequence of Migrations for your schema.
+
+doc
+  This directory is where your application documentation will be stored when
+  generated using <tt>rake doc:app</tt>
+
+lib
+  Application specific libraries. Basically, any kind of custom code that
+  doesn't belong under controllers, models, or helpers. This directory is in
+  the load path.
+
+public
+  The directory available for the web server. Also contains the dispatchers and the
+  default HTML files. This should be set as the DOCUMENT_ROOT of your web
+  server.
+
+script
+  Helper scripts for automation and generation.
+
+test
+  Unit and functional tests along with fixtures. When using the rails generate
+  command, template test files will be generated for you and placed in this
+  directory.
+
+vendor
+  External libraries that the application depends on. Also includes the plugins
+  subdirectory. If the app has frozen rails, those gems also go here, under
+  vendor/rails/. This directory is in the load path.
diff --git a/Rakefile b/Rakefile
new file mode 100644 (file)
index 0000000..82351ad
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Pettanr::Application.load_tasks
diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png
new file mode 100644 (file)
index 0000000..d5edc04
Binary files /dev/null and b/app/assets/images/rails.png differ
diff --git a/app/assets/javascripts/admins/sessions.js.coffee b/app/assets/javascripts/admins/sessions.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
new file mode 100644 (file)
index 0000000..37c7bfc
--- /dev/null
@@ -0,0 +1,9 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
diff --git a/app/assets/javascripts/artists.js.coffee b/app/assets/javascripts/artists.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/authors/sessions.js.coffee b/app/assets/javascripts/authors/sessions.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/baloon_templates.js.coffee b/app/assets/javascripts/baloon_templates.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/baloon_types.js.coffee b/app/assets/javascripts/baloon_types.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/baloons.js.coffee b/app/assets/javascripts/baloons.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/comics.js.coffee b/app/assets/javascripts/comics.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/common_lisences.js.coffee b/app/assets/javascripts/common_lisences.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/help.js.coffee b/app/assets/javascripts/help.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/home.js.coffee b/app/assets/javascripts/home.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/lisences.js.coffee b/app/assets/javascripts/lisences.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/original_lisences.js.coffee b/app/assets/javascripts/original_lisences.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/original_pictures.js.coffee b/app/assets/javascripts/original_pictures.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/panels.js.coffee b/app/assets/javascripts/panels.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/pictures.js.coffee b/app/assets/javascripts/pictures.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/source_pictures.js.coffee b/app/assets/javascripts/source_pictures.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/speach_baloons.js.coffee b/app/assets/javascripts/speach_baloons.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/speach_templates.js.coffee b/app/assets/javascripts/speach_templates.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/speachbaloons.js.coffee b/app/assets/javascripts/speachbaloons.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/speaches.js.coffee b/app/assets/javascripts/speaches.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/javascripts/system.js.coffee b/app/assets/javascripts/system.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/stylesheets/admins/sessions.css.scss b/app/assets/stylesheets/admins/sessions.css.scss
new file mode 100644 (file)
index 0000000..c6bbc18
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the admins/sessions controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
new file mode 100644 (file)
index 0000000..fc25b57
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require_tree . 
+*/
\ No newline at end of file
diff --git a/app/assets/stylesheets/artists.css.scss b/app/assets/stylesheets/artists.css.scss
new file mode 100644 (file)
index 0000000..cf63878
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the artists controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/authors/sessions.css.scss b/app/assets/stylesheets/authors/sessions.css.scss
new file mode 100644 (file)
index 0000000..244137d
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the authors/sessions controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/baloon_templates.css.scss b/app/assets/stylesheets/baloon_templates.css.scss
new file mode 100644 (file)
index 0000000..06e9b14
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the baloon_templates controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/baloon_types.css.scss b/app/assets/stylesheets/baloon_types.css.scss
new file mode 100644 (file)
index 0000000..ca4b2f3
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the baloon_types controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/baloons.css.scss b/app/assets/stylesheets/baloons.css.scss
new file mode 100644 (file)
index 0000000..67e17d0
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the baloons controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/comics.css.scss b/app/assets/stylesheets/comics.css.scss
new file mode 100644 (file)
index 0000000..6ef66b0
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the comics controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/common_lisences.css.scss b/app/assets/stylesheets/common_lisences.css.scss
new file mode 100644 (file)
index 0000000..3d954b1
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the common_lisences controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/help.css.scss b/app/assets/stylesheets/help.css.scss
new file mode 100644 (file)
index 0000000..a2342cb
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the help controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/home.css.scss b/app/assets/stylesheets/home.css.scss
new file mode 100644 (file)
index 0000000..f0ddc68
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the home controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/lisences.css.scss b/app/assets/stylesheets/lisences.css.scss
new file mode 100644 (file)
index 0000000..ea7f80b
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the lisences controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/original_lisences.css.scss b/app/assets/stylesheets/original_lisences.css.scss
new file mode 100644 (file)
index 0000000..f9474df
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the original_lisences controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/original_pictures.css.scss b/app/assets/stylesheets/original_pictures.css.scss
new file mode 100644 (file)
index 0000000..48be6db
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the original_pictures controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/panels.css.scss b/app/assets/stylesheets/panels.css.scss
new file mode 100644 (file)
index 0000000..9d1f3f6
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the panels controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/pictures.css.scss b/app/assets/stylesheets/pictures.css.scss
new file mode 100644 (file)
index 0000000..8355327
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the pictures controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss
new file mode 100644 (file)
index 0000000..05188f0
--- /dev/null
@@ -0,0 +1,56 @@
+body {
+  background-color: #fff;
+  color: #333;
+  font-family: verdana, arial, helvetica, sans-serif;
+  font-size: 13px;
+  line-height: 18px; }
+
+p, ol, ul, td {
+  font-family: verdana, arial, helvetica, sans-serif;
+  font-size: 13px;
+  line-height: 18px; }
+
+pre {
+  background-color: #eee;
+  padding: 10px;
+  font-size: 11px; }
+
+a {
+  color: #000;
+  &:visited {
+    color: #666; }
+  &:hover {
+    color: #fff;
+    background-color: #000; } }
+
+div {
+  &.field, &.actions {
+    margin-bottom: 10px; } }
+
+#notice {
+  color: green; }
+
+.field_with_errors {
+  padding: 2px;
+  background-color: red;
+  display: table; }
+
+#error_explanation {
+  width: 450px;
+  border: 2px solid red;
+  padding: 7px;
+  padding-bottom: 0;
+  margin-bottom: 20px;
+  background-color: #f0f0f0;
+  h2 {
+    text-align: left;
+    font-weight: bold;
+    padding: 5px 5px 5px 15px;
+    font-size: 12px;
+    margin: -7px;
+    margin-bottom: 0px;
+    background-color: #c00;
+    color: #fff; }
+  ul li {
+    font-size: 12px;
+    list-style: square; } }
diff --git a/app/assets/stylesheets/source_pictures.css.scss b/app/assets/stylesheets/source_pictures.css.scss
new file mode 100644 (file)
index 0000000..d9973ed
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the source_pictures controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/speach_baloons.css.scss b/app/assets/stylesheets/speach_baloons.css.scss
new file mode 100644 (file)
index 0000000..085a9a2
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the speach_baloons controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/speach_templates.css.scss b/app/assets/stylesheets/speach_templates.css.scss
new file mode 100644 (file)
index 0000000..7fe46be
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the speach_templates controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/speachbaloons.css.scss b/app/assets/stylesheets/speachbaloons.css.scss
new file mode 100644 (file)
index 0000000..af35a9e
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the speachbaloons controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/speaches.css.scss b/app/assets/stylesheets/speaches.css.scss
new file mode 100644 (file)
index 0000000..2b19f3b
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the speaches controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/system.css.scss b/app/assets/stylesheets/system.css.scss
new file mode 100644 (file)
index 0000000..9c5e904
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the system controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
new file mode 100644 (file)
index 0000000..2741dd3
--- /dev/null
@@ -0,0 +1,22 @@
+class ApplicationController < ActionController::Base
+  protect_from_forgery
+  before_filter :bf
+  
+  def bf
+    if Admin.count.to_i == 0
+      if params[:controller] == 'system' and params[:action] == 'start'
+      else
+        redirect_to :controller => '/system', :action => 'start'
+      end
+    else
+      if author_signed_in?
+        @artist = if current_author.artist?
+          current_author.artist
+        else
+          Artist.new author_id: current_author.id, email: current_author.email, name: current_author.name
+        end
+      end
+    end
+  end
+  
+end
diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb
new file mode 100644 (file)
index 0000000..442890a
--- /dev/null
@@ -0,0 +1,83 @@
+class ArtistsController < ApplicationController
+  # GET /artists
+  # GET /artists.json
+  def index
+    @artists = Artist.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @artists }
+    end
+  end
+
+  # GET /artists/1
+  # GET /artists/1.json
+  def show
+    @artist = Artist.find(params[:id])
+
+    respond_to do |format|
+      format.html # show.html.erb
+      format.json { render json: @artist }
+    end
+  end
+
+  # GET /artists/new
+  # GET /artists/new.json
+  def new
+    @artist = Artist.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @artist }
+    end
+  end
+
+  # GET /artists/1/edit
+  def edit
+    @artist = Artist.find(params[:id])
+  end
+
+  # POST /artists
+  # POST /artists.json
+  def create
+    @artist = Artist.new(params[:artist])
+
+    respond_to do |format|
+      if @artist.save
+        format.html { redirect_to @artist, notice: 'Artist was successfully created.' }
+        format.json { render json: @artist, status: :created, location: @artist }
+      else
+        format.html { render action: "new" }
+        format.json { render json: @artist.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # PUT /artists/1
+  # PUT /artists/1.json
+  def update
+    @artist = Artist.find(params[:id])
+
+    respond_to do |format|
+      if @artist.update_attributes(params[:artist])
+        format.html { redirect_to @artist, notice: 'Artist was successfully updated.' }
+        format.json { head :ok }
+      else
+        format.html { render action: "edit" }
+        format.json { render json: @artist.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # DELETE /artists/1
+  # DELETE /artists/1.json
+  def destroy
+    @artist = Artist.find(params[:id])
+    @artist.destroy
+
+    respond_to do |format|
+      format.html { redirect_to artists_url }
+      format.json { head :ok }
+    end
+  end
+end
diff --git a/app/controllers/balloon_templates_controller.rb b/app/controllers/balloon_templates_controller.rb
new file mode 100644 (file)
index 0000000..a1ef251
--- /dev/null
@@ -0,0 +1,86 @@
+class BalloonTemplatesController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index]
+  
+  # GET /balloon_templates
+  # GET /balloon_templates.json
+  def index
+    @balloon_templates = BalloonTemplate.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @balloon_templates }
+    end
+  end
+=begin
+  # GET /balloon_templates/1
+  # GET /balloon_templates/1.json
+  def show
+    @balloon_template = BalloonTemplate.find(params[:id])
+
+    respond_to do |format|
+      format.html # show.html.erb
+      format.json { render json: @balloon_template }
+    end
+  end
+
+  # GET /balloon_templates/new
+  # GET /balloon_templates/new.json
+  def new
+    @balloon_template = BalloonTemplate.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @balloon_template }
+    end
+  end
+
+  # GET /balloon_templates/1/edit
+  def edit
+    @balloon_template = BalloonTemplate.find(params[:id])
+  end
+
+  # POST /balloon_templates
+  # POST /balloon_templates.json
+  def create
+    @balloon_template = BalloonTemplate.new(params[:balloon_template])
+
+    respond_to do |format|
+      if @balloon_template.save
+        format.html { redirect_to @balloon_template, notice: 'Balloon template was successfully created.' }
+        format.json { render json: @balloon_template, status: :created, location: @balloon_template }
+      else
+        format.html { render action: "new" }
+        format.json { render json: @balloon_template.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # PUT /balloon_templates/1
+  # PUT /balloon_templates/1.json
+  def update
+    @balloon_template = BalloonTemplate.find(params[:id])
+
+    respond_to do |format|
+      if @balloon_template.update_attributes(params[:balloon_template])
+        format.html { redirect_to @balloon_template, notice: 'Balloon template was successfully updated.' }
+        format.json { head :ok }
+      else
+        format.html { render action: "edit" }
+        format.json { render json: @balloon_template.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # DELETE /balloon_templates/1
+  # DELETE /balloon_templates/1.json
+  def destroy
+    @balloon_template = BalloonTemplate.find(params[:id])
+    @balloon_template.destroy
+
+    respond_to do |format|
+      format.html { redirect_to balloon_templates_url }
+      format.json { head :ok }
+    end
+  end
+=end
+end
diff --git a/app/controllers/balloons_controller.rb b/app/controllers/balloons_controller.rb
new file mode 100644 (file)
index 0000000..617e9b5
--- /dev/null
@@ -0,0 +1,86 @@
+class BalloonsController < ApplicationController
+  before_filter :authenticate_user!, :except => [:index]
+  # GET /balloons
+  # GET /balloons.json
+  def index
+    @balloons = Balloon.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @balloons }
+    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
+
+    respond_to do |format|
+      format.html { redirect_to balloons_url }
+      format.json { head :ok }
+    end
+  end
+=end
+end
diff --git a/app/controllers/comics_controller.rb b/app/controllers/comics_controller.rb
new file mode 100644 (file)
index 0000000..2d3664a
--- /dev/null
@@ -0,0 +1,133 @@
+class ComicsController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index, :show, :play]
+
+  private
+  
+  def treat_param comic
+    comic.author_id = current_author.id
+  end
+  
+  public
+  
+  def top
+  end
+  
+  # GET /comics
+  # GET /comics.json
+  def index
+    @comics = Comic.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @comics }
+    end
+  end
+
+  # GET /comics/1
+  # GET /comics/1.json
+  def show
+    @comic = Comic.find(params[:id])
+
+    respond_to do |format|
+      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.seqno')
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json {
+        render :json => @comic.to_json(
+          :include => {
+            :panels => {:include => {
+              :panel_pictures => {:include => :resource_picture}, 
+              :balloons => {:include => :speaches}
+            }}
+          }
+        )
+      }
+      format.jsonp {
+        render :json => "callback(" + @comic.to_json(
+          :include => {
+            :panels => {:include => {
+              :panel_pictures => {:include => :resource_picture}, 
+              :balloons => {:include => :speaches}
+            }}
+          }
+        ) + ");"
+      }
+    end
+  end
+  
+  # GET /comics/new
+  # GET /comics/new.json
+  def new
+    @comic = Comic.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @comic }
+    end
+  end
+
+  # GET /comics/1/edit
+  def edit
+    @comic = Comic.find(params[:id])
+  end
+
+  # POST /comics
+  # POST /comics.json
+  def create
+    @comic = Comic.new(params[:comic])
+    treat_param @comic
+
+    respond_to do |format|
+      if @comic.save
+        format.html { redirect_to @comic, notice: 'Comic was successfully created.' }
+        format.json { render json: @comic, status: :created, location: @comic }
+      else
+        format.html { render action: "new" }
+        format.json { render json: @comic.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # PUT /comics/1
+  # PUT /comics/1.json
+  def update
+    @comic = Comic.find(params[:id])
+    if @comic.own? current_author
+      respond_to do |format|
+        if @comic.update_attributes(params[:comic])
+          format.html { redirect_to @comic, notice: 'Comic was successfully updated.' }
+          format.json { head :ok }
+        else
+          format.html { render action: "edit" }
+          format.json { render json: @comic.errors, status: :unprocessable_entity }
+        end
+      end
+    else
+      format.html { render action: "edit" }
+      format.json { render json: @comic.errors, status: :unprocessable_entity }
+    end
+  end
+
+  # DELETE /comics/1
+  # DELETE /comics/1.json
+  def destroy
+    @comic = Comic.find(params[:id])
+    if @comic.own? current_author
+      @comic.destroy
+      respond_to do |format|
+        format.html { redirect_to comics_url }
+        format.json { head :ok }
+      end
+    else
+      format.html { render action: "edit" }
+      format.json { render json: @comic.errors, status: :unprocessable_entity }
+    end
+  end
+end
diff --git a/app/controllers/common_lisences_controller.rb b/app/controllers/common_lisences_controller.rb
new file mode 100644 (file)
index 0000000..35ac50d
--- /dev/null
@@ -0,0 +1,85 @@
+class CommonLisencesController < ApplicationController
+  # GET /common_lisences
+  # GET /common_lisences.json
+  def index
+    @common_lisences = CommonLisence.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @common_lisences }
+    end
+  end
+
+  # GET /common_lisences/1
+  # GET /common_lisences/1.json
+  def show
+    @common_lisence = CommonLisence.find(params[:id])
+
+    respond_to do |format|
+      format.html # show.html.erb
+      format.json { render json: @common_lisence }
+    end
+  end
+
+  # GET /common_lisences/new
+  # GET /common_lisences/new.json
+  def new
+    @common_lisence = CommonLisence.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @common_lisence }
+    end
+  end
+
+  # GET /common_lisences/1/edit
+  def edit
+    @common_lisence = CommonLisence.find(params[:id])
+  end
+
+  # POST /common_lisences
+  # POST /common_lisences.json
+  def create
+    @common_lisence = CommonLisence.new(params[:common_lisence])
+
+    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.json { render json: @common_lisence, status: :created, location: @common_lisence }
+        else
+          format.html { render action: "new" }
+          format.json { render json: @common_lisence.errors, status: :unprocessable_entity }
+        end
+      end
+    end
+  end
+
+  # PUT /common_lisences/1
+  # PUT /common_lisences/1.json
+  def update
+    @common_lisence = CommonLisence.find(params[:id])
+
+    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.json { head :ok }
+      else
+        format.html { render action: "edit" }
+        format.json { render json: @common_lisence.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # DELETE /common_lisences/1
+  # DELETE /common_lisences/1.json
+  def destroy
+    @common_lisence = CommonLisence.find(params[:id])
+    @common_lisence.destroy
+
+    respond_to do |format|
+      format.html { redirect_to common_lisences_url }
+      format.json { head :ok }
+    end
+  end
+end
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
new file mode 100644 (file)
index 0000000..f9d547e
--- /dev/null
@@ -0,0 +1,3 @@
+class HelpController < ApplicationController
+
+end
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
new file mode 100644 (file)
index 0000000..cc3895a
--- /dev/null
@@ -0,0 +1,13 @@
+class HomeController < ApplicationController
+  
+  def start
+    
+  end
+  
+  def index
+  end
+  
+  def profile
+  end
+  
+end
diff --git a/app/controllers/lisences_controller.rb b/app/controllers/lisences_controller.rb
new file mode 100644 (file)
index 0000000..941c838
--- /dev/null
@@ -0,0 +1,83 @@
+class LisencesController < ApplicationController
+  # GET /lisences
+  # GET /lisences.json
+  def index
+    @lisences = Lisence.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @lisences }
+    end
+  end
+
+  # GET /lisences/1
+  # 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
+    end
+  end
+
+  # PUT /lisences/1
+  # PUT /lisences/1.json
+  def update
+    @lisence = Lisence.find(params[:id])
+
+    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
+    end
+  end
+
+  # DELETE /lisences/1
+  # DELETE /lisences/1.json
+  def destroy
+    @lisence = Lisence.find(params[:id])
+    @lisence.destroy
+
+    respond_to do |format|
+      format.html { redirect_to lisences_url }
+      format.json { head :ok }
+    end
+  end
+end
diff --git a/app/controllers/original_lisences_controller.rb b/app/controllers/original_lisences_controller.rb
new file mode 100644 (file)
index 0000000..d43d0f4
--- /dev/null
@@ -0,0 +1,85 @@
+class OriginalLisencesController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index]
+
+  # GET /original_lisences
+  # GET /original_lisences.json
+  def index
+    @original_lisences = OriginalLisence.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @original_lisences }
+    end
+  end
+
+  # GET /original_lisences/1
+  # GET /original_lisences/1.json
+  def show
+    @original_lisence = OriginalLisence.find(params[:id])
+
+    respond_to do |format|
+      format.html # show.html.erb
+      format.json { render json: @original_lisence }
+    end
+  end
+
+  # GET /original_lisences/new
+  # GET /original_lisences/new.json
+  def new
+    @original_lisence = OriginalLisence.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @original_lisence }
+    end
+  end
+
+  # GET /original_lisences/1/edit
+  def edit
+    @original_lisence = OriginalLisence.find(params[:id])
+  end
+
+  # POST /original_lisences
+  # POST /original_lisences.json
+  def create
+    @original_lisence = OriginalLisence.new(params[:original_lisence])
+    @original_lisence.artist_id = current_author.artist.id
+    respond_to do |format|
+      if @original_lisence.save
+        format.html { redirect_to @original_lisence, notice: 'Original lisence was successfully created.' }
+        format.json { render json: @original_lisence, status: :created, location: @original_lisence }
+      else
+        format.html { render action: "new" }
+        format.json { render json: @original_lisence.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # PUT /original_lisences/1
+  # PUT /original_lisences/1.json
+  def update
+    @original_lisence = OriginalLisence.find(params[:id])
+
+    respond_to do |format|
+      if @original_lisence.update_attributes(params[:original_lisence])
+        format.html { redirect_to @original_lisence, notice: 'Original lisence was successfully updated.' }
+        format.json { head :ok }
+      else
+        format.html { render action: "edit" }
+        format.json { render json: @original_lisence.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # DELETE /original_lisences/1
+  # DELETE /original_lisences/1.json
+  def destroy
+    @original_lisence = OriginalLisence.find(params[:id])
+    @original_lisence.destroy
+
+    respond_to do |format|
+      format.html { redirect_to original_lisences_url }
+      format.json { head :ok }
+    end
+  end
+end
diff --git a/app/controllers/original_pictures_controller.rb b/app/controllers/original_pictures_controller.rb
new file mode 100644 (file)
index 0000000..ac85efe
--- /dev/null
@@ -0,0 +1,184 @@
+class OriginalPicturesController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index, :show]
+
+  private
+  
+  def set_image(prm)
+    img = nil
+    if (f = prm[:original_picture][:file]).respond_to?(:read)
+      if f.size > 1000000
+        @original_picture.width = 0
+        @original_picture.height = 0
+        @original_picture.ext = 'none'
+        @original_picture.filesize = 1.megabytes
+      else
+        img = Magick::Image.from_blob(f.read).shift
+        @original_picture.width = img.columns
+        @original_picture.height = img.rows
+        @original_picture.ext = img.format.downcase
+        @original_picture.filesize = f.size
+      end
+    else
+      dat = Base64.decode64(prm[:original_picture][:file].to_s.gsub(' ', '+')) #rubyのバグ?+でデコードされるべきキャラがスペースになる
+      img = Magick::Image.from_blob(dat).shift
+      @original_picture.width = img.columns
+      @original_picture.height = img.rows
+      @original_picture.ext = img.format.downcase
+      @original_picture.filesize = 1000
+    end
+    img
+  end
+  
+  public
+  
+  # GET /original_pictures
+  # GET /original_pictures.json
+  def index
+    @original_pictures = OriginalPicture.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @original_pictures }
+    end
+  end
+
+  # GET /original_pictures/1
+  # GET /original_pictures/1.json
+  def show
+    @original_picture = OriginalPicture.find(params[:id])
+#    if params[:subdir] == 'refresh'
+#      refresh 
+#      return
+#    end
+
+    respond_to do |format|
+      opt = {:type => @original_picture.mime_type, :disposition=>"inline"}
+      format.png { send_data(@original_picture.restore, opt ) }
+      format.gif { send_data(@original_picture.restore, opt ) }
+      format.jpeg { send_data(@original_picture.restore, opt ) }
+      format.html # show.html.erb
+      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.store img
+    respond_to do |format|
+      format.html { redirect_to original_pictures_url }
+    end
+  end
+  
+  # GET /original_pictures/new
+  # GET /original_pictures/new.json
+  def new
+    @original_picture = OriginalPicture.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @original_picture }
+    end
+  end
+
+  # GET /original_pictures/1/edit
+  def edit
+    @original_picture = OriginalPicture.find(params[:id])
+  end
+
+  # POST /original_pictures
+  # POST /original_pictures.json
+  def create
+    unless @artist
+      respond_to do |format|
+        format.html { redirect_to @original_picture, notice: 'Failed! author does not artist.' }
+        format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+      end
+      return
+    end
+    @original_picture = OriginalPicture.new
+    img = set_image params
+    @original_picture.artist_id = current_author.artist.id
+
+    respond_to do |format|
+      OriginalPicture.transaction do
+        if @original_picture.save
+          if @original_picture.store(img)
+            format.html { redirect_to @original_picture, notice: 'Original picture was successfully created.' }
+            format.json { render json: @original_picture, status: :created, location: @original_picture }
+          else
+            format.html { redirect_to @original_picture, notice: 'Failed! Original picture was NOT created.' }
+            format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+          end
+        else
+          format.html { render action: "new" }
+          format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+        end
+      end
+    end
+  end
+
+  # PUT /original_pictures/1
+  # PUT /original_pictures/1.json
+  def update
+    unless @artist
+      respond_to do |format|
+        format.html { redirect_to @original_picture, notice: 'Failed! author does not artist.' }
+        format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+      end
+      return
+    end
+    @original_picture = OriginalPicture.find(params[:id])
+    unless @original_picture.own? current_author
+      respond_to do |format|
+        format.html { redirect_to @original_picture, notice: 'Failed! ' }
+        format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+      end
+      return
+    end
+    img = set_image params
+
+    respond_to do |format|
+      OriginalPicture.transaction do
+        if @original_picture.save
+          if @original_picture.store(img)
+            format.html { redirect_to @original_picture, notice: 'Original picture was successfully updated.' }
+            format.json { head :ok }
+          else
+            format.html { redirect_to @original_picture, notice: 'Failed! Original picture was NOT created.' }
+            format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+          end
+        else
+          format.html { render action: "edit" }
+          format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+        end
+      end
+    end
+  end
+
+  # DELETE /original_pictures/1
+  # DELETE /original_pictures/1.json
+  def destroy
+    unless @artist
+      respond_to do |format|
+        format.html { redirect_to @original_picture, notice: 'Failed! author does not artist.' }
+        format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+      end
+      return
+    end
+    @original_picture = OriginalPicture.find(params[:id])
+    unless @original_picture.own? current_author
+      respond_to do |format|
+        format.html { redirect_to @original_picture, notice: 'Failed! ' }
+        format.json { render json: @original_picture.errors, status: :unprocessable_entity }
+      end
+      return
+    end
+    @original_picture.destroy
+
+    respond_to do |format|
+      format.html { redirect_to original_pictures_url }
+      format.json { head :ok }
+    end
+  end
+end
diff --git a/app/controllers/panel_pictures_controller.rb b/app/controllers/panel_pictures_controller.rb
new file mode 100644 (file)
index 0000000..94d3218
--- /dev/null
@@ -0,0 +1,15 @@
+class PanelPicturesController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index]
+
+  # GET /panel_pictures
+  # GET /panel_pictures.json
+  def index
+    @panel_pictures = PanelPicture.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @panel_pictures }
+    end
+  end
+
+end
diff --git a/app/controllers/panels_controller.rb b/app/controllers/panels_controller.rb
new file mode 100644 (file)
index 0000000..e0a7789
--- /dev/null
@@ -0,0 +1,141 @@
+class PanelsController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index, :show]
+
+  private
+  
+  def treat_param panel
+    panel.author_id = current_author.id
+  end
+  
+  public
+  
+  # GET /panels
+  # GET /panels.json
+  def index
+    @panels = Panel.all :order => 'updated_at'
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @panels }
+    end
+  end
+
+  # GET /panels/1
+  # GET /panels/1.json
+  def show
+    @panel = Panel.find(params[:id], include: [:comic, :panel_pictures => :resource_picture, :balloons => :speaches])# only: [:width, :height])
+
+    respond_to do |format|
+      format.html # show.html.erb
+       format.json {
+        render :json => @panel.to_json(include: {
+          :comic => {}, :panel_pictures => {:include => :image}, :fukidashis => {:include => :serifus}
+        })
+      }
+      format.jsonp {
+        render :json => "callback(" + @panel.to_json(include: {
+          :comic => {}, :panel_pictures => {:include => :image}, :fukidashis => {:include => :serifus}
+        }) + ");"
+      }
+#      format.json { render :json => @frame.to_json(include: {
+#        :comic => {:only => :title}, :panel_pictures => {:include => {:image => {:only => [:width]}},:only => [:width, :height, :zindex, :image_id]}
+#      }, only: [:border]) }
+   end
+  end
+
+  # GET /panels/new
+  # GET /panels/new.json
+  def new
+    @panel = Panel.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @panel }
+    end
+  end
+
+  # GET /panels/1/edit
+  def edit
+    @panel = Panel.find(params[:id])
+  end
+
+  # POST /panels
+  # POST /panels.json
+  def create
+    @panel = Panel.new(params[:panel])
+    treat_param @panel
+    @comic = Comic.find @panel.comic_id
+
+    respond_to do |format|
+      Panel.transaction do
+        if @panel.vdt_save
+          format.html { redirect_to @panel, notice: 'Panel was successfully created.' }
+          format.json { render json: @panel, status: :created, location: @panel }
+        else
+          format.html { render action: "new" }
+          format.json { render json: @panel.errors, status: :unprocessable_entity }
+        end
+      end
+    end
+  end
+
+  # PUT /panels/1
+  # PUT /panels/1.json
+  def update
+    @panel = Panel.find(params[:id])
+    if @panel.own? current_author
+      respond_to do |format|
+        Panel.transaction do
+          if params[:panel][:seqno] and params[:panel][:seqno].to_i != @panel.seqno
+            @panel.move_to params[:panel][:seqno].to_i
+          end
+          if @panel.update_attributes(params[:panel])
+            format.html { redirect_to @panel, notice: 'Panel was successfully updated.' }
+            format.json { head :ok }
+          else
+            format.html { render action: "edit" }
+            format.json { render json: @panel.errors, status: :unprocessable_entity }
+          end
+        end
+      end
+    else
+      format.html { render action: "edit" }
+      format.json { render json: @panel.errors, status: :unprocessable_entity }
+    end
+  end
+
+  # DELETE /panels/1
+  # DELETE /panels/1.json
+  def destroy
+    @panel = Panel.find(params[:id])
+    if @panel.own? current_author
+      respond_to do |format|
+        Panel.transaction do
+          @panel.destroy_and_shorten
+          format.html { redirect_to panels_url }
+          format.json { head :ok }
+        end
+      end
+    else
+      format.html { render action: "edit" }
+      format.json { render json: @panel.errors, status: :unprocessable_entity }
+    end
+  end
+  
+  def move
+    @panel = Panel.find(params[:id])
+    @new_seq = params[:panel][:seqno].to_i
+    respond_to do |format|
+      Panel.transaction do
+        if @panel.move_to(@new_seq)
+          format.html { redirect_to @panel, notice: 'Panel was successfully moved.' }
+          format.json { head :ok }
+        else
+          format.html { render action: "show" }
+          format.json { render json: @panel.errors, status: :unprocessable_entity }
+        end
+      end
+    end
+  end
+  
+end
diff --git a/app/controllers/resource_pictures_controller.rb b/app/controllers/resource_pictures_controller.rb
new file mode 100644 (file)
index 0000000..f422561
--- /dev/null
@@ -0,0 +1,91 @@
+class ResourcePicturesController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index, :show]
+
+  # GET /resource_pictures
+  # GET /resource_pictures.json
+  def index
+    @resource_pictures = ResourcePicture.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @resource_pictures }
+    end
+  end
+
+  # GET /resource_pictures/1
+  # GET /resource_pictures/1.json
+  def show
+    @resource_picture = ResourcePicture.find(params[:id])
+
+    respond_to do |format|
+      opt = {:type => @resource_picture.mime_type, :disposition=>"inline"}
+      format.png { send_data(@resource_picture.restore(params[:subdir]), opt ) }
+      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.json { render json: @resource_picture}
+    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])
+
+    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
+    end
+  end
+
+  # PUT /resource_pictures/1
+  # PUT /resource_pictures/1.json
+  def update
+    @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
+    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
diff --git a/app/controllers/speach_balloons_controller.rb b/app/controllers/speach_balloons_controller.rb
new file mode 100644 (file)
index 0000000..3297494
--- /dev/null
@@ -0,0 +1,127 @@
+class SpeachBalloonsController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index]
+
+  private
+  
+  def validate_param(ft)
+    res = nil
+    bl = ft[:border_limit].to_i
+    tl = ft[:tail_limit].to_i
+    if bl * tl == ft[:balloon_templates_attributes].size
+      flag = []
+      bl.times do |i|
+        flag[i] = []
+        tl.times do |j|
+          flag[i][j] = true
+        end
+      end
+      ft[:balloon_templates_attributes].each do |k, t|
+        flag[t[:border].to_i - 1][t[:tail].to_i - 1] = nil
+      end
+      if flag.flatten.compact.size == 0
+      else
+        res = "invalid variation"
+      end
+    else
+      res = "invalid template size"
+    end
+    res
+  end
+  
+  public  # GET /speach_balloons
+  # GET /speach_balloons.json
+  def index
+    @speach_balloons = SpeachBalloon.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @speach_balloons }
+    end
+  end
+
+  # GET /speach_balloons/1
+  # GET /speach_balloons/1.json
+  def show
+    @speach_balloon = SpeachBalloon.find(params[:id], include: {:balloon_templates => :speach_templates})
+
+    respond_to do |format|
+      format.html # show.html.erb
+      format.json {
+        render :json => @speach_balloon.to_json(include: {
+          :balloon_templates => {:include => :speach_templates}
+        })
+      }
+      format.jsonp {
+        render :json => "callback(" + @speach_balloon.to_json(include: {
+          :balloon_templates => {:include => :speach_templates}
+        }) + ")"
+      }
+    end
+  end
+
+  # GET /speach_balloons/new
+  # GET /speach_balloons/new.json
+  def new
+    @speach_balloon = SpeachBalloon.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @speach_balloon }
+    end
+  end
+
+  # GET /speach_balloons/1/edit
+  def edit
+    @speach_balloon = SpeachBalloon.find(params[:id])
+  end
+
+  # POST /speach_balloons
+  # POST /speach_balloons.json
+  def create
+    @speach_balloon = SpeachBalloon.new(params[:speach_balloon])
+
+    if em = validate_param(params[:speach_balloon])
+      respond_to do |format|
+        format.json { render json: em, status: :unprocessable_entity }
+      end
+    else
+      respond_to do |format|
+        if @speach_balloon.save
+          format.html { redirect_to @speach_balloon, notice: 'Speach balloon was successfully created.' }
+          format.json { render json: @speach_balloon, status: :created, location: @speach_balloon }
+        else
+          format.html { render action: "new" }
+          format.json { render json: @speach_balloon.errors, status: :unprocessable_entity }
+        end
+      end
+    end
+  end
+
+  # PUT /speach_balloons/1
+  # PUT /speach_balloons/1.json
+  def update
+    @speach_balloon = SpeachBalloon.find(params[:id])
+
+    respond_to do |format|
+      if @speach_balloon.update_attributes(params[:speach_balloon])
+        format.html { redirect_to @speach_balloon, notice: 'Speach balloon was successfully updated.' }
+        format.json { head :ok }
+      else
+        format.html { render action: "edit" }
+        format.json { render json: @speach_balloon.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # DELETE /speach_balloons/1
+  # DELETE /speach_balloons/1.json
+  def destroy
+    @speach_balloon = SpeachBalloon.find(params[:id])
+    @speach_balloon.destroy
+
+    respond_to do |format|
+      format.html { redirect_to speach_balloons_url }
+      format.json { head :ok }
+    end
+  end
+end
diff --git a/app/controllers/speach_templates_controller.rb b/app/controllers/speach_templates_controller.rb
new file mode 100644 (file)
index 0000000..401844d
--- /dev/null
@@ -0,0 +1,87 @@
+class SpeachTemplatesController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index]
+
+  # GET /speach_templates
+  # GET /speach_templates.json
+  def index
+    @speach_templates = SpeachTemplate.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @speach_templates }
+    end
+  end
+
+=begin
+  # GET /speach_templates/1
+  # GET /speach_templates/1.json
+  def show
+    @speach_template = SpeachTemplate.find(params[:id])
+
+    respond_to do |format|
+      format.html # show.html.erb
+      format.json { render json: @speach_template }
+    end
+  end
+
+  # GET /speach_templates/new
+  # GET /speach_templates/new.json
+  def new
+    @speach_template = SpeachTemplate.new
+
+    respond_to do |format|
+      format.html # new.html.erb
+      format.json { render json: @speach_template }
+    end
+  end
+
+  # GET /speach_templates/1/edit
+  def edit
+    @speach_template = SpeachTemplate.find(params[:id])
+  end
+
+  # POST /speach_templates
+  # POST /speach_templates.json
+  def create
+    @speach_template = SpeachTemplate.new(params[:speach_template])
+
+    respond_to do |format|
+      if @speach_template.save
+        format.html { redirect_to @speach_template, notice: 'Speach template was successfully created.' }
+        format.json { render json: @speach_template, status: :created, location: @speach_template }
+      else
+        format.html { render action: "new" }
+        format.json { render json: @speach_template.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # PUT /speach_templates/1
+  # PUT /speach_templates/1.json
+  def update
+    @speach_template = SpeachTemplate.find(params[:id])
+
+    respond_to do |format|
+      if @speach_template.update_attributes(params[:speach_template])
+        format.html { redirect_to @speach_template, notice: 'Speach template was successfully updated.' }
+        format.json { head :ok }
+      else
+        format.html { render action: "edit" }
+        format.json { render json: @speach_template.errors, status: :unprocessable_entity }
+      end
+    end
+  end
+
+  # DELETE /speach_templates/1
+  # DELETE /speach_templates/1.json
+  def destroy
+    @speach_template = SpeachTemplate.find(params[:id])
+    @speach_template.destroy
+
+    respond_to do |format|
+      format.html { redirect_to speach_templates_url }
+      format.json { head :ok }
+    end
+  end
+=end
+end
diff --git a/app/controllers/speaches_controller.rb b/app/controllers/speaches_controller.rb
new file mode 100644 (file)
index 0000000..06675f8
--- /dev/null
@@ -0,0 +1,87 @@
+class SpeachesController < ApplicationController
+  before_filter :authenticate_author!, :except => [:index]
+
+  # GET /speaches
+  # GET /speaches.json
+  def index
+    @speaches = Speach.all
+
+    respond_to do |format|
+      format.html # index.html.erb
+      format.json { render json: @speaches }
+    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
+
+    respond_to do |format|
+      format.html { redirect_to speaches_url }
+      format.json { head :ok }
+    end
+  end
+=end
+end
diff --git a/app/controllers/system_controller.rb b/app/controllers/system_controller.rb
new file mode 100644 (file)
index 0000000..6ba18d0
--- /dev/null
@@ -0,0 +1,22 @@
+class SystemController < ApplicationController
+  before_filter :authenticate_admin!, :except => [:start]
+  layout false, :only => :start
+  
+  def start
+  
+  end
+  
+  def waiting_list
+    @newadmins = Admin.find(:all, :conditions => ['activate = 0'])
+  end
+  
+  def accept_admin
+    @newadmin = Admin.find params[:id]
+    if admin_signed_in? and current_admin.activate
+      @newadmin.activate = 1
+      @newadmin.save
+    else
+    end
+  end
+  
+end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
new file mode 100644 (file)
index 0000000..de6be79
--- /dev/null
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
diff --git a/app/helpers/artists_helper.rb b/app/helpers/artists_helper.rb
new file mode 100644 (file)
index 0000000..52d21cb
--- /dev/null
@@ -0,0 +1,2 @@
+module ArtistsHelper
+end
diff --git a/app/helpers/balloon_templates_helper.rb b/app/helpers/balloon_templates_helper.rb
new file mode 100644 (file)
index 0000000..afab2a2
--- /dev/null
@@ -0,0 +1,2 @@
+module BalloonTemplatesHelper
+end
diff --git a/app/helpers/balloon_types_helper.rb b/app/helpers/balloon_types_helper.rb
new file mode 100644 (file)
index 0000000..abc0847
--- /dev/null
@@ -0,0 +1,2 @@
+module BalloonTypesHelper
+end
diff --git a/app/helpers/balloons_helper.rb b/app/helpers/balloons_helper.rb
new file mode 100644 (file)
index 0000000..6dba8f8
--- /dev/null
@@ -0,0 +1,2 @@
+module BalloonsHelper
+end
diff --git a/app/helpers/comics_helper.rb b/app/helpers/comics_helper.rb
new file mode 100644 (file)
index 0000000..597e65a
--- /dev/null
@@ -0,0 +1,2 @@
+module ComicsHelper
+end
diff --git a/app/helpers/common_lisences_helper.rb b/app/helpers/common_lisences_helper.rb
new file mode 100644 (file)
index 0000000..7f959d2
--- /dev/null
@@ -0,0 +1,2 @@
+module CommonLisencesHelper
+end
diff --git a/app/helpers/help_helper.rb b/app/helpers/help_helper.rb
new file mode 100644 (file)
index 0000000..6a35490
--- /dev/null
@@ -0,0 +1,2 @@
+module HelpHelper
+end
diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb
new file mode 100644 (file)
index 0000000..23de56a
--- /dev/null
@@ -0,0 +1,2 @@
+module HomeHelper
+end
diff --git a/app/helpers/lisences_helper.rb b/app/helpers/lisences_helper.rb
new file mode 100644 (file)
index 0000000..5519b99
--- /dev/null
@@ -0,0 +1,2 @@
+module LisencesHelper
+end
diff --git a/app/helpers/original_lisences_helper.rb b/app/helpers/original_lisences_helper.rb
new file mode 100644 (file)
index 0000000..1fe11c8
--- /dev/null
@@ -0,0 +1,2 @@
+module OriginalLisencesHelper
+end
diff --git a/app/helpers/original_pictures_helper.rb b/app/helpers/original_pictures_helper.rb
new file mode 100644 (file)
index 0000000..cd77d99
--- /dev/null
@@ -0,0 +1,2 @@
+module OriginalPicturesHelper
+end
diff --git a/app/helpers/panel_pictures_helper.rb b/app/helpers/panel_pictures_helper.rb
new file mode 100644 (file)
index 0000000..3a65773
--- /dev/null
@@ -0,0 +1,2 @@
+module PanelPicturesHelper
+end
diff --git a/app/helpers/panels_helper.rb b/app/helpers/panels_helper.rb
new file mode 100644 (file)
index 0000000..e8dc6e5
--- /dev/null
@@ -0,0 +1,2 @@
+module PanelsHelper
+end
diff --git a/app/helpers/resource_pictures_helper.rb b/app/helpers/resource_pictures_helper.rb
new file mode 100644 (file)
index 0000000..6f1dd28
--- /dev/null
@@ -0,0 +1,2 @@
+module ResourcePicturesHelper
+end
diff --git a/app/helpers/speach_balloons_helper.rb b/app/helpers/speach_balloons_helper.rb
new file mode 100644 (file)
index 0000000..ca42158
--- /dev/null
@@ -0,0 +1,2 @@
+module SpeachBalloonsHelper
+end
diff --git a/app/helpers/speach_templates_helper.rb b/app/helpers/speach_templates_helper.rb
new file mode 100644 (file)
index 0000000..51b4580
--- /dev/null
@@ -0,0 +1,2 @@
+module SpeachTemplatesHelper
+end
diff --git a/app/helpers/speaches_helper.rb b/app/helpers/speaches_helper.rb
new file mode 100644 (file)
index 0000000..c4b52bb
--- /dev/null
@@ -0,0 +1,2 @@
+module SpeachesHelper
+end
diff --git a/app/helpers/system_helper.rb b/app/helpers/system_helper.rb
new file mode 100644 (file)
index 0000000..2344fba
--- /dev/null
@@ -0,0 +1,2 @@
+module SystemHelper
+end
diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/models/.gitkeep b/app/models/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/models/admin.rb b/app/models/admin.rb
new file mode 100644 (file)
index 0000000..07f6523
--- /dev/null
@@ -0,0 +1,14 @@
+class Admin < ActiveRecord::Base
+  # Include default devise modules. Others available are:
+  # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
+  devise :database_authenticatable, :registerable,
+         :recoverable, :rememberable, :trackable, :validatable
+
+  # Setup accessible (or protected) attributes for your model
+  attr_accessible :email, :password, :password_confirmation, :remember_me
+  
+  def self.start(email, passwd)
+    Admin.create! :email => email, :password => passwd, :password_confirmation => passwd, :activate => true
+  end
+  
+end
diff --git a/app/models/artist.rb b/app/models/artist.rb
new file mode 100644 (file)
index 0000000..973be0f
--- /dev/null
@@ -0,0 +1,9 @@
+class Artist < ActiveRecord::Base
+  belongs_to :author
+  has_many :original_pictures
+  
+  def self.find_by_author author
+    Artist.find( :first, :conditions => ['author_id = ?', author.id])
+  end
+  
+end
diff --git a/app/models/author.rb b/app/models/author.rb
new file mode 100644 (file)
index 0000000..cc154ca
--- /dev/null
@@ -0,0 +1,21 @@
+class Author < ActiveRecord::Base
+  has_one :artist
+  
+  # Include default devise modules. Others available are:
+  # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
+  devise :database_authenticatable, :registerable,
+         :recoverable, :rememberable, :trackable, :token_authenticatable, :validatable#, :confirmable
+
+  # Setup accessible (or protected) attributes for your model
+  attr_accessible :email, :password, :password_confirmation, :remember_me
+
+  before_save :ensure_authentication_token\r
+  before_save do |r|
+    r.name = 'no name' if r.name.blank?
+  end
+  
+ def artist?
+   Artist.find_by_author(self) != nil
+ end
+end
diff --git a/app/models/balloon.rb b/app/models/balloon.rb
new file mode 100644 (file)
index 0000000..45d2ead
--- /dev/null
@@ -0,0 +1,11 @@
+class Balloon < ActiveRecord::Base
+  has_many :speaches
+  belongs_to :panel
+  belongs_to :resource_picture
+  accepts_nested_attributes_for :speaches
+  
+  def picture_url
+    '/resource_pictures/' + self.resource_picture.filename
+  end
+  
+end
diff --git a/app/models/balloon_template.rb b/app/models/balloon_template.rb
new file mode 100644 (file)
index 0000000..d4e3d5e
--- /dev/null
@@ -0,0 +1,6 @@
+class BalloonTemplate < ActiveRecord::Base
+  belongs_to :speach_balloon
+  has_many :speach_templates, :dependent => :destroy
+  belongs_to :resource_picture
+  accepts_nested_attributes_for :speach_templates
+end
diff --git a/app/models/comic.rb b/app/models/comic.rb
new file mode 100644 (file)
index 0000000..b4b502d
--- /dev/null
@@ -0,0 +1,9 @@
+class Comic < ActiveRecord::Base
+  has_many :panels, :dependent => :destroy
+
+  def own? author
+    return false unless author
+    self.author_id == author.id
+  end
+  
+end
diff --git a/app/models/common_lisence.rb b/app/models/common_lisence.rb
new file mode 100644 (file)
index 0000000..ea1fb4b
--- /dev/null
@@ -0,0 +1,18 @@
+class CommonLisence < ActiveRecord::Base
+  belongs_to :lisence
+  
+  def save_save
+    lisence = Lisence.new( {
+      :name => self.name, :url => self.url, :cc_by => self.cc_by, :cc_sa => self.cc_sa, :cc_nd => self.cc_nd, :cc_nc => self.cc_nc, 
+      :no_resize => self.no_resize, :no_flip => self.no_flip, :keep_aspect_ratio => self.keep_aspect_ratio
+    })
+    self.lisence_id = 0
+    res = self.save
+    return false unless res
+    return false unless lisence.save
+    self.lisence_id = lisence.id
+    res = self.save
+    res
+  end
+  
+end
diff --git a/app/models/lisence.rb b/app/models/lisence.rb
new file mode 100644 (file)
index 0000000..d4ed435
--- /dev/null
@@ -0,0 +1,7 @@
+class Lisence < ActiveRecord::Base
+  has_one :original_lisence
+  has_one :common_lisence
+  accepts_nested_attributes_for :original_lisence
+  accepts_nested_attributes_for :common_lisence
+  
+end
diff --git a/app/models/original_lisence.rb b/app/models/original_lisence.rb
new file mode 100644 (file)
index 0000000..c87cda5
--- /dev/null
@@ -0,0 +1,19 @@
+class OriginalLisence < ActiveRecord::Base
+  belongs_to :lisence
+  
+  
+  def save_save
+    lisence = Lisence.new( {
+      :name => self.name, :url => self.url, :cc_by => self.cc_by, :cc_sa => self.cc_sa, :cc_nd => self.cc_nd, :cc_nc => self.cc_nc, 
+      :no_resize => self.no_resize, :no_flip => self.no_flip, :keep_aspect_ratio => self.keep_aspect_ratio
+    })
+    self.lisence_id = 0
+    res = self.save
+    return false unless res
+    return false unless lisence.save
+    self.lisence_id = lisence.id
+    res = self.save
+    res
+  end
+  
+end
diff --git a/app/models/original_picture.rb b/app/models/original_picture.rb
new file mode 100644 (file)
index 0000000..d67a581
--- /dev/null
@@ -0,0 +1,47 @@
+class OriginalPicture < ActiveRecord::Base
+  belongs_to :artist
+  belongs_to :lisence
+  has_one :resource_picture
+  
+  def validate
+    errors.add(:filesize, 'size over(1MB)') if self.filesize > 1000000
+  end
+  
+  def dext
+    self.ext.downcase
+  end
+  
+  def filename
+    "#{self.id}.#{self.dext}"
+  end
+  
+  def mime_type
+    "image/#{self.dext}"
+  end
+  
+  def url
+    '/original_pictures/' + filename
+  end
+  
+  def store(rimg)
+    bindata = rimg.to_blob
+    PictureIO.original_picture_io.put bindata, self.filename
+    res = if self.resource_picture
+      self.resource_picture.store rimg
+    else
+      ResourcePicture.store(rimg, self)
+    end
+    res
+  end
+  
+  def restore(subdir = nil)
+    PictureIO.original_picture_io.get self.filename, subdir
+  end
+  
+  def own? author
+    return false unless author
+    return false unless author.artist?
+    self.artist_id == author.artist.id
+  end
+  
+end
diff --git a/app/models/panel.rb b/app/models/panel.rb
new file mode 100644 (file)
index 0000000..efc3a4d
--- /dev/null
@@ -0,0 +1,54 @@
+class Panel < ActiveRecord::Base
+  belongs_to :comic
+  has_many :panel_pictures, :dependent => :destroy
+  has_many :balloons, :dependent => :destroy
+  accepts_nested_attributes_for :panel_pictures, :allow_destroy => true
+  accepts_nested_attributes_for :balloons, :allow_destroy => true
+
+  def self.max_seq comic_id
+    Panel.maximum(:seqno, :conditions => ['comic_id = ?', comic_id]).to_i
+  end
+  
+  def self.find_seq comic_id, seqno
+    Panel.find(:first, :conditions => ['comic_id = ? and seqno = ?', comic_id, seqno])
+  end
+
+  #更新する時にPanelIDをチェックしとかないと勝手に所属先を変えられるゾ!?
+
+  def vdt_save
+    f = nil
+    max_seq = Panel.max_seq self.comic_id
+    f = Panel.find_seq(self.comic_id, self.seqno) if self.seqno
+    if f
+      Panel.update_all('seqno = seqno + 1', ['comic_id = ? and seqno >= ?', self.comic_id, self.seqno])
+    else
+      self.seqno = max_seq + 1
+    end
+    self.save
+  end
+  
+  def move_to new_seq
+    return true if self.seqno == new_seq
+    if self.seqno > new_seq
+      Panel.update_all('seqno = seqno + 1', ['comic_id = ? and (seqno >= ? and seqno < ?)', self.comic_id, new_seq, self.seqno])
+    else
+      nf = Panel.find_seq(self.comic_id, new_seq)
+      max_seq = Panel.max_seq self.comic_id
+      new_seq = max_seq if new_seq > max_seq
+      Panel.update_all('seqno = seqno - 1', ['comic_id = ? and (seqno > ? and seqno <= ?)', self.comic_id, self.seqno, new_seq])
+    end
+    self.seqno = new_seq
+    self.save
+  end
+  
+  def destroy_and_shorten
+    Panel.update_all('seqno = seqno - 1', ['comic_id = ? and (seqno > ?)', self.comic_id, self.seqno])
+    self.destroy
+  end
+  
+  def own? author
+    return false unless author
+    self.author_id == author.id
+  end
+  
+end
diff --git a/app/models/panel_picture.rb b/app/models/panel_picture.rb
new file mode 100644 (file)
index 0000000..426248c
--- /dev/null
@@ -0,0 +1,19 @@
+class PanelPicture < ActiveRecord::Base
+  belongs_to :panel
+  belongs_to :resource_picture
+  
+  def flip
+    res = (self.v == 0 ? '' : 'v') + (self.h == 0 ? '' : 'h')
+    res += '/' unless res.empty?
+    res
+  end
+  
+  def filename
+    flip + self.resource_picture.filename
+  end
+  
+  def url
+    '/resource_pictures/' + filename
+  end
+  
+end
diff --git a/app/models/resource_picture.rb b/app/models/resource_picture.rb
new file mode 100644 (file)
index 0000000..1bf9021
--- /dev/null
@@ -0,0 +1,105 @@
+class ResourcePicture < ActiveRecord::Base
+  belongs_to :artist
+  belongs_to :lisence
+  has_many :panel_pictures
+  belongs_to :original_picture
+  
+  def self.resize(data, dw, dh)
+    Magick::Image.from_blob(data).shift.resize(dw, dh)
+  end
+  
+  #サイズの調整(limw,limhに必ず収まるように合わせる)
+  def self.fix_size_both(limw, limh, w, h)
+    wr = if w > limw
+      limw*100/w
+    else
+      100
+    end
+    hr = if h > limh
+      limh*100/h
+    else
+      100
+    end
+    res = if wr < hr
+      #幅の方が圧縮率が高い
+      [w*wr/100, h*wr/100]
+    else
+      #高さの方が圧縮率が高い
+      [w*hr/100, h*hr/100]
+    end
+    res
+  end
+  
+  def dext
+    self.ext.downcase
+  end
+  
+  def filename
+    "#{self.id}.#{self.dext}"
+  end
+  
+  def mime_type
+    "image/#{self.dext}"
+  end
+  
+  def v(rimg)
+    rimg.flip.to_blob
+  end
+  
+  def h(rimg)
+    rimg.flop.to_blob
+  end
+  
+  def vh(rimg)
+    rimg.flip.flop.to_blob
+  end
+  
+  def url subdir = nil
+    '/resource_pictures/' + (subdir.to_s.empty? ? '' : subdir.to_s + '/' ) + filename
+  end
+  
+  def thumbnail(rimg)
+    tw, th = ResourcePicture.fix_size_both(80, 80, rimg.columns, rimg.rows)
+    ResourcePicture.resize(rimg.to_blob, tw, th).to_blob
+  end
+  
+  def self.store(img, original_picture)
+    
+    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
+    )
+    res = if resource_picture.save
+      if resource_picture.store(img)
+        true
+      else
+        false
+      end
+    else
+      false
+    end
+    res
+  end
+  
+  def store(img)
+    res = false
+    bindata = img.to_blob
+#    begin
+      PictureIO.resource_picture_io.put bindata, self.filename
+      PictureIO.resource_picture_io.class.subdirs.each do |d|
+        next if d.empty?
+        PictureIO.resource_picture_io.put(self.__send__(d, img), self.filename, d)
+      end
+      res = true
+#    rescue
+#      res = false
+#    end
+    res
+  end
+  
+  def restore(subdir = nil)
+    PictureIO.resource_picture_io.get self.filename, subdir
+  end
+  
+end
diff --git a/app/models/speach.rb b/app/models/speach.rb
new file mode 100644 (file)
index 0000000..2346626
--- /dev/null
@@ -0,0 +1,3 @@
+class Speach < ActiveRecord::Base
+  belongs_to :balloon
+end
diff --git a/app/models/speach_balloon.rb b/app/models/speach_balloon.rb
new file mode 100644 (file)
index 0000000..3264e4c
--- /dev/null
@@ -0,0 +1,4 @@
+class SpeachBalloon < ActiveRecord::Base
+  has_many :balloon_templates, :dependent => :destroy
+  accepts_nested_attributes_for :balloon_templates
+end
diff --git a/app/models/speach_template.rb b/app/models/speach_template.rb
new file mode 100644 (file)
index 0000000..b44ebed
--- /dev/null
@@ -0,0 +1,3 @@
+class SpeachTemplate < ActiveRecord::Base
+  belongs_to :balloon_template
+end
diff --git a/app/views/admins/confirmations/new.html.erb b/app/views/admins/confirmations/new.html.erb
new file mode 100644 (file)
index 0000000..b7ae403
--- /dev/null
@@ -0,0 +1,12 @@
+<h2>Resend confirmation instructions</h2>
+
+<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.submit "Resend confirmation instructions" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/admins/mailer/confirmation_instructions.html.erb b/app/views/admins/mailer/confirmation_instructions.html.erb
new file mode 100644 (file)
index 0000000..a6ea8ca
--- /dev/null
@@ -0,0 +1,5 @@
+<p>Welcome <%= @resource.email %>!</p>
+
+<p>You can confirm your account through the link below:</p>
+
+<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
diff --git a/app/views/admins/mailer/reset_password_instructions.html.erb b/app/views/admins/mailer/reset_password_instructions.html.erb
new file mode 100644 (file)
index 0000000..ae9e888
--- /dev/null
@@ -0,0 +1,8 @@
+<p>Hello <%= @resource.email %>!</p>
+
+<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
+
+<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
+
+<p>If you didn't request this, please ignore this email.</p>
+<p>Your password won't change until you access the link above and create a new one.</p>
diff --git a/app/views/admins/mailer/unlock_instructions.html.erb b/app/views/admins/mailer/unlock_instructions.html.erb
new file mode 100644 (file)
index 0000000..2263c21
--- /dev/null
@@ -0,0 +1,7 @@
+<p>Hello <%= @resource.email %>!</p>
+
+<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
+
+<p>Click the link below to unlock your account:</p>
+
+<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
diff --git a/app/views/admins/passwords/edit.html.erb b/app/views/admins/passwords/edit.html.erb
new file mode 100644 (file)
index 0000000..e75c937
--- /dev/null
@@ -0,0 +1,16 @@
+<h2>Change your password</h2>
+
+<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
+  <%= devise_error_messages! %>
+  <%= f.hidden_field :reset_password_token %>
+
+  <div><%= f.label :password, "New password" %><br />
+  <%= f.password_field :password %></div>
+
+  <div><%= f.label :password_confirmation, "Confirm new password" %><br />
+  <%= f.password_field :password_confirmation %></div>
+
+  <div><%= f.submit "Change my password" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/admins/passwords/new.html.erb b/app/views/admins/passwords/new.html.erb
new file mode 100644 (file)
index 0000000..6c21e9f
--- /dev/null
@@ -0,0 +1,12 @@
+<h2>Forgot your password?</h2>
+
+<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.submit "Send me reset password instructions" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/admins/registrations/edit.html.erb b/app/views/admins/registrations/edit.html.erb
new file mode 100644 (file)
index 0000000..ff38050
--- /dev/null
@@ -0,0 +1,25 @@
+<h2>Edit <%= resource_name.to_s.humanize %></h2>
+
+<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
+  <%= f.password_field :password %></div>
+
+  <div><%= f.label :password_confirmation %><br />
+  <%= f.password_field :password_confirmation %></div>
+
+  <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
+  <%= f.password_field :current_password %></div>
+
+  <div><%= f.submit "Update" %></div>
+<% end %>
+
+<h3>Cancel my account</h3>
+
+<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
+
+<%= link_to "Back", :back %>
diff --git a/app/views/admins/registrations/new.html.erb b/app/views/admins/registrations/new.html.erb
new file mode 100644 (file)
index 0000000..d15e275
--- /dev/null
@@ -0,0 +1,18 @@
+<h2>Sign up</h2>
+
+<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.label :password %><br />
+  <%= f.password_field :password %></div>
+
+  <div><%= f.label :password_confirmation %><br />
+  <%= f.password_field :password_confirmation %></div>
+
+  <div><%= f.submit "Sign up" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
diff --git a/app/views/admins/sessions/new.html.erb b/app/views/admins/sessions/new.html.erb
new file mode 100644 (file)
index 0000000..1b6aee0
--- /dev/null
@@ -0,0 +1,16 @@
+<h2>Sign in</h2>
+
+<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.label :password %><br />
+  <%= f.password_field :password %></div>
+
+  <% if devise_mapping.rememberable? -%>
+    <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
+  <% end -%>
+
+  <div><%= f.submit "Sign in" %></div>
+<% end %>
+<%= render :partial => "admins/shared/links" %>
\ No newline at end of file
diff --git a/app/views/admins/shared/_links.erb b/app/views/admins/shared/_links.erb
new file mode 100644 (file)
index 0000000..eab783a
--- /dev/null
@@ -0,0 +1,25 @@
+<%- if controller_name != 'sessions' %>
+  <%= link_to "Sign in", new_session_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
+  <%= link_to "Sign up", new_registration_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+  <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
+  <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
+  <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.omniauthable? %>
+  <%- resource_class.omniauth_providers.each do |provider| %>
+    <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
+  <% end -%>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/admins/unlocks/new.html.erb b/app/views/admins/unlocks/new.html.erb
new file mode 100644 (file)
index 0000000..c6cdcfe
--- /dev/null
@@ -0,0 +1,12 @@
+<h2>Resend unlock instructions</h2>
+
+<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.submit "Resend unlock instructions" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/artists/_form.html.erb b/app/views/artists/_form.html.erb
new file mode 100644 (file)
index 0000000..513fa61
--- /dev/null
@@ -0,0 +1,17 @@
+<%= form_for(@artist) do |f| %>
+  <% if @artist.errors.any? %>
+    <div id="error_explanation">
+      <h2><%= pluralize(@artist.errors.count, "error") %> prohibited this artist from being saved:</h2>
+
+      <ul>
+      <% @artist.errors.full_messages.each do |msg| %>
+        <li><%= msg %></li>
+      <% end %>
+      </ul>
+    </div>
+  <% end %>
+
+  <div class="actions">
+    <%= f.submit %>
+  </div>
+<% end %>
diff --git a/app/views/artists/edit.html.erb b/app/views/artists/edit.html.erb
new file mode 100644 (file)
index 0000000..0ca9f85
--- /dev/null
@@ -0,0 +1,6 @@
+<h1>Editing artist</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @artist %> |
+<%= link_to 'Back', artists_path %>
diff --git a/app/views/artists/index.html.erb b/app/views/artists/index.html.erb
new file mode 100644 (file)
index 0000000..39e31fa
--- /dev/null
@@ -0,0 +1,17 @@
+<h1>Listing artists</h1>
+
+<table>
+  <tr>
+    <th>author</th>
+    <th>name</th>
+    <th></th>
+  </tr>
+
+<% @artists.each do |artist| %>
+  <tr>
+    <td><%= artist.author_id %></td>
+    <td><%= artist.name %></td>
+    <td><%= link_to 'Show', artist %></td>
+  </tr>
+<% end %>
+</table>
diff --git a/app/views/artists/new.html.erb b/app/views/artists/new.html.erb
new file mode 100644 (file)
index 0000000..40a9512
--- /dev/null
@@ -0,0 +1,5 @@
+<h1>New artist</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', artists_path %>
diff --git a/app/views/artists/show.html.erb b/app/views/artists/show.html.erb
new file mode 100644 (file)
index 0000000..70d3626
--- /dev/null
@@ -0,0 +1,5 @@
+<p id="notice"><%= notice %></p>
+
+投稿された素材
+
+<%= link_to 'Back', artists_path %>
diff --git a/app/views/authors/confirmations/new.html.erb b/app/views/authors/confirmations/new.html.erb
new file mode 100644 (file)
index 0000000..b7ae403
--- /dev/null
@@ -0,0 +1,12 @@
+<h2>Resend confirmation instructions</h2>
+
+<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.submit "Resend confirmation instructions" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/authors/mailer/confirmation_instructions.html.erb b/app/views/authors/mailer/confirmation_instructions.html.erb
new file mode 100644 (file)
index 0000000..a6ea8ca
--- /dev/null
@@ -0,0 +1,5 @@
+<p>Welcome <%= @resource.email %>!</p>
+
+<p>You can confirm your account through the link below:</p>
+
+<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
diff --git a/app/views/authors/mailer/reset_password_instructions.html.erb b/app/views/authors/mailer/reset_password_instructions.html.erb
new file mode 100644 (file)
index 0000000..ae9e888
--- /dev/null
@@ -0,0 +1,8 @@
+<p>Hello <%= @resource.email %>!</p>
+
+<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
+
+<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
+
+<p>If you didn't request this, please ignore this email.</p>
+<p>Your password won't change until you access the link above and create a new one.</p>
diff --git a/app/views/authors/mailer/unlock_instructions.html.erb b/app/views/authors/mailer/unlock_instructions.html.erb
new file mode 100644 (file)
index 0000000..2263c21
--- /dev/null
@@ -0,0 +1,7 @@
+<p>Hello <%= @resource.email %>!</p>
+
+<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
+
+<p>Click the link below to unlock your account:</p>
+
+<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
diff --git a/app/views/authors/passwords/edit.html.erb b/app/views/authors/passwords/edit.html.erb
new file mode 100644 (file)
index 0000000..e75c937
--- /dev/null
@@ -0,0 +1,16 @@
+<h2>Change your password</h2>
+
+<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
+  <%= devise_error_messages! %>
+  <%= f.hidden_field :reset_password_token %>
+
+  <div><%= f.label :password, "New password" %><br />
+  <%= f.password_field :password %></div>
+
+  <div><%= f.label :password_confirmation, "Confirm new password" %><br />
+  <%= f.password_field :password_confirmation %></div>
+
+  <div><%= f.submit "Change my password" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/authors/passwords/new.html.erb b/app/views/authors/passwords/new.html.erb
new file mode 100644 (file)
index 0000000..6c21e9f
--- /dev/null
@@ -0,0 +1,12 @@
+<h2>Forgot your password?</h2>
+
+<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.submit "Send me reset password instructions" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/authors/registrations/edit.html.erb b/app/views/authors/registrations/edit.html.erb
new file mode 100644 (file)
index 0000000..ff38050
--- /dev/null
@@ -0,0 +1,25 @@
+<h2>Edit <%= resource_name.to_s.humanize %></h2>
+
+<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
+  <%= f.password_field :password %></div>
+
+  <div><%= f.label :password_confirmation %><br />
+  <%= f.password_field :password_confirmation %></div>
+
+  <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
+  <%= f.password_field :current_password %></div>
+
+  <div><%= f.submit "Update" %></div>
+<% end %>
+
+<h3>Cancel my account</h3>
+
+<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
+
+<%= link_to "Back", :back %>
diff --git a/app/views/authors/registrations/new.html.erb b/app/views/authors/registrations/new.html.erb
new file mode 100644 (file)
index 0000000..3ae6813
--- /dev/null
@@ -0,0 +1,21 @@
+<h2>Sign up</h2>
+
+<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :name %><br />
+  <%= f.text_field :name %></div>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.label :password %><br />
+  <%= f.password_field :password %></div>
+
+  <div><%= f.label :password_confirmation %><br />
+  <%= f.password_field :password_confirmation %></div>
+
+  <div><%= f.submit "Sign up" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
diff --git a/app/views/authors/sessions/new.html.erb b/app/views/authors/sessions/new.html.erb
new file mode 100644 (file)
index 0000000..ff59f7c
--- /dev/null
@@ -0,0 +1,17 @@
+<h2>Sign in</h2>
+
+<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.label :password %><br />
+  <%= f.password_field :password %></div>
+
+  <% if devise_mapping.rememberable? -%>
+    <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
+  <% end -%>
+
+  <div><%= f.submit "Sign in" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/authors/shared/_links.erb b/app/views/authors/shared/_links.erb
new file mode 100644 (file)
index 0000000..eab783a
--- /dev/null
@@ -0,0 +1,25 @@
+<%- if controller_name != 'sessions' %>
+  <%= link_to "Sign in", new_session_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
+  <%= link_to "Sign up", new_registration_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+  <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
+  <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
+  <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.omniauthable? %>
+  <%- resource_class.omniauth_providers.each do |provider| %>
+    <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
+  <% end -%>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/authors/unlocks/new.html.erb b/app/views/authors/unlocks/new.html.erb
new file mode 100644 (file)
index 0000000..c6cdcfe
--- /dev/null
@@ -0,0 +1,12 @@
+<h2>Resend unlock instructions</h2>
+
+<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
+  <%= devise_error_messages! %>
+
+  <div><%= f.label :email %><br />
+  <%= f.email_field :email %></div>
+
+  <div><%= f.submit "Resend unlock instructions" %></div>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/balloon_templates/index.html.erb b/app/views/balloon_templates/index.html.erb
new file mode 100644 (file)
index 0000000..5204337
--- /dev/null
@@ -0,0 +1,27 @@
+<h1>Listing balloon_templates</h1>
+
+<table>
+  <tr>
+    <th>speach balloon</th>
+    <th>resource_picture</th>
+    <th>Tail</th>
+    <th>Border</th>
+    <th>MinWidth</th>
+    <th>MinHeight</th>
+    <th>MaxWidth</th>
+    <th>MaxHeight</th>
+  </tr>
+
+<% @balloon_templates.each do |balloon_template| %>
+  <tr>
+    <td><%= balloon_template.speach_balloon_id %></td>
+    <td><%= balloon_template.resource_picture_id %></td>
+    <td><%= balloon_template.tail %></td>
+    <td><%= balloon_template.border %></td>
+    <td><%= balloon_template.min_width %></td>
+    <td><%= balloon_template.min_height %></td>
+    <td><%= balloon_template.max_width %></td>
+    <td><%= balloon_template.max_height %></td>
+  </tr>
+<% end %>
+</table>
diff --git a/app/views/balloons/index.html.erb b/app/views/balloons/index.html.erb
new file mode 100644 (file)
index 0000000..2377f0e
--- /dev/null
@@ -0,0 +1,31 @@
+<h1>Listing balloons</h1>
+
+<table>
+  <tr>
+    <th>panel</th>
+    <th>balloonTemplate</th>
+    <th>resource_picture</th>
+    <th>Tail</th>
+    <th>Border</th>
+    <th>Zindex</th>
+    <th>Top offset</th>
+    <th>Left offset</th>
+    <th>Width</th>
+    <th>Height</th>
+  </tr>
+
+<% @balloons.each do |balloon| %>
+  <tr>
+    <td><%= balloon.panel_id %></td>
+    <td><%= balloon.balloon_template_id %></td>
+    <td><%= balloon.resource_picture_id %></td>
+    <td><%= balloon.tail %></td>
+    <td><%= balloon.border %></td>
+    <td><%= balloon.zindex %></td>
+    <td><%= balloon.top_offset %></td>
+    <td><%= balloon.left_offset %></td>
+    <td><%= balloon.width %></td>
+    <td><%= balloon.height %></td>
+  </tr>
+<% end %>
+</table>
diff --git a/app/views/comics/index.html.erb b/app/views/comics/index.html.erb
new file mode 100644 (file)
index 0000000..022e342
--- /dev/null
@@ -0,0 +1,36 @@
+<h1>Listing comics</h1>
+
+<table>
+  <tr>
+    <th>id</th>
+    <th>Title</th>
+    <th>Default width</th>
+    <th>Default height</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.default_width %></td>
+    <td><%= comic.default_height %></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>
+<% end %>
+</table>
+
diff --git a/app/views/comics/play.html.erb b/app/views/comics/play.html.erb
new file mode 100644 (file)
index 0000000..2bde1ba
--- /dev/null
@@ -0,0 +1,22 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+  <b>Title:</b>
+  <%= @comic.title %>
+</p>
+
+<p>
+  <b>Default width:</b>
+  <%= @comic.default_width %>
+</p>
+
+<p>
+  <b>Default height:</b>
+  <%= @comic.default_height %>
+</p>
+<% @comic.panels.each do |panel| %>
+  <% @panel = panel %>
+  <%= render 'panels/standard' %>
+<% end %>
+
+<%= link_to 'Back', comics_path %>
diff --git a/app/views/comics/show.html.erb b/app/views/comics/show.html.erb
new file mode 100644 (file)
index 0000000..7d2fe84
--- /dev/null
@@ -0,0 +1,18 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+  <b>Title:</b>
+  <%= h @comic.title %>
+</p>
+
+<p>
+  <b>Default width:</b>
+  <%= @comic.default_width %>
+</p>
+
+<p>
+  <b>Default height:</b>
+  <%= @comic.default_height %>
+</p>
+
+<%= link_to 'Back', comics_path %>
diff --git a/app/views/comics/top.html.erb b/app/views/comics/top.html.erb
new file mode 100644 (file)
index 0000000..c07326a
--- /dev/null
@@ -0,0 +1,3 @@
+<h1>PettanR</h1>
+
+  
diff --git a/app/views/common_lisences/_form.html.erb b/app/views/common_lisences/_form.html.erb
new file mode 100644 (file)
index 0000000..cb73f6a
--- /dev/null
@@ -0,0 +1,54 @@
+<%= form_for(@common_lisence) do |f| %>
+  <% if @common_lisence.errors.any? %>
+    <div id="error_explanation">
+      <h2><%= pluralize(@common_lisence.errors.count, "error") %> prohibited this common_lisence from being saved:</h2>
+
+      <ul>
+      <% @common_lisence.errors.full_messages.each do |msg| %>
+        <li><%= msg %></li>
+      <% end %>
+      </ul>
+    </div>
+  <% end %>
+
+  <div class="field">
+    <%= f.label :name %><br />
+    <%= f.text_field :name %>
+  </div>
+  <div class="field">
+    <%= f.label :url %><br />
+    <%= f.text_field :url %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_by %><br />
+    <%= f.check_box :cc_by %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_sa %><br />
+    <%= f.check_box :cc_sa %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_nd %><br />
+    <%= f.check_box :cc_nd %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_nc %><br />
+    <%= f.check_box :cc_nc %>
+  </div>
+  <div class="field">
+    <%= f.label :no_resize %><br />
+    <%= f.check_box :no_resize %>
+  </div>
+  <div class="field">
+    <%= f.label :no_flip %><br />
+    <%= f.check_box :no_flip %>
+  </div>
+  <div class="field">
+    <%= f.label :keep_aspect_ratio %><br />
+    <%= f.check_box :keep_aspect_ratio %>
+  </div>
+
+  <div class="actions">
+    <%= f.submit %>
+  </div>
+<% end %>
diff --git a/app/views/common_lisences/edit.html.erb b/app/views/common_lisences/edit.html.erb
new file mode 100644 (file)
index 0000000..2760acb
--- /dev/null
@@ -0,0 +1,6 @@
+<h1>Editing common_lisence</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @common_lisence %> |
+<%= link_to 'Back', lisences_path %>
diff --git a/app/views/common_lisences/index.html.erb b/app/views/common_lisences/index.html.erb
new file mode 100644 (file)
index 0000000..c57bc22
--- /dev/null
@@ -0,0 +1,39 @@
+<h1>Listing common_lisences</h1>
+
+<table>
+  <tr>
+    <th>name</th>
+    <th>url</th>
+    <th>cc_by</th>
+    <th>cc_sa</th>
+    <th>cc_nd</th>
+    <th>cc_nc</th>
+    <th>no_resize</th>
+    <th>no_flip</th>
+    <th>keep_aspect_ratio</th>
+    <th></th>
+    <th></th>
+    <th></th>
+  </tr>
+
+<% @common_lisences.each do |common_lisence| %>
+  <tr>
+    <td><%=@common_lisence.name %></td>
+    <td><%=@common_lisence.url %></td>
+    <td><%=@common_lisence.cc_by %></td>
+    <td><%=@common_lisence.cc_sa %></td>
+    <td><%=@common_lisence.cc_nd %></td>
+    <td><%=@common_lisence.cc_nc %></td>
+    <td><%=@common_lisence.no_resize %></td>
+    <td><%=@common_lisence.no_flip %></td>
+    <td><%=@common_lisence.keep_aspect_ratio %></td>
+    <td><%= link_to 'Show', common_lisence %></td>
+    <td><%= link_to 'Edit', edit_common_lisence_path(common_lisence) %></td>
+    <td><%= link_to 'Destroy', common_lisence, confirm: 'Are you sure?', method: :delete %></td>
+  </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Common_lisence', new_common_lisence_path %>
diff --git a/app/views/common_lisences/new.html.erb b/app/views/common_lisences/new.html.erb
new file mode 100644 (file)
index 0000000..d9a3454
--- /dev/null
@@ -0,0 +1,5 @@
+<h1>New common_lisence</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', common_lisences_path %>
diff --git a/app/views/common_lisences/show.html.erb b/app/views/common_lisences/show.html.erb
new file mode 100644 (file)
index 0000000..067f510
--- /dev/null
@@ -0,0 +1,49 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+  <b>name:</b>
+  <%= @common_lisence.name %>
+</p>
+
+<p>
+  <b>url:</b>
+  <%= @common_lisence.url %>
+</p>
+
+<p>
+  <b>cc_by:</b>
+  <%= @common_lisence.cc_by %>
+</p>
+
+<p>
+  <b>cc_sa:</b>
+  <%= @common_lisence.cc_sa %>
+</p>
+
+<p>
+  <b>cc_nd:</b>
+  <%= @common_lisence.cc_nd %>
+</p>
+
+<p>
+  <b>cc_nc:</b>
+  <%= @common_lisence.cc_nc %>
+</p>
+
+<p>
+  <b>no_resize:</b>
+  <%= @common_lisence.no_resize %>
+</p>
+
+<p>
+  <b>no_flip:</b>
+  <%= @common_lisence.no_flip %>
+</p>
+
+<p>
+  <b>keep_aspect_ratio:</b>
+  <%= @common_lisence.keep_aspect_ratio %>
+</p>
+
+<%= link_to 'Edit', edit_common_lisence_path(@common_lisence) %> |
+<%= link_to 'Back', lisences_path %>
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
new file mode 100644 (file)
index 0000000..e45cd11
--- /dev/null
@@ -0,0 +1,14 @@
+<h1><%= h(current_author.name) -%>(<%= h(current_author.email) -%>)</h1>
+<div>
+あなたの認証トークンは<%= current_author.authentication_token %>です
+</div>
+
+<div>
+<p>絵師活動</p>
+<% if current_author.artist? -%>
+  <%= link_to h(current_author.artist.name), current_author.artist %>です
+<% else -%>
+  <p>まだ絵師登録していません。</p>
+  <p>登録する</p>
+<% end -%>
+</div>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
new file mode 100644 (file)
index 0000000..c739f33
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Pettanr</title>
+  <%= stylesheet_link_tag    "application" %>
+  <%= javascript_include_tag "application" %>
+  <%= csrf_meta_tags %>
+</head>
+<body>
+
+<% if author_signed_in? %>
+<%= link_to "my home", :controller => '/home' %>
+<%= link_to "ログアウト", destroy_author_session_path, :method => :delete %>
+<% else %>
+<%= link_to "ログイン", new_author_session_path %>
+<% end %>
+<%= link_to "管理者", new_admin_session_path %>
+<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 %>)
+</div>
+<%= yield %>
+
+</body>
+</html>
diff --git a/app/views/lisences/_form.html.erb b/app/views/lisences/_form.html.erb
new file mode 100644 (file)
index 0000000..29c8cab
--- /dev/null
@@ -0,0 +1,17 @@
+<%= 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 %>
diff --git a/app/views/lisences/edit.html.erb b/app/views/lisences/edit.html.erb
new file mode 100644 (file)
index 0000000..1c041a6
--- /dev/null
@@ -0,0 +1,6 @@
+<h1>Editing lisence</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @lisence %> |
+<%= link_to 'Back', lisences_path %>
diff --git a/app/views/lisences/index.html.erb b/app/views/lisences/index.html.erb
new file mode 100644 (file)
index 0000000..d14ee88
--- /dev/null
@@ -0,0 +1,38 @@
+<h1>Listing lisences</h1>
+
+<table>
+  <tr>
+    <th>name</th>
+    <th>url</th>
+    <th>cc_by</th>
+    <th>cc_sa</th>
+    <th>cc_nd</th>
+    <th>cc_nc</th>
+    <th>no_resize</th>
+    <th>no_flip</th>
+    <th>keep_aspect_ratio</th>
+    <th></th>
+  </tr>
+
+<% @lisences.each do |lisence| %>
+  <tr>
+    <td><%= lisence.name %></td>
+    <td><%= lisence.url %></td>
+    <td><%= lisence.cc_by %></td>
+    <td><%= lisence.cc_sa %></td>
+    <td><%= lisence.cc_nd %></td>
+    <td><%= lisence.cc_nc %></td>
+    <td><%= lisence.no_resize %></td>
+    <td><%= lisence.no_flip %></td>
+    <td><%= lisence.keep_aspect_ratio %></td>
+    <td>
+      <% if lisence.common_lisence -%>
+        <%= link_to 'Show', lisence.common_lisence %>
+      <% else -%>
+        <%= link_to 'Show', lisence.original_lisence %>
+      <% end -%>
+    </td>
+  </tr>
+<% end -%>
+</table>
+<%= link_to 'new original lisence', new_original_lisence_path %>
diff --git a/app/views/lisences/new.html.erb b/app/views/lisences/new.html.erb
new file mode 100644 (file)
index 0000000..3205771
--- /dev/null
@@ -0,0 +1,5 @@
+<h1>New lisence</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', lisences_path %>
diff --git a/app/views/lisences/show.html.erb b/app/views/lisences/show.html.erb
new file mode 100644 (file)
index 0000000..fd82a9b
--- /dev/null
@@ -0,0 +1,5 @@
+<p id="notice"><%= notice %></p>
+
+
+<%= link_to 'Edit', edit_lisence_path(@lisence) %> |
+<%= link_to 'Back', lisences_path %>
diff --git a/app/views/original_lisences/_form.html.erb b/app/views/original_lisences/_form.html.erb
new file mode 100644 (file)
index 0000000..9e9aaf4
--- /dev/null
@@ -0,0 +1,54 @@
+<%= form_for(@original_lisence) do |f| %>
+  <% if @original_lisence.errors.any? %>
+    <div id="error_explanation">
+      <h2><%= pluralize(@original_lisence.errors.count, "error") %> prohibited this original_lisence from being saved:</h2>
+
+      <ul>
+      <% @original_lisence.errors.full_messages.each do |msg| %>
+        <li><%= msg %></li>
+      <% end %>
+      </ul>
+    </div>
+  <% end %>
+
+  <div class="field">
+    <%= f.label :name %><br />
+    <%= f.text_field :name %>
+  </div>
+  <div class="field">
+    <%= f.label :url %><br />
+    <%= f.text_field :url %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_by %><br />
+    <%= f.check_box :cc_by %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_sa %><br />
+    <%= f.check_box :cc_sa %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_nd %><br />
+    <%= f.check_box :cc_nd %>
+  </div>
+  <div class="field">
+    <%= f.label :cc_nc %><br />
+    <%= f.check_box :cc_nc %>
+  </div>
+  <div class="field">
+    <%= f.label :no_resize %><br />
+    <%= f.check_box :no_resize %>
+  </div>
+  <div class="field">
+    <%= f.label :no_flip %><br />
+    <%= f.check_box :no_flip %>
+  </div>
+  <div class="field">
+    <%= f.label :keep_aspect_ratio %><br />
+    <%= f.check_box :keep_aspect_ratio %>
+  </div>
+
+  <div class="actions">
+    <%= f.submit %>
+  </div>
+<% end %>
diff --git a/app/views/original_lisences/edit.html.erb b/app/views/original_lisences/edit.html.erb
new file mode 100644 (file)
index 0000000..dd54b16
--- /dev/null
@@ -0,0 +1,6 @@
+<h1>Editing original_lisence</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @original_lisence %> |
+<%= link_to 'Back', lisences_path %>
diff --git a/app/views/original_lisences/index.html.erb b/app/views/original_lisences/index.html.erb
new file mode 100644 (file)
index 0000000..570b54c
--- /dev/null
@@ -0,0 +1,21 @@
+<h1>Listing original_lisences</h1>
+
+<table>
+  <tr>
+    <th></th>
+    <th></th>
+    <th></th>
+  </tr>
+
+<% @original_lisences.each do |original_lisence| %>
+  <tr>
+    <td><%= link_to 'Show', original_lisence %></td>
+    <td><%= link_to 'Edit', edit_original_lisence_path(original_lisence) %></td>
+    <td><%= link_to 'Destroy', original_lisence, confirm: 'Are you sure?', method: :delete %></td>
+  </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Original lisence', new_original_lisence_path %>
diff --git a/app/views/original_lisences/new.html.erb b/app/views/original_lisences/new.html.erb
new file mode 100644 (file)
index 0000000..14de64d
--- /dev/null
@@ -0,0 +1,5 @@
+<h1>New original_lisence</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', lisences_path %>
diff --git a/app/views/original_lisences/show.html.erb b/app/views/original_lisences/show.html.erb
new file mode 100644 (file)
index 0000000..8ec72b7
--- /dev/null
@@ -0,0 +1,53 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+  <b>name:</b>
+  <%= @original_lisence.name %>
+</p>
+
+<p>
+  <b>url:</b>
+  <%= @original_lisence.url %>
+</p>
+
+<p>
+  <b>artist:</b>
+  <%= @original_lisence.artist_id %>
+</p>
+<p>
+  <b>cc_by:</b>
+  <%= @original_lisence.cc_by %>
+</p>
+
+<p>
+  <b>cc_sa:</b>
+  <%= @original_lisence.cc_sa %>
+</p>
+
+<p>
+  <b>cc_nd:</b>
+  <%= @original_lisence.cc_nd %>
+</p>
+
+<p>
+  <b>cc_nc:</b>
+  <%= @original_lisence.cc_nc %>
+</p>
+
+<p>
+  <b>no_resize:</b>
+  <%= @original_lisence.no_resize %>
+</p>
+
+<p>
+  <b>no_flip:</b>
+  <%= @original_lisence.no_flip %>
+</p>
+
+<p>
+  <b>keep_aspect_ratio:</b>
+  <%= @original_lisence.keep_aspect_ratio %>
+</p>
+
+<%= link_to 'Edit', edit_original_lisence_path(@original_lisence) %> |
+<%= link_to 'Back', original_lisences_path %>
diff --git a/app/views/original_pictures/_artist_register.html.erb b/app/views/original_pictures/_artist_register.html.erb
new file mode 100644 (file)
index 0000000..a7125bb
--- /dev/null
@@ -0,0 +1,29 @@
+<p>素材の投稿には絵師登録が必要です。</p>
+<p>下記フォームで登録してください。</p>
+
+<%= form_for(@artist) do |f| %>
+  <% if @artist.errors.any? %>
+    <div id="error_explanation">
+      <h2><%= pluralize(@artist.errors.count, "error") %> prohibited this artist from being saved:</h2>
+
+      <ul>
+      <% @artist.errors.full_messages.each do |msg| %>
+        <li><%= msg %></li>
+      <% end %>
+      </ul>
+    </div>
+  <% end %>
+
+  <div class="field">
+    <%= f.label :name %><br />
+    <%= f.text_field :name %><br />
+
+    <%= f.label :default_lisence_id %><br />
+    <%= f.number_field :default_lisence_id %>
+    <%= f.hidden_field :author_id, :value => @artist.author_id %>
+  </div>
+  <div class="actions">
+    <%= f.submit %>
+  </div>
+<% end %>
+
diff --git a/app/views/original_pictures/_uploader.html.erb b/app/views/original_pictures/_uploader.html.erb
new file mode 100644 (file)
index 0000000..21555b3
--- /dev/null
@@ -0,0 +1,12 @@
+<% if author_signed_in? -%>
+  <% if current_author.artist? -%>
+    <%= form_tag( {:action => "create"} , { :multipart => true }) do %>
+      <label for="file">File to Upload</label> <%= file_field_tag "original_picture[file]" %>
+      <%= submit_tag 'upload' -%>
+    <% end -%>
+  <% else -%>
+    <%= render 'artist_register' %>
+  <% end -%>
+<% else -%>
+  素材を投稿するなら<%= link_to "ログイン", new_author_session_path %>
+<% end -%>
diff --git a/app/views/original_pictures/index.html.erb b/app/views/original_pictures/index.html.erb
new file mode 100644 (file)
index 0000000..0143366
--- /dev/null
@@ -0,0 +1,31 @@
+<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>
+<% end %>
+</table>
diff --git a/app/views/original_pictures/show.html.erb b/app/views/original_pictures/show.html.erb
new file mode 100644 (file)
index 0000000..a48ef44
--- /dev/null
@@ -0,0 +1,48 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+  <b>Ext:</b>
+  <%= @original_picture.ext %>
+</p>
+
+<p>
+  <b>Width:</b>
+  <%= @original_picture.width %>
+</p>
+
+<p>
+  <b>Height:</b>
+  <%= @original_picture.height %>
+</p>
+
+<p>
+  <b>filesize:</b>
+  <%= @original_picture.filesize %>
+</p>
+
+<p>
+  <b>artist:</b>
+  <%= @original_picture.artist_id %>
+</p>
+
+<img src="<%= @original_picture.url -%>">
+
+<p>
+<a href="<%= @original_picture.url %>">browse picture</a> 
+</p>
+<p>
+<%= link_to '再生成', :action => :refresh, :id => @original_picture.id %>
+</p>
+<% if @original_picture.own? current_author -%>
+<p>
+Replace picture
+</p>
+  <%= form_for(@original_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', original_pictures_path %>
diff --git a/app/views/panel_pictures/index.html.erb b/app/views/panel_pictures/index.html.erb
new file mode 100644 (file)
index 0000000..afb2280
--- /dev/null
@@ -0,0 +1,31 @@
+<h1>Listing panel_pictures</h1>
+
+<table>
+  <tr>
+    <th>id</th>
+    <th>panel</th>
+    <th>resource_picture</th>
+    <th>Width</th>
+    <th>Height</th>
+    <th>Top offset</th>
+    <th>Left offset</th>
+    <th>Zindex</th>
+    <th>flip</th>
+    <th>updated_at</th>
+  </tr>
+
+<% @panel_pictures.each do |panel_picture| %>
+  <tr>
+    <td><%= panel_picture.id %></td>
+    <td><%= panel_picture.panel_id %></td>
+    <td><%= panel_picture.resource_picture_id %></td>
+    <td><%= panel_picture.width %></td>
+    <td><%= panel_picture.height %></td>
+    <td><%= panel_picture.top_offset %></td>
+    <td><%= panel_picture.left_offset %></td>
+    <td><%= panel_picture.zindex %></td>
+    <td><%= panel_picture.flip %></td>
+    <td><%= panel_picture.updated_at %></td>
+  </tr>
+<% end %>
+</table>
diff --git a/app/views/panels/_standard.html.erb b/app/views/panels/_standard.html.erb
new file mode 100644 (file)
index 0000000..f5df30b
--- /dev/null
@@ -0,0 +1,38 @@
+<span>
+Seqno:<%= @panel.seqno %>
+</span>
+<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.top_offset -%>px; left:<%= panel_picture.left_offset -%>px; z-index:<%= panel_picture.zindex -%>; ">
+      <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.top_offset -%>px; left:<%= balloon.left_offset -%>px; z-index:<%= balloon.zindex -%>; ">
+      <img style=" position:absolute; width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; " src="<%= balloon.resource_picture.url -%>">
+      <% balloon.speaches.each do |speach| %>
+        <div style="position:relative; top:<%= speach.top_offset -%>px; left:<%= speach.left_offset -%>px;width:<%= speach.width -%>px; height:<%= speach.height -%>px; top:1px; left:1px; z-index:1; ">
+          <%= h speach.content -%>
+        </div>
+      <% end %>
+    </div>
+  <% end %>
+</div>
+<span>
+Comic:<%= @panel.comic_id %>
+</span>
+<span>
+resource_picture:<%= @panel.resource_picture_id %>
+</span>
+<span>
+Width:<%= @panel.width %>
+</span>
+<span>
+Height:<%= @panel.height %>
+</span>
+<%= form_for(@panel) do |f| %>
+    <%= f.submit 'move to' %>
+     <%= f.number_field :seqno %>
+<% end %>
+<%= button_to 'Destroy', @panel, confirm: 'Are you sure?', method: :delete %>
+
diff --git a/app/views/panels/index.html.erb b/app/views/panels/index.html.erb
new file mode 100644 (file)
index 0000000..d0d77e4
--- /dev/null
@@ -0,0 +1,39 @@
+<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>Seqno</th>
+    <th>author_id</th>
+    <th>updated_at</th>
+    <th></th>
+    <th></th>
+  </tr>
+
+<% @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.seqno %></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>
+<% end %>
+</table>
diff --git a/app/views/panels/show.html.erb b/app/views/panels/show.html.erb
new file mode 100644 (file)
index 0000000..df3247a
--- /dev/null
@@ -0,0 +1,15 @@
+  <% if @panel.errors.any? %>
+    <div id="error_explanation">
+      <h2><%= pluralize(@panel.errors.count, "error") %> prohibited this panel from being saved:</h2>
+
+      <ul>
+      <% @panel.errors.full_messages.each do |msg| %>
+        <li><%= msg %></li>
+      <% end %>
+      </ul>
+    </div>
+  <% end %>
+<p id="notice"><%= notice %></p>
+<%= render 'standard' %>
+
+<%= link_to 'Back', panels_path %>
diff --git a/app/views/resource_pictures/index.html.erb b/app/views/resource_pictures/index.html.erb
new file mode 100644 (file)
index 0000000..05a67a1
--- /dev/null
@@ -0,0 +1,22 @@
+<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>
+<% end %>
+</table>
diff --git a/app/views/resource_pictures/show.html.erb b/app/views/resource_pictures/show.html.erb
new file mode 100644 (file)
index 0000000..03474a2
--- /dev/null
@@ -0,0 +1,23 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+  <a href="<%= @resource_picture.url %>">ノーマル</a> 
+  <img src="<%= @resource_picture.url -%>">
+</p>
+<p>
+  <a href="<%= @resource_picture.url :v %>">垂直反転</a> 
+  <img src="<%= @resource_picture.url :v -%>">
+</p>
+<p>
+  <a href="<%= @resource_picture.url :h %>">水平反転</a> 
+  <img src="<%= @resource_picture.url :h -%>">
+</p>
+<p>
+  <a href="<%= @resource_picture.url :vh%>">垂直水平反転</a> 
+  <img src="<%= @resource_picture.url :vh -%>">
+</p>
+<p>
+  <a href="<%= @resource_picture.url :thumbnail%>">サムネ</a> 
+  <img src="<%= @resource_picture.url :thumbnail -%>">
+</p>
+<%= link_to 'Back', resource_pictures_path %>
diff --git a/app/views/speach_balloons/index.html.erb b/app/views/speach_balloons/index.html.erb
new file mode 100644 (file)
index 0000000..648f9bc
--- /dev/null
@@ -0,0 +1,19 @@
+<h1>Listing speach_balloons</h1>
+
+<table>
+  <tr>
+    <th>Name</th>
+    <th>Tail limit</th>
+    <th>Border limit</th>
+    <th></th>
+  </tr>
+
+<% @speach_balloons.each do |speach_balloon| %>
+  <tr>
+    <td><%= h speach_balloon.name %></td>
+    <td><%= speach_balloon.tail_limit %></td>
+    <td><%= speach_balloon.border_limit %></td>
+    <td><%= link_to 'show', speach_balloon %></td>
+  </tr>
+<% end %>
+</table>
diff --git a/app/views/speach_balloons/show.html.erb b/app/views/speach_balloons/show.html.erb
new file mode 100644 (file)
index 0000000..122485b
--- /dev/null
@@ -0,0 +1,26 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+  <b>Name:</b>
+  <%= h @speach_balloon.name %>
+</p>
+
+<p>
+  <b>Tail limit:</b>
+  <%= @speach_balloon.tail_limit %>
+</p>
+
+<p>
+  <b>Border limit:</b>
+  <%= @speach_balloon.border_limit %>
+</p>
+<% @speach_balloon.balloon_templates.each do |balloon_template| -%>\r
+  <div>\r
+    <p>\r
+      Tail:<%= balloon_template.tail -%>\r
+      Border:<%= balloon_template.border -%>\r
+    </p>\r
+    <img src="<%= balloon_template.resource_picture.url -%>" />\r
+  </div>\r
+<% end -%>\r
+<%= link_to 'Back', speach_balloons_path %>
diff --git a/app/views/speach_templates/index.html.erb b/app/views/speach_templates/index.html.erb
new file mode 100644 (file)
index 0000000..b2fe5a6
--- /dev/null
@@ -0,0 +1,21 @@
+<h1>Listing speach_templates</h1>
+
+<table>
+  <tr>
+    <th>balloon template</th>
+    <th>Top offset</th>
+    <th>Left offset</th>
+    <th>Width</th>
+    <th>Height</th>
+  </tr>
+
+<% @speach_templates.each do |speach_template| %>
+  <tr>
+    <td><%= speach_template.balloon_template_id %></td>
+    <td><%= speach_template.top_offset %></td>
+    <td><%= speach_template.left_offset %></td>
+    <td><%= speach_template.width %></td>
+    <td><%= speach_template.height %></td>
+  </tr>
+<% end %>
+</table>
diff --git a/app/views/speaches/index.html.erb b/app/views/speaches/index.html.erb
new file mode 100644 (file)
index 0000000..434bef7
--- /dev/null
@@ -0,0 +1,24 @@
+<h1>Listing speaches</h1>
+
+<table>
+  <tr>
+    <th>balloon</th>
+    <th>content</th>
+    <th>Top offset</th>
+    <th>Left offset</th>
+    <th>Width</th>
+    <th>Height</th>
+  </tr>
+
+<% @speaches.each do |speach| %>
+  <tr>
+    <td><%= speach.balloon_id %></td>
+    <td><%= speach.content %></td>
+    <td><%= speach.top_offset %></td>
+    <td><%= speach.left_offset %></td>
+    <td><%= speach.width %></td>
+    <td><%= speach.height %></td>
+  </tr>
+<% end %>
+</table>
+
diff --git a/app/views/system/start.html.erb b/app/views/system/start.html.erb
new file mode 100644 (file)
index 0000000..3da455d
--- /dev/null
@@ -0,0 +1,6 @@
+<p>このシステムには管理者が設定されていません。</p>
+<p>次のコマンドで管理者アカウントを作成してください。</p>
+
+<div style="background-color: #dddddd">
+rails r "Admin.start('admin@mail.adr.ess', 'admin_password')
+</div>
diff --git a/app/views/system/waiting_list.html.erb b/app/views/system/waiting_list.html.erb
new file mode 100644 (file)
index 0000000..c6e8fe5
--- /dev/null
@@ -0,0 +1,15 @@
+<h1>Listing artists</h1>
+
+<table>
+  <tr>
+    <th>author</th>
+    <th></th>
+  </tr>
+
+<% @artists.each do |artist| %>
+  <tr>
+    <td><%= artist.author_id %></td>
+    <td><%= link_to 'Show', artist %></td>
+  </tr>
+<% end %>
+</table>
diff --git a/config.ru b/config.ru
new file mode 100644 (file)
index 0000000..b8f4003
--- /dev/null
+++ b/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment',  __FILE__)
+run Pettanr::Application
diff --git a/config/application.rb b/config/application.rb
new file mode 100644 (file)
index 0000000..35fd1cc
--- /dev/null
@@ -0,0 +1,55 @@
+require File.expand_path('../boot', __FILE__)
+
+# Pick the frameworks you want:
+require "active_record/railtie"
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "active_resource/railtie"
+require "sprockets/railtie"
+# require "rails/test_unit/railtie"
+
+if defined?(Bundler)
+  # If you precompile assets before deploying to production, use this line
+  Bundler.require(*Rails.groups(:assets => %w(development test)))
+  # If you want your assets lazily compiled in production, use this line
+  # Bundler.require(:default, :assets, Rails.env)
+end
+
+module Pettanr
+  class Application < Rails::Application
+    # Settings in config/environments/* take precedence over those specified here.
+    # Application configuration should go into files in config/initializers
+    # -- all .rb files in that directory are automatically loaded.
+config.assets.initialize_on_precompile = false
+
+    # Custom directories with classes and modules you want to be autoloadable.
+    # config.autoload_paths += %W(#{config.root}/extras)
+
+    # Only load the plugins named here, in the order given (default is alphabetical).
+    # :all can be used as a placeholder for all plugins not explicitly named.
+    # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+    # Activate observers that should always be running.
+    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+    # config.time_zone = 'Central Time (US & Canada)'
+
+    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+    # config.i18n.default_locale = :de
+
+    # Configure the default encoding used in templates for Ruby 1.9.
+    config.encoding = "utf-8"
+
+    # Configure sensitive parameters which will be filtered from the log file.
+    config.filter_parameters += [:password]
+
+    # Enable the asset pipeline
+    config.assets.enabled = true
+
+    # Version of your assets, change this if you want to expire all your assets
+    config.assets.version = '1.0'
+  end
+end
diff --git a/config/aws.yaml.org b/config/aws.yaml.org
new file mode 100644 (file)
index 0000000..869e47f
--- /dev/null
@@ -0,0 +1,2 @@
+access_key_id: XXXXXXXXXXXXXXXXXXXX
+secret_access_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
diff --git a/config/boot.rb b/config/boot.rb
new file mode 100644 (file)
index 0000000..4489e58
--- /dev/null
@@ -0,0 +1,6 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/cucumber.yml b/config/cucumber.yml
new file mode 100644 (file)
index 0000000..19b288d
--- /dev/null
@@ -0,0 +1,8 @@
+<%
+rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
+rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
+%>
+default: <%= std_opts %> features
+wip: --tags @wip:3 --wip features
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
diff --git a/config/database.yml b/config/database.yml
new file mode 100644 (file)
index 0000000..09cc85a
--- /dev/null
@@ -0,0 +1,28 @@
+# SQLite version 3.x
+#   gem install sqlite3
+#
+#   Ensure the SQLite 3 gem is defined in your Gemfile
+#   gem 'sqlite3'
+development:
+  adapter: sqlite3
+  database: db/development.sqlite3
+  pool: 5
+  timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test: &test
+  adapter: sqlite3
+  database: db/test.sqlite3
+  pool: 5
+  timeout: 5000
+
+production:
+  adapter: sqlite3
+  database: db/production.sqlite3
+  pool: 5
+  timeout: 5000
+
+cucumber:
+  <<: *test
\ No newline at end of file
diff --git a/config/environment.rb b/config/environment.rb
new file mode 100644 (file)
index 0000000..904ba8d
--- /dev/null
@@ -0,0 +1,6 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Pettanr::Application.initialize!
+require 'picture_io'
diff --git a/config/environments/development.rb b/config/environments/development.rb
new file mode 100644 (file)
index 0000000..138112a
--- /dev/null
@@ -0,0 +1,38 @@
+require 'DMagick'
+
+Pettanr::Application.configure do
+  # Settings specified here will take precedence over those in config/application.rb
+
+  # In the development environment your application's code is reloaded on
+  # every request.  This slows down response time but is perfect for development
+  # since you don't have to restart the web server when you make code changes.
+  config.cache_classes = false
+
+  # Log error messages when you accidentally call methods on nil.
+  config.whiny_nils = true
+
+  # Show full error reports and disable caching
+  config.consider_all_requests_local       = true
+  config.action_controller.perform_caching = false
+
+  # Don't care if the mailer can't send
+  config.action_mailer.raise_delivery_errors = false
+
+  # Print deprecation notices to the Rails logger
+  config.active_support.deprecation = :log
+
+  # Only use best-standards-support built into browsers
+  config.action_dispatch.best_standards_support = :builtin
+
+  # Do not compress assets
+  config.assets.compress = false
+
+  # Expands the lines which load the assets
+  config.assets.debug = true
+end
+
+require 'local_picture'
+PictureIO.setup do |config|
+  config.original_picture_io = PictureIO::LocalPicture.new '/sites/original/pettanr/'
+  config.resource_picture_io = PictureIO::LocalPicture.new  '/sites/resource/pettanr/'
+end
diff --git a/config/environments/production.rb b/config/environments/production.rb
new file mode 100644 (file)
index 0000000..71c356d
--- /dev/null
@@ -0,0 +1,74 @@
+require 'RMagick'
+Pettanr::Application.configure do
+  # Settings specified here will take precedence over those in config/application.rb
+
+  # Code is not reloaded between requests
+  config.cache_classes = true
+
+  # Full error reports are disabled and caching is turned on
+  config.consider_all_requests_local       = false
+  config.action_controller.perform_caching = true
+
+  # Disable Rails's static asset server (Apache or nginx will already do this)
+  config.serve_static_assets = false
+
+  # Compress JavaScripts and CSS
+  config.assets.compress = true
+
+  # Don't fallback to assets pipeline if a precompiled asset is missed
+  config.assets.compile = false
+
+  # Generate digests for assets URLs
+  config.assets.digest = true
+
+  # Defaults to Rails.root.join("public/assets")
+  # config.assets.manifest = YOUR_PATH
+
+  # Specifies the header that your server uses for sending files
+  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+  # config.force_ssl = true
+
+  # See everything in the log (default is :info)
+  # config.log_level = :debug
+
+  # Use a different logger for distributed setups
+  # config.logger = SyslogLogger.new
+
+  # Use a different cache store in production
+  # config.cache_store = :mem_cache_store
+
+  # Enable serving of images, stylesheets, and JavaScripts from an asset server
+  # config.action_controller.asset_host = "http://assets.example.com"
+
+  # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+  # config.assets.precompile += %w( search.js )
+
+  # Disable delivery errors, bad email addresses will be ignored
+  # config.action_mailer.raise_delivery_errors = false
+
+  # Enable threaded mode
+  # config.threadsafe!
+
+  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+  # the I18n.default_locale when a translation can not be found)
+  config.i18n.fallbacks = true
+
+  # Send deprecation notices to registered listeners
+  config.active_support.deprecation = :notify
+end
+require 'aws/s3'
+require 'yaml'
+
+y = YAML.load(open(Rails.root + 'config/aws.yaml').read)
+AWS::S3::Base.establish_connection!(
+  :access_key_id => y["access_key_id"], 
+  :secret_access_key => y["secret_access_key"]
+)
+require 's3_picture'
+PictureIO.setup do |config|
+  config.original_picture_io = PictureIO::S3Picture.new 'pettanr-original'
+  config.resource_picture_io = PictureIO::S3Picture.new 'pettanr-stable'
+end
diff --git a/config/environments/test.rb b/config/environments/test.rb
new file mode 100644 (file)
index 0000000..a9b849b
--- /dev/null
@@ -0,0 +1,39 @@
+Pettanr::Application.configure do
+  # Settings specified here will take precedence over those in config/application.rb
+
+  # The test environment is used exclusively to run your application's
+  # test suite.  You never need to work with it otherwise.  Remember that
+  # your test database is "scratch space" for the test suite and is wiped
+  # and recreated between test runs.  Don't rely on the data there!
+  config.cache_classes = true
+
+  # Configure static asset server for tests with Cache-Control for performance
+  config.serve_static_assets = true
+  config.static_cache_control = "public, max-age=3600"
+
+  # Log error messages when you accidentally call methods on nil
+  config.whiny_nils = true
+
+  # Show full error reports and disable caching
+  config.consider_all_requests_local       = true
+  config.action_controller.perform_caching = false
+
+  # Raise exceptions instead of rendering exception templates
+  config.action_dispatch.show_exceptions = false
+
+  # Disable request forgery protection in test environment
+  config.action_controller.allow_forgery_protection    = false
+
+  # Tell Action Mailer not to deliver emails to the real world.
+  # The :test delivery method accumulates sent emails in the
+  # ActionMailer::Base.deliveries array.
+  config.action_mailer.delivery_method = :test
+
+  # Use SQL instead of Active Record's schema dumper when creating the test database.
+  # This is necessary if your schema can't be completely dumped by the schema dumper,
+  # like if you have constraints or database-specific column types
+  # config.active_record.schema_format = :sql
+
+  # Print deprecation notices to the stderr
+  config.active_support.deprecation = :stderr
+end
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
new file mode 100644 (file)
index 0000000..59385cd
--- /dev/null
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
new file mode 100644 (file)
index 0000000..cbfbd72
--- /dev/null
@@ -0,0 +1,210 @@
+# Use this hook to configure devise mailer, warden hooks and so forth.
+# Many of these configuration options can be set straight in your model.
+Devise.setup do |config|
+  # ==> Mailer Configuration
+  # Configure the e-mail address which will be shown in Devise::Mailer,
+  # note that it will be overwritten if you use your own mailer class with default "from" parameter.
+  config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
+config.sign_out_via = :get
+
+  # Configure the class responsible to send e-mails.
+  # config.mailer = "Devise::Mailer"
+
+  # ==> ORM configuration
+  # Load and configure the ORM. Supports :active_record (default) and
+  # :mongoid (bson_ext recommended) by default. Other ORMs may be
+  # available as additional gems.
+  require 'devise/orm/active_record'
+
+  # ==> Configuration for any authentication mechanism
+  # Configure which keys are used when authenticating a user. The default is
+  # just :email. You can configure it to use [:username, :subdomain], so for
+  # authenticating a user, both parameters are required. Remember that those
+  # parameters are used only when authenticating and not when retrieving from
+  # session. If you need permissions, you should implement that in a before filter.
+  # You can also supply a hash where the value is a boolean determining whether
+  # or not authentication should be aborted when the value is not present.
+  # config.authentication_keys = [ :email ]
+
+  # Configure parameters from the request object used for authentication. Each entry
+  # given should be a request method and it will automatically be passed to the
+  # find_for_authentication method and considered in your model lookup. For instance,
+  # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
+  # The same considerations mentioned for authentication_keys also apply to request_keys.
+  # config.request_keys = []
+
+  # Configure which authentication keys should be case-insensitive.
+  # These keys will be downcased upon creating or modifying a user and when used
+  # to authenticate or find a user. Default is :email.
+  config.case_insensitive_keys = [ :email ]
+
+  # Configure which authentication keys should have whitespace stripped.
+  # These keys will have whitespace before and after removed upon creating or
+  # modifying a user and when used to authenticate or find a user. Default is :email.
+  config.strip_whitespace_keys = [ :email ]
+
+  # Tell if authentication through request.params is enabled. True by default.
+  # config.params_authenticatable = true
+
+  # Tell if authentication through HTTP Basic Auth is enabled. False by default.
+  # config.http_authenticatable = false
+
+  # If http headers should be returned for AJAX requests. True by default.
+  # config.http_authenticatable_on_xhr = true
+
+  # The realm used in Http Basic Authentication. "Application" by default.
+  # config.http_authentication_realm = "Application"
+
+  # It will change confirmation, password recovery and other workflows
+  # to behave the same regardless if the e-mail provided was right or wrong.
+  # Does not affect registerable.
+  # config.paranoid = true
+
+  # ==> Configuration for :database_authenticatable
+  # For bcrypt, this is the cost for hashing the password and defaults to 10. If
+  # using other encryptors, it sets how many times you want the password re-encrypted.
+  #
+  # Limiting the stretches to just one in testing will increase the performance of
+  # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
+  # a value less than 10 in other environments.
+  config.stretches = Rails.env.test? ? 1 : 10
+
+  # Setup a pepper to generate the encrypted password.
+  # config.pepper = "7835fc9cebff957984851fd2936fbfb6593439b1ebf26dbe6e3da1554a12dfaaa6e551ad7b4681d07ccaf66cd73cf9440cd54c75e0d85caa27f605118b1456b0"
+
+  # ==> Configuration for :confirmable
+  # A period that the user is allowed to access the website even without
+  # confirming his account. For instance, if set to 2.days, the user will be
+  # able to access the website for two days without confirming his account,
+  # access will be blocked just in the third day. Default is 0.days, meaning
+  # the user cannot access the website without confirming his account.
+  # config.confirm_within = 2.days
+
+  # Defines which key will be used when confirming an account
+  # config.confirmation_keys = [ :email ]
+
+  # ==> Configuration for :rememberable
+  # The time the user will be remembered without asking for credentials again.
+  # config.remember_for = 2.weeks
+
+  # If true, a valid remember token can be re-used between multiple browsers.
+  # config.remember_across_browsers = true
+
+  # If true, extends the user's remember period when remembered via cookie.
+  # config.extend_remember_period = false
+
+  # If true, uses the password salt as remember token. This should be turned
+  # to false if you are not using database authenticatable.
+  config.use_salt_as_remember_token = true
+
+  # Options to be passed to the created cookie. For instance, you can set
+  # :secure => true in order to force SSL only cookies.
+  # config.cookie_options = {}
+
+  # ==> Configuration for :validatable
+  # Range for password length. Default is 6..128.
+  # config.password_length = 6..128
+
+  # Email regex used to validate email formats. It simply asserts that
+  # an one (and only one) @ exists in the given string. This is mainly
+  # to give user feedback and not to assert the e-mail validity.
+  # config.email_regexp = /\A[^@]+@[^@]+\z/
+
+  # ==> Configuration for :timeoutable
+  # The time you want to timeout the user session without activity. After this
+  # time the user will be asked for credentials again. Default is 30 minutes.
+  # config.timeout_in = 30.minutes
+
+  # ==> Configuration for :lockable
+  # Defines which strategy will be used to lock an account.
+  # :failed_attempts = Locks an account after a number of failed attempts to sign in.
+  # :none            = No lock strategy. You should handle locking by yourself.
+  # config.lock_strategy = :failed_attempts
+
+  # Defines which key will be used when locking and unlocking an account
+  # config.unlock_keys = [ :email ]
+
+  # Defines which strategy will be used to unlock an account.
+  # :email = Sends an unlock link to the user email
+  # :time  = Re-enables login after a certain amount of time (see :unlock_in below)
+  # :both  = Enables both strategies
+  # :none  = No unlock strategy. You should handle unlocking by yourself.
+  # config.unlock_strategy = :both
+
+  # Number of authentication tries before locking an account if lock_strategy
+  # is failed attempts.
+  # config.maximum_attempts = 20
+
+  # Time interval to unlock the account if :time is enabled as unlock_strategy.
+  # config.unlock_in = 1.hour
+
+  # ==> Configuration for :recoverable
+  #
+  # Defines which key will be used when recovering the password for an account
+  # config.reset_password_keys = [ :email ]
+
+  # Time interval you can reset your password with a reset password key.
+  # Don't put a too small interval or your users won't have the time to
+  # change their passwords.
+  config.reset_password_within = 2.hours
+
+  # ==> Configuration for :encryptable
+  # Allow you to use another encryption algorithm besides bcrypt (default). You can use
+  # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
+  # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
+  # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
+  # REST_AUTH_SITE_KEY to pepper)
+  # config.encryptor = :sha512
+
+  # ==> Configuration for :token_authenticatable
+  # Defines name of the authentication token params key
+config.token_authentication_key = :auth_token
+
+  # If true, authentication through token does not store user in session and needs
+  # to be supplied on each request. Useful if you are using the token as API token.
+  # config.stateless_token = false
+
+  # ==> Scopes configuration
+  # Turn scoped views on. Before rendering "sessions/new", it will first check for
+  # "users/sessions/new". It's turned off by default because it's slower if you
+  # are using only default views.
+config.scoped_views = true
+
+  # Configure the default scope given to Warden. By default it's the first
+  # devise role declared in your routes (usually :user).
+  # config.default_scope = :user
+
+  # Configure sign_out behavior.
+  # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
+  # The default is true, which means any logout action will sign out all active scopes.
+  # config.sign_out_all_scopes = true
+
+  # ==> Navigation configuration
+  # Lists the formats that should be treated as navigational. Formats like
+  # :html, should redirect to the sign in page when the user does not have
+  # access, but formats like :xml or :json, should return 401.
+  #
+  # If you have any extra navigational formats, like :iphone or :mobile, you
+  # should add them to the navigational formats lists.
+  #
+  # The :"*/*" and "*/*" formats below is required to match Internet
+  # Explorer requests.
+  # config.navigational_formats = [:"*/*", "*/*", :html]
+
+  # The default HTTP method used to sign out a resource. Default is :delete.
+  config.sign_out_via = :delete
+
+  # ==> OmniAuth
+  # Add a new OmniAuth provider. Check the wiki for more information on setting
+  # up on your models and hooks.
+  # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
+
+  # ==> Warden configuration
+  # If you want to use other strategies, that are not supported by Devise, or
+  # change the failure app, you can configure them inside the config.warden block.
+  #
+  # config.warden do |manager|
+  #   manager.intercept_401 = false
+  #   manager.default_strategies(:scope => :user).unshift :some_external_strategy
+  # end
+end
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
new file mode 100644 (file)
index 0000000..9e8b013
--- /dev/null
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+#   inflect.plural /^(ox)$/i, '\1en'
+#   inflect.singular /^(ox)en/i, '\1'
+#   inflect.irregular 'person', 'people'
+#   inflect.uncountable %w( fish sheep )
+# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
new file mode 100644 (file)
index 0000000..8f16e73
--- /dev/null
@@ -0,0 +1,9 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
+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
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
new file mode 100644 (file)
index 0000000..0c7ad4b
--- /dev/null
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Pettanr::Application.config.secret_token = 'e19abc2df3c3b5b73fa734769b24396a24cf79a79c4d4ebae8a170cb67bc4969beb3a88053fa9f9e1dbfb7c6a60bcc04852156adc3ef0675de283562e500a43a'
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
new file mode 100644 (file)
index 0000000..87c3743
--- /dev/null
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Pettanr::Application.config.session_store :cookie_store, key: '_pettanr_session'
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rails generate session_migration")
+# Pettanr::Application.config.session_store :active_record_store
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
new file mode 100644 (file)
index 0000000..999df20
--- /dev/null
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+  wrap_parameters format: [:json]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+  self.include_root_in_json = false
+end
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
new file mode 100644 (file)
index 0000000..79b3d5e
--- /dev/null
@@ -0,0 +1,58 @@
+# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
+
+en:
+  errors:
+    messages:
+      expired: "has expired, please request a new one"
+      not_found: "not found"
+      already_confirmed: "was already confirmed, please try signing in"
+      not_locked: "was not locked"
+      not_saved:
+        one: "1 error prohibited this %{resource} from being saved:"
+        other: "%{count} errors prohibited this %{resource} from being saved:"
+
+  devise:
+    failure:
+      already_authenticated: 'You are already signed in.'
+      unauthenticated: 'You need to sign in or sign up before continuing.'
+      unconfirmed: 'You have to confirm your account before continuing.'
+      locked: 'Your account is locked.'
+      invalid: 'Invalid email or password.'
+      invalid_token: 'Invalid authentication token.'
+      timeout: 'Your session expired, please sign in again to continue.'
+      inactive: 'Your account was not activated yet.'
+    sessions:
+      signed_in: 'Signed in successfully.'
+      signed_out: 'Signed out successfully.'
+    passwords:
+      send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
+      updated: 'Your password was changed successfully. You are now signed in.'
+      updated_not_active: 'Your password was changed successfully.'
+      send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
+    confirmations:
+      send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
+      send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
+      confirmed: 'Your account was successfully confirmed. You are now signed in.'
+    registrations:
+      signed_up: 'Welcome! You have signed up successfully.'
+      inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
+      updated: 'You updated your account successfully.'
+      destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
+      reasons:
+        inactive: 'inactive'
+        unconfirmed: 'unconfirmed'
+        locked: 'locked'
+    unlocks:
+      send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
+      unlocked: 'Your account was successfully unlocked. You are now signed in.'
+      send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
+    omniauth_callbacks:
+      success: 'Successfully authorized from %{kind} account.'
+      failure: 'Could not authorize you from %{kind} because "%{reason}".'
+    mailer:
+      confirmation_instructions:
+        subject: 'Confirmation instructions'
+      reset_password_instructions:
+        subject: 'Reset password instructions'
+      unlock_instructions:
+        subject: 'Unlock Instructions'
diff --git a/config/locales/en.yml b/config/locales/en.yml
new file mode 100644 (file)
index 0000000..179c14c
--- /dev/null
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+  hello: "Hello world"
diff --git a/config/routes.rb b/config/routes.rb
new file mode 100644 (file)
index 0000000..0e0b2c6
--- /dev/null
@@ -0,0 +1,87 @@
+Pettanr::Application.routes.draw do
+
+  devise_for :admins
+  devise_for :authors
+
+  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
+
+  # The priority is based upon order of creation:
+  # first created -> highest priority.
+
+  # Sample of regular route:
+  #   match 'products/:id' => 'catalog#view'
+  # Keep in mind you can assign values other than :controller and :action
+  match 'comics/:id(.:format)/play' => 'comics#play'
+  match 'resource_pictures/:subdir/:id(.:format)/' => 'resource_pictures#show'
+  match 'home/(:action)', :controller => 'home'
+  match 'help/(:action)', :controller => 'help'
+  controller 'system' do
+    get 'start'
+#    match 'start', :to => 'system#start'
+  end
+  
+  # Sample of named route:
+  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
+  # This route can be invoked with purchase_url(:id => product.id)
+
+  # Sample resource route (maps HTTP verbs to controller actions automatically):
+  #   resources :products
+
+  # Sample resource route with options:
+  #   resources :products do
+  #     member do
+  #       get 'short'
+  #       post 'toggle'
+  #     end
+  #
+  #     collection do
+  #       get 'sold'
+  #     end
+  #   end
+
+  # Sample resource route with sub-resources:
+  #   resources :products do
+  #     resources :comments, :sales
+  #     resource :seller
+  #   end
+
+  # Sample resource route with more complex sub-resources
+  #   resources :products do
+  #     resources :comments
+  #     resources :sales do
+  #       get 'recent', :on => :collection
+  #     end
+  #   end
+
+  # Sample resource route within a namespace:
+  #   namespace :admin do
+  #     # Directs /admin/products/* to Admin::ProductsController
+  #     # (app/controllers/admin/products_controller.rb)
+  #     resources :products
+  #   end
+
+  # You can have the root of your site routed with "root"
+  # just remember to delete public/index.html.
+  root :to => 'comics#top'
+
+  # See how all your routes lay out with "rake routes"
+
+  # 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)))'
+end
diff --git a/db/migrate/20111206091950_devise_create_authors.rb b/db/migrate/20111206091950_devise_create_authors.rb
new file mode 100644 (file)
index 0000000..74b0f47
--- /dev/null
@@ -0,0 +1,26 @@
+class DeviseCreateAuthors < ActiveRecord::Migration
+  def change
+    create_table(:authors) do |t|
+      t.string :name\r
+      t.database_authenticatable :null => false
+      t.recoverable
+      t.rememberable
+      t.trackable
+      t.token_authenticatable
+      t.confirmable
+
+      # t.encryptable
+      # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
+
+
+      t.timestamps
+    end
+
+    add_index :authors, :email,                :unique => true
+    add_index :authors, :reset_password_token, :unique => true
+    add_index :authors, :confirmation_token,   :unique => true
+    # add_index :authors, :unlock_token,         :unique => true
+    add_index :authors, :authentication_token, :unique => true
+  end
+
+end
diff --git a/db/migrate/20111206092734_devise_create_admins.rb b/db/migrate/20111206092734_devise_create_admins.rb
new file mode 100644 (file)
index 0000000..554e768
--- /dev/null
@@ -0,0 +1,25 @@
+class DeviseCreateAdmins < ActiveRecord::Migration
+  def change
+    create_table(:admins) do |t|
+      t.database_authenticatable :null => false
+      t.recoverable
+      t.rememberable
+      t.trackable
+
+      # t.encryptable
+      # t.confirmable
+      # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
+      # t.token_authenticatable
+      t.integer :activate, :null => false, :default => false
+
+      t.timestamps
+    end
+
+    add_index :admins, :email,                :unique => true
+    add_index :admins, :reset_password_token, :unique => true
+    # add_index :admins, :confirmation_token,   :unique => true
+    # add_index :admins, :unlock_token,         :unique => true
+    # add_index :admins, :authentication_token, :unique => true
+  end
+
+end
diff --git a/db/migrate/20111206095746_create_artists.rb b/db/migrate/20111206095746_create_artists.rb
new file mode 100644 (file)
index 0000000..1d5e26e
--- /dev/null
@@ -0,0 +1,14 @@
+class CreateArtists < ActiveRecord::Migration
+  def change
+    create_table :artists do |t|
+      t.string :email\r
+      t.string :name\r
+      t.string :homepage_url\r
+      t.string :api_url\r
+      t.integer :default_lisence_id\r
+      t.timestamp :crowled_at\r
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/migrate/20111206100750_create_lisences.rb b/db/migrate/20111206100750_create_lisences.rb
new file mode 100644 (file)
index 0000000..7261771
--- /dev/null
@@ -0,0 +1,18 @@
+class CreateLisences < ActiveRecord::Migration
+  def change
+    create_table :lisences do |t|
+      t.string :name, :null => false\r
+      t.string :url, :null => false\r
+      t.integer :cc_by, :null => false, :default => 0\r
+      t.integer :cc_sa, :null => false, :default => 0\r
+      t.integer :cc_nd, :null => false, :default => 0\r
+      t.integer :cc_nc, :null => false, :default => 0\r
+      t.integer :no_resize, :null => false, :default => 0\r
+      t.integer :no_flip, :null => false, :default => 0\r
+      t.integer :keep_aspect_ratio, :null => false, :default => 0\r
+
+      t.timestamps
+    end
+    add_index :lisences, [:url], :unique => true
+  end
+end
diff --git a/db/migrate/20111206105022_create_original_lisences.rb b/db/migrate/20111206105022_create_original_lisences.rb
new file mode 100644 (file)
index 0000000..221565c
--- /dev/null
@@ -0,0 +1,19 @@
+class CreateOriginalLisences < ActiveRecord::Migration
+  def change
+    create_table :original_lisences do |t|
+      t.integer :artist_id, :null => false
+      t.integer :lisence_id, :null => false
+      t.string :name, :null => false\r
+      t.string :url, :null => false\r
+      t.integer :cc_by, :null => false, :default => 0\r
+      t.integer :cc_sa, :null => false, :default => 0\r
+      t.integer :cc_nd, :null => false, :default => 0\r
+      t.integer :cc_nc, :null => false, :default => 0\r
+      t.integer :no_resize, :null => false, :default => 0\r
+      t.integer :no_flip, :null => false, :default => 0\r
+      t.integer :keep_aspect_ratio, :null => false, :default => 0\r
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/migrate/20111206105830_create_comics.rb b/db/migrate/20111206105830_create_comics.rb
new file mode 100644 (file)
index 0000000..4724a82
--- /dev/null
@@ -0,0 +1,13 @@
+class CreateComics < ActiveRecord::Migration
+  def change
+    create_table :comics do |t|
+      t.string :title
+      t.integer :default_width, :null => false, :default => 200
+      t.integer :default_height, :null => false, :default => 80
+      t.integer :author_id
+
+      t.timestamps
+    end
+    add_index :comics, [:author_id]
+  end
+end
diff --git a/db/migrate/20111206111202_create_panels.rb b/db/migrate/20111206111202_create_panels.rb
new file mode 100644 (file)
index 0000000..2645e88
--- /dev/null
@@ -0,0 +1,17 @@
+class CreatePanels < ActiveRecord::Migration
+  def change
+    create_table :panels do |t|
+      t.integer :comic_id, :null => false
+      t.integer :resource_picture_id
+      t.integer :width, :null => false, :default => 200
+      t.integer :height, :null => false, :default => 80
+      t.integer :border, :null => false, :default => 1
+      t.integer :seqno, :null => false
+      t.integer :author_id
+
+      t.timestamps
+    end
+    add_index :panels, [:comic_id, :seqno]
+    add_index :panels, [:author_id]
+  end
+end
diff --git a/db/migrate/20111206112042_create_original_pictures.rb b/db/migrate/20111206112042_create_original_pictures.rb
new file mode 100644 (file)
index 0000000..b1bf18f
--- /dev/null
@@ -0,0 +1,15 @@
+class CreateOriginalPictures < ActiveRecord::Migration
+  def change
+    create_table :original_pictures do |t|
+      t.string :ext, :null => false
+      t.integer :width, :null => false
+      t.integer :height, :null => false
+      t.integer :filesize, :null => false
+      t.integer :artist_id#, :null => false
+      t.integer :lisence_id#, :null => false
+
+      t.timestamps
+    end
+    add_index :original_pictures, [:artist_id]\r
+  end
+end
diff --git a/db/migrate/20111206112949_create_resource_pictures.rb b/db/migrate/20111206112949_create_resource_pictures.rb
new file mode 100644 (file)
index 0000000..7ed414c
--- /dev/null
@@ -0,0 +1,15 @@
+class CreateResourcePictures < ActiveRecord::Migration
+  def change
+    create_table :resource_pictures do |t|
+      t.string :ext, :null => false
+      t.integer :width, :null => false
+      t.integer :height, :null => false
+      t.integer :filesize, :null => false
+      t.integer :artist_id#, :null => false
+      t.integer :lisence_id#, :null => false
+      t.integer :original_picture_id, :null => false
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/migrate/20111206113803_create_panel_pictures.rb b/db/migrate/20111206113803_create_panel_pictures.rb
new file mode 100644 (file)
index 0000000..cae5489
--- /dev/null
@@ -0,0 +1,18 @@
+class CreatePanelPictures < ActiveRecord::Migration
+  def change
+    create_table :panel_pictures do |t|
+      t.integer :panel_id, :null => false
+      t.integer :resource_picture_id, :null => false
+      t.integer :width, :null => false
+      t.integer :height, :null => false
+      t.integer :top_offset, :null => false
+      t.integer :left_offset, :null => false
+      t.integer :zindex, :null => false
+      t.integer :v, :null => false, :default => 0
+      t.integer :h, :null => false, :default => 0
+
+      t.timestamps
+    end
+    add_index :panel_pictures, [:panel_id, :zindex]
+  end
+end
diff --git a/db/migrate/20111206115439_create_balloon_templates.rb b/db/migrate/20111206115439_create_balloon_templates.rb
new file mode 100644 (file)
index 0000000..80f235e
--- /dev/null
@@ -0,0 +1,18 @@
+class CreateBalloonTemplates < ActiveRecord::Migration
+  def change
+    create_table :balloon_templates do |t|
+      t.integer :speach_balloon_id, :null => false
+      t.integer :resource_picture_id, :null => false
+      t.integer :tail, :null => false, :default => 1
+      t.integer :border, :null => false, :default => 1
+      t.integer :min_width, :null => false, :default => 0
+      t.integer :max_width, :null => false, :default => 0
+      t.integer :min_height, :null => false, :default => 0
+      t.integer :max_height, :null => false, :default => 0
+
+      t.timestamps
+    end
+    add_index :balloon_templates, [:speach_balloon_id]
+    add_index :balloon_templates, [:speach_balloon_id, :tail, :border], :unique => true, :name => 'sb_tb'
+  end
+end
diff --git a/db/migrate/20111206120252_create_speach_templates.rb b/db/migrate/20111206120252_create_speach_templates.rb
new file mode 100644 (file)
index 0000000..8c6d6fc
--- /dev/null
@@ -0,0 +1,14 @@
+class CreateSpeachTemplates < ActiveRecord::Migration
+  def change
+    create_table :speach_templates do |t|
+      t.integer :balloon_template_id, :null => false
+      t.integer :top_offset, :null => false
+      t.integer :left_offset, :null => false
+      t.integer :width, :null => false
+      t.integer :height, :null => false
+
+      t.timestamps
+    end
+    add_index :speach_templates, [:balloon_template_id]
+  end
+end
diff --git a/db/migrate/20111206121123_create_balloons.rb b/db/migrate/20111206121123_create_balloons.rb
new file mode 100644 (file)
index 0000000..04de574
--- /dev/null
@@ -0,0 +1,20 @@
+class CreateBalloons < ActiveRecord::Migration
+  def change
+    create_table :balloons do |t|
+      t.integer :panel_id, :null => false
+      t.integer :balloon_template_id, :null => false
+      t.integer :resource_picture_id, :null => false
+      t.integer :tail, :null => false, :default => 1
+      t.integer :border, :null => false, :default => 1
+      t.integer :zindex, :null => false
+      t.integer :top_offset, :null => false
+      t.integer :left_offset, :null => false
+      t.integer :width, :null => false
+      t.integer :height, :null => false
+
+      t.timestamps
+    end
+    add_index :balloons, [:panel_id]
+    add_index :balloons, [:panel_id, :zindex]
+  end
+end
diff --git a/db/migrate/20111206130635_create_speaches.rb b/db/migrate/20111206130635_create_speaches.rb
new file mode 100644 (file)
index 0000000..3e18702
--- /dev/null
@@ -0,0 +1,15 @@
+class CreateSpeaches < ActiveRecord::Migration
+  def change
+    create_table :speaches do |t|
+      t.integer :balloon_id, :null => false
+      t.string :content
+      t.integer :top_offset, :null => false
+      t.integer :left_offset, :null => false
+      t.integer :width, :null => false
+      t.integer :height, :null => false
+
+      t.timestamps
+    end
+    add_index :speaches, [:balloon_id]
+  end
+end
diff --git a/db/migrate/20111208235818_create_speach_balloons.rb b/db/migrate/20111208235818_create_speach_balloons.rb
new file mode 100644 (file)
index 0000000..b484aa8
--- /dev/null
@@ -0,0 +1,11 @@
+class CreateSpeachBalloons < ActiveRecord::Migration
+  def change
+    create_table :speach_balloons do |t|
+      t.string :name, :null => false
+      t.integer :tail_limit, :null => false, :default => 1
+      t.integer :border_limit, :null => false, :default => 1
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/migrate/20111211052544_add_author_id_on_artist.rb b/db/migrate/20111211052544_add_author_id_on_artist.rb
new file mode 100644 (file)
index 0000000..4df8c0c
--- /dev/null
@@ -0,0 +1,9 @@
+class AddAuthorIdOnArtist < ActiveRecord::Migration
+  def up
+    add_column :artists, :author_id, :integer
+  end
+
+  def down
+    remove_column :artists, :author_id
+  end
+end
diff --git a/db/migrate/20111213073529_create_common_lisences.rb b/db/migrate/20111213073529_create_common_lisences.rb
new file mode 100644 (file)
index 0000000..1f9efcb
--- /dev/null
@@ -0,0 +1,18 @@
+class CreateCommonLisences < ActiveRecord::Migration
+  def change
+    create_table :common_lisences do |t|
+      t.integer :lisence_id, :null => false
+      t.string :name, :null => false\r
+      t.string :url, :null => false\r
+      t.integer :cc_by, :null => false, :default => 0\r
+      t.integer :cc_sa, :null => false, :default => 0\r
+      t.integer :cc_nd, :null => false, :default => 0\r
+      t.integer :cc_nc, :null => false, :default => 0\r
+      t.integer :no_resize, :null => false, :default => 0\r
+      t.integer :no_flip, :null => false, :default => 0\r
+      t.integer :keep_aspect_ratio, :null => false, :default => 0\r
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644 (file)
index 0000000..17cce13
--- /dev/null
@@ -0,0 +1,253 @@
+# encoding: UTF-8\r
+# This file is auto-generated from the current state of the database. Instead\r
+# of editing this file, please use the migrations feature of Active Record to\r
+# incrementally modify your database, and then regenerate this schema definition.\r
+#\r
+# Note that this schema.rb definition is the authoritative source for your\r
+# database schema. If you need to create the application database on another\r
+# system, you should be using db:schema:load, not running all the migrations\r
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations\r
+# you'll amass, the slower it'll run and the greater likelihood for issues).\r
+#\r
+# It's strongly recommended to check this file into your version control system.\r
+\r
+ActiveRecord::Schema.define(:version => 20111213073529) do\r
+\r
+  create_table "admins", :force => true do |t|\r
+    t.string   "email",                                 :default => "", :null => false\r
+    t.string   "encrypted_password",     :limit => 128, :default => "", :null => false\r
+    t.string   "reset_password_token"\r
+    t.datetime "reset_password_sent_at"\r
+    t.datetime "remember_created_at"\r
+    t.integer  "sign_in_count",                         :default => 0\r
+    t.datetime "current_sign_in_at"\r
+    t.datetime "last_sign_in_at"\r
+    t.string   "current_sign_in_ip"\r
+    t.string   "last_sign_in_ip"\r
+    t.integer  "activate",                              :default => 0,  :null => false\r
+    t.datetime "created_at"\r
+    t.datetime "updated_at"\r
+  end\r
+\r
+  add_index "admins", ["email"], :name => "index_admins_on_email", :unique => true\r
+  add_index "admins", ["reset_password_token"], :name => "index_admins_on_reset_password_token", :unique => true\r
+\r
+  create_table "artists", :force => true do |t|\r
+    t.string   "email"\r
+    t.string   "name"\r
+    t.string   "homepage_url"\r
+    t.string   "api_url"\r
+    t.integer  "default_lisence_id"\r
+    t.datetime "crowled_at"\r
+    t.datetime "created_at"\r
+    t.datetime "updated_at"\r
+    t.integer  "author_id"\r
+  end\r
+\r
+  create_table "authors", :force => true do |t|\r
+    t.string   "name"\r
+    t.string   "email",                                 :default => "", :null => false\r
+    t.string   "encrypted_password",     :limit => 128, :default => "", :null => false\r
+    t.string   "reset_password_token"\r
+    t.datetime "reset_password_sent_at"\r
+    t.datetime "remember_created_at"\r
+    t.integer  "sign_in_count",                         :default => 0\r
+    t.datetime "current_sign_in_at"\r
+    t.datetime "last_sign_in_at"\r
+    t.string   "current_sign_in_ip"\r
+    t.string   "last_sign_in_ip"\r
+    t.string   "authentication_token"\r
+    t.string   "confirmation_token"\r
+    t.datetime "confirmed_at"\r
+    t.datetime "confirmation_sent_at"\r
+    t.datetime "created_at"\r
+    t.datetime "updated_at"\r
+  end\r
+\r
+  add_index "authors", ["authentication_token"], :name => "index_authors_on_authentication_token", :unique => true\r
+  add_index "authors", ["confirmation_token"], :name => "index_authors_on_confirmation_token", :unique => true\r
+  add_index "authors", ["email"], :name => "index_authors_on_email", :unique => true\r
+  add_index "authors", ["reset_password_token"], :name => "index_authors_on_reset_password_token", :unique => true\r
+\r
+  create_table "balloon_templates", :force => true do |t|\r
+    t.integer  "speach_balloon_id",                  :null =>&nb