OSDN Git Service

redraw page title
[pettanr/pettanr.git] / app / views / layouts / application.html.erb
index 3b798c1..ffac6e3 100644 (file)
@@ -1,59 +1,78 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
-<html xmlns:v="urn:schemas-microsoft-com:vml">\r
-       <head>\r
-               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
-               <meta http-equiv="Content-Language" content="ja">\r
-               <meta http-equiv="Content-Script-Type" content="text/javascript">\r
-               <meta http-equiv="Content-Style-Type" content="text/css">\r
-               <meta http-equiv="imagetoolbar" content="no">\r
-               <title>Pettanr</title>\r
-               <%= stylesheet_link_tag "system.css" %>\r
-               <%= stylesheet_link_tag "peta.common.css" %>\r
-               <%= csrf_meta_tags %>\r
-       </head>\r
-       <body>\r
-               <div id="server-content" class="">\r
-                       <%= yield %>\r
-               </div>\r
-               <div id="esc-msg" style="border:1px red solid;padding:10px;margin:10px;cursor:pointer;">[ESC] キーを押すと Metro ホームに入るよ.ホームの一番最後のタイルをクリックすると このページに戻るよ.</div>\r
-               <div id="server-page-close-button" class="button" style="width:100px;margin:1em;">ホームへ</div>\r
-   <%= javascript_tag 'var server_result=' + @server_result.to_json + ';' %>\r
-               <%= javascript_include_tag "jquery-162min" %>\r
-               <%= javascript_include_tag "libs" %>\r
-               <%= javascript_include_tag "system" %>\r
+<!DOCTYPE html>\r
+<html lang="<%= I18n.locale -%>">\r
+<head>\r
+  <title>\r
+    <% if @page_title %>\r
+      <%= h @page_title %>\r
+    <% else %>\r
+      <%= t("#{params[:controller]}.#{params[:action]}.title") %>\r
+    <% end %>\r
+    - <%= h(manifest.magic_numbers['profile']['users']['caption']) %>\r
+  </title>\r
+  <%= stylesheet_link_tag "test" %>\r
+  <%= javascript_include_tag "application" %>\r
+  <%= csrf_meta_tags %>\r
+</head>\r
+<body>\r
 \r
-               <script type="text/javascript">\r
-                       <% if current_user %>\r
-                       current_author = {\r
-                               id: <%= @author ? @author.id : 0 %>,\r
-                               name: "<%= @author ? h(@author.name) : '' %>"\r
-                       };\r
-                       <% if @artist and @artist.id %>\r
-                       current_artist = {\r
-                               id: <%= @artist.id %>,\r
-                               name: "<%= h(@artist.name) %>"\r
-                       };\r
-                       <% end %>\r
-                       gOS.PageApplicationRef = null;\r
-                       gOS.PageApplicationClass = function(){\r
-                               var app = this;\r
-                               this.bgColor = '#FFF';\r
-                               this.onOpen = function(){\r
-                                       var button = document.getElementById( 'server-page-close-button' );\r
-                                       if( button ){\r
-                                               app.addEventListener( button, 'click', gOS.PageApplicationRef.shutdown );\r
-                                       };\r
-                                       var msg = document.getElementById( 'esc-msg' );\r
-                                       if( msg ){\r
-                                               app.addEventListener( msg, 'click', gOS.PageApplicationRef.shutdown );\r
-                                       };\r
-                                       app.addKeyEventListener( 'keydown', gOS.PageApplicationRef.shutdown, 27 ); // 27.esc\r
-                               };\r
-                       };\r
-                       <% end %>\r
-                </script>\r
-               <%= javascript_include_tag "peta-common" %>\r
-               <%= javascript_include_tag "peta-apps" %>\r
-               <%= javascript_include_tag "pongame" %>\r
-       </body>\r
+<div width="100%">\r
+<table class="no-border">\r
+  <tr>\r
+    <td width="50%">\r
+      <h3><%= link_to manifest.magic_numbers['profile']['users']['caption'], main_app.root_path %></h3>\r
+    </td>\r
+    <td width="30%">\r
+      <% if user_signed_in? %>\r
+        <%# link_to t('top.metro.title'), '/top/metro' %>\r
+      <% end %>\r
+    </td>\r
+    <td>\r
+      <div>\r
+        <% if @operators.author %>\r
+          <%= link_to h(truncate(@operators.author.name, :length => 12)), main_app.author_path(@operators.author) %>\r
+        <% end %>\r
+      </div>\r
+      <div>\r
+        <% if @operators.artist %>\r
+          <%= link_to h(truncate(@operators.artist.name, :length => 12)), main_app.artist_path(@operators.artist) %>\r
+        <% end %>\r
+      </div>\r
+    </td>\r
+    <td>\r
+      <% if user_signed_in? %>\r
+        <%= link_to t('home.configure.title'), '/home/configure' %>\r
+        <%= link_to t('home.sign_out.title'), main_app.destroy_user_session_path, :method => :delete %>\r
+      <% else %>\r
+        <%= link_to "sign in", main_app.new_user_session_path %>\r
+      <% end %>\r
+      <br>\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
+  <% if demand_user_signed_in? %>\r
+    <%= link_to t_m('Demander'), main_app.demanders_path %>\r
+    <%= link_to t('home.sign_out.title'), main_app.destroy_demand_user_session_path, :method => :delete %>\r
+  <% else %>\r
+    <%= link_to t('home.sign_in.title'), main_app.new_demand_user_session_path %>\r
+  <% end %>\r
+</div>\r
+<div width="100%" style="background-color: #ddddfa; padding: 5px;">\r
+  <%= link_to t('tab.system.title'), '/system' %>\r
+  <% if admin_signed_in? %>\r
+    <%= link_to t('tab.system.browse'), '/system/browse' %>\r
+    <%= link_to t('tab.system.approve'), '/system/waiting_list' %>\r
+    <%= link_to t('tab.system.port'), '/system/import' %>\r
+    <%= link_to t('tab.system.token'), '/system/auth_token' %>\r
+    <%= link_to t('home.sign_out.title'), main_app.destroy_admin_session_path, :method => :delete %>\r
+  <% else %>\r
+    <%= link_to t('home.sign_in.title'), main_app.new_admin_session_path %>\r
+  <% end %>\r
+</div>\r
+<%= javascript_tag 'var server_result=' + @server_result.to_json + ';' %>\r
+\r
+</body>\r
 </html>\r