OSDN Git Service

t#30444:add site profile
authoryasushiito <yas@pen-chan.jp>
Sun, 6 Jan 2013 02:24:02 +0000 (11:24 +0900)
committeryasushiito <yas@pen-chan.jp>
Sun, 6 Jan 2013 02:24:02 +0000 (11:24 +0900)
.gitignore
app/controllers/application_controller.rb
app/views/layouts/guest.html.erb
app/views/layouts/test.html.erb
app/views/panels/new.html.erb
app/views/users/sessions/new.html.erb
config/application.rb
config/profile.json.org [new file with mode: 0644]

index e4e9cd8..3ae8760 100644 (file)
@@ -9,6 +9,7 @@ public/image/*
 config/aws.yaml
 config/picture_io.yml
 config/license.yml
 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
 config/test_layout
 lib/test/temp/
 db/migrate/*_creative_commons_v??_licenses_attributes.rb
index eaca0dc..22ed9b2 100644 (file)
@@ -7,11 +7,11 @@ class ApplicationController < ActionController::Base
     if devise_controller?
       case resource_name
       when :admin
     if devise_controller?
       case resource_name
       when :admin
-        'test'
+        'guest'
       when :user
         'guest'
       when :demand_user
       when :user
         'guest'
       when :demand_user
-        'test'
+        'guest'
       end
     else
       'application'
       end
     else
       'application'
index 00fa4f3..4d76cf6 100644 (file)
@@ -8,19 +8,6 @@
 </head>\r
 <body>\r
 \r
 </head>\r
 <body>\r
 \r
-<div width="100%">\r
-<table class="no-border">\r
-  <tr>\r
-    <td width="80%">\r
-      <h3>PettanR</h3>\r
-    </td>\r
-    <td>\r
-    </td>\r
-    <td>\r
-    </td>\r
-  </tr>\r
-</table>\r
-</div>\r
 <%= yield %>\r
 <div width="100%" style="background-color: #faddfa; padding: 5px;">\r
   <%= link_to t('tab.demander.title'), main_app.demanders_path %>\r
 <%= yield %>\r
 <div width="100%" style="background-color: #faddfa; padding: 5px;">\r
   <%= link_to t('tab.demander.title'), main_app.demanders_path %>\r
index 034bb4e..66fd190 100644 (file)
@@ -12,7 +12,7 @@
 <table class="no-border">\r
   <tr>\r
     <td width="80%">\r
 <table class="no-border">\r
   <tr>\r
     <td width="80%">\r
-      <h3>PettanR</h3>\r
+      <h3><%= link_to MagicNumber['profile']['caption'], root_path %></h3>\r
     </td>\r
     <td>\r
       <div>\r
     </td>\r
     <td>\r
       <div>\r
index fc4811c..3867ef8 100644 (file)
@@ -1,2 +1,3 @@
 <h1><%= t '.title' -%></h1>
 <%= render 'form' %>
 <h1><%= t '.title' -%></h1>
 <%= render 'form' %>
+<p><%= link_to 'top', root_path %></p>
index 4323c6c..d1471ec 100644 (file)
@@ -1,8 +1,8 @@
-<h1>Hello PettanR World </h1>
+<h1><%= link_to MagicNumber['profile']['caption'], root_path %></h1>
 <table class="no-border">
   <tr>
     <td width="60%">
 <table class="no-border">
   <tr>
     <td width="60%">
-      <h1>Site profile</h1>
+      <p><%= sanitize MagicNumber['profile']['description'], :tags => %w(a p img br) %></p>
     </td>
     <td width="40%">
       <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
     </td>
     <td width="40%">
       <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
index 596df2c..4769151 100644 (file)
@@ -73,6 +73,7 @@ MagicNumber['test_layout'] = if File.exist? Rails.root + 'config/test_layout'
 else
   false
 end
 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"]
 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 (file)
index 0000000..a84b292
--- /dev/null
@@ -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"
+  }
+}