Commit 648dd122 authored by 神楽坂玲奈's avatar 神楽坂玲奈

Settings没删 没启用

换肤泥煤啊..

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@53 189f022a-1064-8ae2-3e6f-c4a67275c50b
parent 051882e1
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :check_user
before_filter :check_actions
before_filter :set_language
before_filter :load_settings
before_filter :load_user
before_filter :load_locale
before_filter :load_theme
before_filter :check_actions #for debug
def check_actions
@actions = ["warning: no actions here"] unless @actions
end
def load_theme
#if cookices
#prepend_view_path(File.join(Rails.root, "app/themes/abitno"))
prepend_view_path("app/themes/lotus")
end
def check_user
def load_user
if session[:user_id]
@correct_user = User.find session[:user_id]
end
......@@ -21,21 +18,31 @@ class ApplicationController < ActionController::Base
@correct_user = User::Guest
end
end
def set_language
request_language = request.env['HTTP_ACCEPT_LANGUAGE']
request_language = request_language.nil? ? nil : request_language[/[^,;]+/]
# request_language
I18n.locale = request_language if request_language && File.exist?("#{RAILS_ROOT}/config/locales/#{request_language}.yml")
#p I18n.locale, "#{RAILS_ROOT}/config/locales/#{request_language}.yml"
#p I18n.load_path
def load_locale
p request.env['HTTP_ACCEPT_LANGUAGE']
#locale = @correct_user.locale || (
# request_language =
#request_language && request_language['HTTP_ACCEPT_LANGUAGE'][/[^,;]+/]
#)
#I18n.locale = locale if File.exist?("#{RAILS_ROOT}/config/locales/#{request_language}.yml")
User::Guest.name = t 'user.guest'
end
def load_theme
if !@correct_user.theme.blank?
theme_path = "app/themes/#{@correct_user.theme}"
prepend_view_path theme_path if File.directory? theme_path
elsif !@site.theme.blank?
theme_path = "app/themes/#{@site.theme}"
prepend_view_path theme_path if File.directory? theme_path
end
end
def load_settings
@site = {
:name => "Reliz"
:name => "Reliz",
:theme => nil
}
def @site.method_missing(method, *args)
self[method] || super
self[method]# || super
end
def @site.to_s
"<a href=\"/\">#{name}</a>".html_safe
......
......@@ -10,7 +10,9 @@ class Board < ActiveRecord::Base
def to_s
"<a href=\"/boards/#{id}\">#{name}</a>".html_safe
end
alias_method :logo_url, :logo
def logo_url
read_attribute(:logo)
end
def logo
"<a href=\"/boards/#{id}\"><img src=\"#{logo_url}\"/></a>".html_safe
end
......
......@@ -14,7 +14,15 @@ class User < ActiveRecord::Base
"<a href=\"/users/#{id}\">#{name}</a>".html_safe
end
def avatar(size=nil)
"<a href=\"/users/#{id}\"><img src=\"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.strip.downcase)}\" /></a>".html_safe
size = case size
when :small
48
when Integer
size
else
120
end
"<a href=\"/users/#{id}\"><img src=\"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.strip.downcase)}?size=#{size}\" /></a>".html_safe
end
=begin
t.string :name, :null => false
......
<div style="height:30px;">
</div>
<div id="body" class=" box ui-widget-content ui-corner-all ui-helper-clearfix">
<div id="b1">
</div>
<div class=" box ui-widget-content ui-corner-all ui-helper-clearfix">
<div id="fuzhu">
</div>
......@@ -19,15 +18,16 @@
</table>
</div>
<% @boards.each do |board| %>
<% @boards.each do |board| %>
<div id=b2_2>
<table width="100%" height="93px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="171px">
<div id=b2_2_d1>
<div id=b2_2_d1_avatar>
</div>
</div>
<%= board.logo %>
</td>
<td width: "686px">
<div id=b2_2_d2>
......
<div id="header">
<div id="h2" class="ui-dialog-titlebar ui-widget-header ui-corner-all">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="h2_t">
<tr>
<td width="900px" ;>
</td>
<td width="50px" ; style="color:#000000">
名字
</td>
<td width="50px" ; style="color:#000000">
空間
</td>
<td width="50px" ; style="color:#000000">
消息
</td>
<td width="50px" ; style="color:#000000">
設置
</td>
<td width="50px" ; style="color:#000000">
退出
</td>
<td width="50px" ; style="color:#000000">
</td>
</tr>
</table>
<style type="text/css">
#userbar{margin-left: 900px;}
</style>
<%= render 'layouts/userbar' %>
</div>
<div id="h3">
<div class="toggler">
......@@ -35,56 +16,32 @@
<div id="h4" class="ui-dialog-titlebar ui-widget-header ui-corner-all">
<table border="0" cellspacing="0" cellpadding="0" id="tb1">
<tr>
<td width="80" align="right">
論壇
</td>
<td width="80" align="right">
小屋
</td>
<td width="80" align="right">
搜索
</td>
<td width="80" align="right">
幫助
</td>
<td width="80" align="right">
導航
</td>
<td width="80" align="right">
插件
</td>
<td width="400" align="right">
&nbsp;
</td>
<td width="100">
<label>
<%= render "layouts/navibar" %>
<label style="align: right">
<input name="textfield" type="text" value="請輸入搜索內容 " />
</label>
</td>
<td width="80" align="center">
<input type="submit" name="Submit" value="搜索" />
</td>
<td width="80" align="center">
<input type="submit" name="Submit2" value="高級搜索" />
</td>
</tr>
</table>
</div>
<div id="h5">
<table border="0" cellspacing="0" cellpadding="0" id="tb2">
<% if logged? %>
<tr>
<td rowspan="2" width="80">
<div id="dtx">
頭像
<%= @correct_user.avatar :small %>
</div>
</td>
<td width="700" height="28" style="padding-left:5px">
歡迎回來XX
歡迎回來 <%= @correct_user %>
</td>
<td width="400" align="right" style="padding-right:10px">
歡迎新會員
歡迎新會員 <%= User.last %>
</td>
</tr>
<% end %>
<tr>
<td width="700" style="padding-left:5px">
公告:
......@@ -99,7 +56,7 @@
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="tb3">
<tr>
<td width="600" style="padding-left:15px">
東方幻想鄉->幻想鄉溫泉
<%= render 'layouts/actionbar' %>
</td>
<td width="600" align="right" style="padding-right:20px">
<select name="effects" id="effectTypes" style="visibility:hidden">
......
......@@ -17,7 +17,7 @@
<tbody id="board<%= board.id %>">
<tr>
<th>
<%= link_to image_tag(board.logo), board %>
<%= board.logo %>
<div class="left">
<h2><%= board %></h2>
......
<div id="actionbar">
<%= @site %>
<% @actions.each do |action| %>
&raquo; <%= action %>
<% end %>
</div>
\ No newline at end of file
<ul>
<li class="menu_1"><%=link_to t('navi.forum'), :root, :hidefocus => true, :id => :mn_index %></li>
</ul>
<!--<script type="text/javascript">
var currentMenu = $('mn_index') ? $('mn_index') : $('mn_index');
currentMenu.parentNode.className = 'current';
</script>-->
\ No newline at end of file
......@@ -8,24 +8,8 @@
<div id="topbar" name="TOP">
<div class="topanel">
<div id="memberp">
<% if logged? %>
<cite><a href="space.php?uid=359" class="noborder"><%= @correct_user %> </a></cite>
<span class="pipe">|</span>
<%= link_to t('user.my'), @correct_user %>
<%= link_to t('user.space'), @correct_user %>
<%= link_to t('user.notice'), @correct_user %>
<span id="myprompt_check"></span>
<%= link_to t('user.pm'), @correct_user %>
<span class="pipe">|</span>
<%= link_to t('user.logout'), logout_path %>
<% else %>
<%= link_to t('user.login'), login_path %>
<%= link_to t('user.register'), new_user_path %>
<% end %>
<%= render 'layouts/userbar' %>
</div>
<form method="post" id="searchform" action="search.php">
<div style="width:190px;float:left;">
<input type="hidden" name="formhash" value="eed723b8" />
......@@ -45,16 +29,7 @@
<div class="bg-dmenuleft"></div>
<div class="bg-dmenu" style="position: relative;">
<div id="menu">
<ul>
<li class="menu_1"><%=link_to t('navi.forum'), :root, :hidefocus => true, :id => :mn_index %></li>
</ul>
<script type="text/javascript">
var currentMenu = $('mn_index') ? $('mn_index') : $('mn_index');
currentMenu.parentNode.className = 'current';
</script>
<%= render "layouts/navibar" %>
</div>
<script type="text/javascript">
function setstyle(styleid) {
......@@ -78,8 +53,6 @@ location.href = 'index.php?' + str;
</div>
<div id="nav">
<%= @site %>
<% @actions.each do |action| %>
&raquo; <%= action %>
<% end %></div>
<%= render 'layouts/actionbar' %>
</div>
<div id="ad_text"></div>
\ No newline at end of file
<div id="userbar">
<% if logged? %>
<cite><a href="space.php?uid=359" class="noborder"><%= @correct_user %> </a></cite>
<span class="pipe">|</span>
<%= link_to t('user.my'), @correct_user %>
<%= link_to t('user.space'), @correct_user %>
<%= link_to t('user.notice'), @correct_user %>
<span id="myprompt_check"></span>
<%= link_to t('user.pm'), @correct_user %>
<span class="pipe">|</span>
<%= link_to t('user.logout'), logout_path %>
<% else %>
<%= link_to t('user.login'), login_path %>
<%= link_to t('user.register'), new_user_path %>
<% end %>
</div>
\ No newline at end of file
......@@ -19,6 +19,7 @@ zh-CN:
post: "帖子"
topic: "主题"
digest: "精华"
guest: "游客"
forum:
next: "下一页"
prev: "上一页"
......@@ -33,6 +34,8 @@ zh-CN:
topicperm: "主题权限"
postperm: "回帖权限"
submit: "提交"
topic: "主题"
post: "回复"
stat:
onlineuser: "在线人数"
total: "总计"
......
......@@ -22,6 +22,8 @@ class CreateUsers < ActiveRecord::Migration
t.integer :credit6, :default => 0, :null => false
t.integer :credit7, :default => 0, :null => false
t.integer :credit8, :default => 0, :null => false
t.string :locale
t.string :theme
t.timestamps
end
end
......
This source diff could not be displayed because it is too large. You can view the blob instead.
2360
\ No newline at end of file
880
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment