From 4bf1c6b1cb0da452550edc0a7de55ce3adae3bb7 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Sun, 6 Jan 2013 11:24:02 +0900 Subject: [PATCH] t#30444:add site profile --- .gitignore | 1 + app/controllers/application_controller.rb | 4 ++-- app/views/layouts/guest.html.erb | 13 ------------- app/views/layouts/test.html.erb | 2 +- app/views/panels/new.html.erb | 1 + app/views/users/sessions/new.html.erb | 4 ++-- config/application.rb | 1 + config/profile.json.org | 8 ++++++++ 8 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 config/profile.json.org diff --git a/.gitignore b/.gitignore index e4e9cd8a..3ae87606 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ public/image/* config/aws.yaml config/picture_io.yml config/license.yml +config/profile.json config/test_layout lib/test/temp/ db/migrate/*_creative_commons_v??_licenses_attributes.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index eaca0dce..22ed9b29 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,11 +7,11 @@ class ApplicationController < ActionController::Base if devise_controller? case resource_name when :admin - 'test' + 'guest' when :user 'guest' when :demand_user - 'test' + 'guest' end else 'application' diff --git a/app/views/layouts/guest.html.erb b/app/views/layouts/guest.html.erb index 00fa4f30..4d76cf6b 100644 --- a/app/views/layouts/guest.html.erb +++ b/app/views/layouts/guest.html.erb @@ -8,19 +8,6 @@ -
- - - - - - -
-

PettanR

-
- -
-
<%= yield %>
<%= link_to t('tab.demander.title'), main_app.demanders_path %> diff --git a/app/views/layouts/test.html.erb b/app/views/layouts/test.html.erb index 034bb4e3..66fd1907 100644 --- a/app/views/layouts/test.html.erb +++ b/app/views/layouts/test.html.erb @@ -12,7 +12,7 @@
-

PettanR

+

<%= link_to MagicNumber['profile']['caption'], root_path %>

diff --git a/app/views/panels/new.html.erb b/app/views/panels/new.html.erb index fc4811c2..3867ef84 100644 --- a/app/views/panels/new.html.erb +++ b/app/views/panels/new.html.erb @@ -1,2 +1,3 @@

<%= t '.title' -%>

<%= render 'form' %> +

<%= link_to 'top', root_path %>

diff --git a/app/views/users/sessions/new.html.erb b/app/views/users/sessions/new.html.erb index 4323c6c2..d1471ec6 100644 --- a/app/views/users/sessions/new.html.erb +++ b/app/views/users/sessions/new.html.erb @@ -1,8 +1,8 @@ -

Hello PettanR World

+

<%= link_to MagicNumber['profile']['caption'], root_path %>

-

Site profile

+

<%= sanitize MagicNumber['profile']['description'], :tags => %w(a p img br) %>

<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> diff --git a/config/application.rb b/config/application.rb index 596df2c2..47691511 100644 --- a/config/application.rb +++ b/config/application.rb @@ -73,6 +73,7 @@ MagicNumber['test_layout'] = if File.exist? Rails.root + 'config/test_layout' else false end +MagicNumber['profile'] = JSON.parse(open(Rails.root + 'config/profile.json').read).first[1] #strip profile body y = YAML.load(open(Rails.root + 'config/picture_io.yml').read) require y[Rails.env]["adapter"] pio = PictureIO.const_get y[Rails.env]["io"] diff --git a/config/profile.json.org b/config/profile.json.org new file mode 100644 index 00000000..a84b2925 --- /dev/null +++ b/config/profile.json.org @@ -0,0 +1,8 @@ +{ + "admin@mail.address": { + "caption": "site name", + "url": "http://your.site.url/", + "description": "site description", + "demander_url": "http://your.site.url/demanders" + } +} -- 2.11.0