Commit 3025778d authored by 神楽坂玲奈's avatar 神楽坂玲奈

主题列表页初步

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@35 189f022a-1064-8ae2-3e6f-c4a67275c50b
parent eb0a54a4
......@@ -10,11 +10,14 @@ class ApplicationController < ActionController::Base
def check_user
@correct_user = User.find_by_name "admin"
end
def set_language
request_language = request.env['HTTP_ACCEPT_LANGUAGE']
request_language = request_language.nil? ? nil : request_language[/[^,;]+/]
I18n.locale = request_language if request_language && File.exist?("#{RAILS_ROOT}/config/locales/#{request_language}.yml")
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
end
def load_settings
@site = {
:name => "Reliz"
......
......@@ -43,8 +43,14 @@ class PostsController < ApplicationController
# POST /posts
# POST /posts.xml
def create
@post = Post.new(params[:post])
@post.topic = Topic.find params[:post][:topic_id]
if !@topic or @topic.locked
return
end
@post.user = @correct_user
@post.displayorder = @post.topic.floor
respond_to do |format|
......
......@@ -9,13 +9,6 @@ class TopicsController < ApplicationController
编辑主题: PUT /topic/1
主题管理:
删除:/topic/control?id=1&deleted=1
反删除:/topic/control?id=1&deleted=0
......@@ -145,7 +138,7 @@ class TopicsController < ApplicationController
data_control[key] = params[key] if params[key]
end
unless data_control.empty?
@topics = Topic.update_all(data_control, {:id => id})
@topics_size = Topic.update_all(data_control, {:id => id})
end
if params['merge']
#TODO
......@@ -153,5 +146,9 @@ class TopicsController < ApplicationController
if params['split']
#TODO
end
respond_to do |format|
format.html { redirect_to(:back, :notice => 'Topic was successfully updated.') }
format.xml { render :xml => @topics_size }
end
end
end
......@@ -6,11 +6,11 @@
<h1 style=""><% @board.name %></h1>
<p class="boardstats">[ <strong><%= @board.topics.size %></strong> 主题 / <%= @board.posts.size %> 帖子]</p>
<div class="boardaction">
<div class="right">
<!--<div class="right">
<a href="my.php?item=attention&amp;type=board&amp;action=add&amp;fid=68" id="ajax_attention" class="attention" onclick="ajaxmenu(this);doane(event);">关注</a>
<a href="my.php?item=favorites&amp;fid=68" id="ajax_favorite" onclick="ajaxmenu(this);doane(event);">收藏</a>
<a href="rss.php?fid=68&amp;auth=80baas4p%2BS%2FNnT%2BlQanrr%2Blzuk13j9xswULkRK6FhUrlnnrhZxiBsSc%2FwKk" target="_blank" class="feed">RSS</a></div>
<a href="rss.php?fid=68&amp;auth=80baas4p%2BS%2FNnT%2BlQanrr%2Blzuk13j9xswULkRK6FhUrlnnrhZxiBsSc%2FwKk" target="_blank" class="feed">RSS</a></div>-->
</div>
<p class="channelinfo"><%= @board.notice %></p><p id="modedby">
版主: *空缺中*</p>
......@@ -31,28 +31,21 @@
<table summary="board_68" cellspacing="0" cellpadding="0" class="datatable">
<thead class="colplural">
<tr>
<td colspan="2">&nbsp;<a href="javascript:;" id="filtertype" class="dropmenu" onclick="showMenu({'ctrlid':this.id});">类型</a></td>
<td colspan="2"></td>
<th>
<ul class="itemfilter s_clear">
<li><%= t 'topic' %>:</li>
<li class="current"><a href="boarddisplay.php?fid=68"><span>全部</span></a></li>
<li><a class="filter" href="boarddisplay.php?fid=68&amp;filter=digest"><span>精华</span></a></li>
<li class="pipe">|</li>
<li>时间:</li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=86400"><span>一天</span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=172800"><span>两天</span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=604800"><span></span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=2592000"><span></span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=7948800"><span></span></a></li>
<li class="pipe">|</li>
<li><a class="order " href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=heats">热门</a></li>
</ul>
</th>
<td class="author"><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=dateline" class="order ">作者/时间</a></td>
<td class="nums"><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=replies" class="order ">回复</a>&nbsp;<a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=views" class="order ">查看</a></td>
<td class="lastpost"><cite><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=lastpost" class="order order_active">最后发表</a></cite></td>
<td class="author"><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=dateline" class="order "><%= t 'topic.user_name' %>
<%= link_to(t('topic.created_at'), :order => 'creaded_at') %></a></td>
<td class="nums"><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=replies" class="order "><%= t 'topic.reply_num' %></a>&nbsp;
<a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=views" class="order "><%= t 'topic.view_num' %></a></td>
<td class="lastpost"><cite><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=lastpost" class="order order_active"><%= t 'topic.post_last' %></a></cite></td>
</tr>
</thead>
......
......@@ -38,5 +38,7 @@ module Reliz
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
config.i18n.default_locale = 'zh-CN'
end
end
......@@ -2,4 +2,4 @@
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"
hello: "Hello world"
\ No newline at end of file
# Chinese (China) translations for Ruby on Rails
# by tsechingho (http://github.com/tsechingho)
zh-CN:
topic:
order: "排序"
displayorder: "置顶"
digest: "精华"
user_name: "作者"
view_num: "查看数"
reply_num: "回复数"
post_last: "最后回复"
created_at: "发表时间"
updated_at: "回复时间"
date:
formats:
default: "%Y-%m-%d"
short: "%b%d日"
long: "%Y年%b%d日"
day_names: [星期日, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六]
abbr_day_names: [, , , , , , ]
month_names: [~, 一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月]
abbr_month_names: [~, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月]
order:
- :year
- :month
- :day
time:
formats:
default: "%Y年%b%d日 %A %H:%M:%S %Z"
short: "%b%d日 %H:%M"
long: "%Y年%b%d日 %H:%M"
am: "上午"
pm: "下午"
datetime:
distance_in_words:
half_a_minute: "半分钟"
less_than_x_seconds:
one: "不到一秒"
other: "不到 %{count} 秒"
x_seconds:
one: "一秒"
other: "%{count} 秒"
less_than_x_minutes:
one: "不到一分钟"
other: "不到 %{count} 分钟"
x_minutes:
one: "一分钟"
other: "%{count} 分钟"
about_x_hours:
one: "大约一小时"
other: "大约 %{count} 小时"
x_days:
one: "一天"
other: "%{count} 天"
about_x_months:
one: "大约一个月"
other: "大约 %{count} 个月"
x_months:
one: "一个月"
other: "%{count} 个月"
about_x_years:
one: "大约一年"
other: "大约 %{count} 年"
over_x_years:
one: "一年多"
other: "%{count} 年多"
almost_x_years:
one: "接近一年"
other: "接近 %{count} 年"
prompts:
year: "年"
month: "月"
day: "日"
hour: "时"
minute: "分"
second: "秒"
number:
format:
separator: "."
delimiter: ","
precision: 3
significant: false
strip_insignificant_zeros: false
currency:
format:
format: "%u %n"
unit: "CN¥"
separator: "."
delimiter: ","
precision: 2
significant: false
strip_insignificant_zeros: false
percentage:
format:
delimiter: ""
precision:
format:
delimiter: ""
human:
format:
delimiter: ""
precision: 1
significant: false
strip_insignificant_zeros: false
storage_units:
format: "%n %u"
units:
byte:
one: "Byte"
other: "Bytes"
kb: "KB"
mb: "MB"
gb: "GB"
tb: "TB"
decimal_units:
format: "%n %u"
units:
# 10^-21 zepto, 10^-24 yocto
atto: "渺" # 10^-18
femto: "飞" # 10^-15 毫微微
pico: "漠" # 10^-12 微微
nano: "奈" # 10^-9 毫微
micro: "微" # 10^-6
mili: "毫" # 10^-3 milli
centi: "厘" # 10^-2
deci: "分" # 10^-1
unit: ""
ten:
one: "十"
other: "十" # 10^1
hundred: "百" # 10^2
thousand: "千" # 10^3 kilo
million: "百万" # 10^6 mega
billion: "十亿" # 10^9 giga
trillion: "兆" # 10^12 tera
quadrillion: "千兆" # 10^15 peta
# 10^18 exa, 10^21 zetta, 10^24 yotta
support:
array:
words_connector: ", "
two_words_connector: " "
last_word_connector: ", "
select:
prompt: "请选择"
activerecord:
errors:
template: # ~ 2.3.5 backward compatible
header:
one: " 1 个错误发生导致「%{model}」无法被保存。"
other: " %{count} 个错误发生导致「%{model}」无法被保存。"
body: "如下字段出现错误:"
full_messages:
format: "%{attribute} %{message}"
messages:
inclusion: "不包含于列表中"
exclusion: "是保留关键字"
invalid: "是无效的"
confirmation: "与确认值不匹配"
accepted: "必须是可被接受的"
empty: "不能留空"
blank: "不能为空字符"
too_long: "过长(最长为 %{count} 个字符)"
too_short: "过短(最短为 %{count} 个字符)"
wrong_length: "长度非法(必须为 %{count} 个字符)"
not_a_number: "不是数字"
not_an_integer: "必须是整数"
greater_than: "必须大于 %{count}"
greater_than_or_equal_to: "必须大于或等于 %{count}"
equal_to: "必须等于 %{count}"
less_than: "必须小于 %{count}"
less_than_or_equal_to: "必须小于或等于 %{count}"
odd: "必须为单数"
even: "必须为双数"
taken: "已经被使用"
record_invalid: "校验失败: %{errors}"
activemodel:
errors:
template:
header:
one: " 1 个错误发生导致「%{model}」无法被保存。"
other: " %{count} 个错误发生导致「%{model}」无法被保存。"
body: "如下字段出现错误:"
errors:
format: "%{attribute} %{message}"
messages:
inclusion: "不包含于列表中"
exclusion: "是保留关键字"
invalid: "是无效的"
confirmation: "与确认值不匹配"
accepted: "必须是可被接受的"
empty: "不能留空"
blank: "不能为空字符"
too_long: "过长(最长为 %{count} 个字符)"
too_short: "过短(最短为 %{count} 个字符)"
wrong_length: "长度非法(必须为 %{count} 个字符)"
not_a_number: "不是数字"
not_an_integer: "必须是整数"
greater_than: "必须大于 %{count}"
greater_than_or_equal_to: "必须大于或等于 %{count}"
equal_to: "必须等于 %{count}"
less_than: "必须小于 %{count}"
less_than_or_equal_to: "必须小于或等于 %{count}"
odd: "必须为单数"
even: "必须为双数"
helpers:
select:
prompt: "请选择"
submit:
create: "新增%{model}"
update: "更新%{model}"
submit: "储存%{model}"
\ No newline at end of file
This diff is collapsed.
7788
\ No newline at end of file
3636
\ 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