Commit aab5b543 authored by 神楽坂玲奈's avatar 神楽坂玲奈

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@44 189f022a-1064-8ae2-3e6f-c4a67275c50b

parent 5cbef7cb
......@@ -39,23 +39,10 @@ class BoardsController < ApplicationController
# GET /boards/1/edit
def edit
@board = Board.find(params[:id])
@actions = [@board, :edit_board]
@page=1
@topics = @board.topics.all(:offset => 20*@page-20, :limit => 20, :order => [:displayorder, :id])
end
def edit #for test
@page = params[:page] && !params[:page].empty? ? params[:page].to_i : 1
@board = Board.find(params[:id])
@actions = [@board]
@topics = @board.topics.all(:offset => 20*@page-20, :limit => 20, :order => [:displayorder, :id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => params[:page] && !params[:page].empty? ? @topics : @board}
end
@actions = [@board, :edit]
end
# POST /boards
# POST /boards.xml
def create
......
......@@ -17,7 +17,7 @@ class UsersController < ApplicationController
# GET /users/1.xml
def show
@user = User.find(params[:id])
@actions = [@user.name]
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
......
......@@ -7,6 +7,7 @@ class User < ActiveRecord::Base
:length => {:minimum => 3, :maximum => 254},
:uniqueness => true,
:format => {:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i}
before_save proc{!locked}
def to_s
"<a href=\"/space/#{id}\">#{name}</a>".html_safe
end
......@@ -32,28 +33,5 @@ class User < ActiveRecord::Base
t.integer :credit7, :default => 0, :null => false
t.integer :credit8, :default => 0, :null => false
=end
Guest = self.new do |user|
user.id = 0
user.name = "Guest"
user.nickname = ""
user.password = ""
user.email = ""
#user.usergroup
#user.admingroup, :default => '', :null => false
user.regip = "127.0.0.1"
user.lastloginip = "127.0.0.1"
user.readnum = 0
user.viewnum = 0
user.onlinetime = 0
user.credit = 0
user.credit1 = 0
user.credit2 = 0
user.credit3 = 0
user.credit4 = 0
user.credit5 = 0
user.credit6 = 0
user.credit7 = 0
user.credit8 = 0
user.readonly!
end
Guest = User.find 0
end
#encoding: UTF-8
<div id="wrap" class="wrap s_clear">
<div class="main">
<div class="content">
<div id="boardheader" class="s_clear">
<h1 style=""><% @board.name %></h1>
<p class="boardstats">[ <strong><%= @board.topics.size %></strong> 主题 / <%= @board.posts.size %> 帖子]</p>
<div class="boardaction">
<!--<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>-->
</div>
<p class="channelinfo"><%= @board.notice %></p><p id="modedby">
版主: *空缺中*</p>
</div>
<div class="pages_btns s_clear">
<%= render 'layouts/pages', :count => @board.topics.count %>
<span id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})" class="pageback"><a href="index.php">返回首页</a></span>
<span class="postbtn" id="newspecial" prompt="post_newthread"><%= link_to t('topic.new'), new_topic_path %></span>
<span><%= link_to t('board.control'), edit_board_path(@board) %></span>
</div>
<div id="threadlist" class="threadlist datalist" style="position: relative;">
<form method="post" name="moderate" id="moderate" action="topicadmin.php?action=moderate&amp;fid=68&amp;infloat=yes&amp;nopost=yes">
<input type="hidden" name="formhash" value="eed723b8" />
<input type="hidden" name="listextra" value="page%3D1" />
<table summary="board_68" cellspacing="0" cellpadding="0" class="datatable">
<thead class="colplural">
<tr>
<td colspan="2"></td>
<th>
<ul class="itemfilter s_clear">
</ul>
</th>
<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>
<% @topics.each do |topic| %>
<tbody id="normalthread_<%= topic.id %>">
<tr>
<td class="folder">
<%= link_to image_tag(case
when topic.locked
"topic/locked.gif"
when topic.displayorder != 0
"topic/displayorder#{topic.displayorder}.gif"
else
"topic/new.gif"
end), topic, :target => :_blank %>
</td>
<td class="icon">
&nbsp;</td>
<th class="subject common">
<label>&nbsp;</label>
<span id="thread_<%= topic.id %>"><%= topic %></span>
<%= link_to(t('topic.control.delete'), control_topic_path(topic, :deleted => 1)) %>
<%= link_to(t('topic.control.digest'), control_topic_path(topic, :digest => 1)) %>
<%= link_to(t('topic.control.displayorder'), control_topic_path(topic, :displayorder => 1)) %>
<%= link_to(t('topic.control.lock'), control_topic_path(topic, :locked => 1)) %>
<%= link_to(t('topic.control.highlight'), control_topic_path(topic, :highlight => 0xFF0000)) %>
</th>
<td class="author">
<cite>
<%= topic.user %>
</cite>
<em><%=l topic.posts.last.updated_at, :format => :short %></em>
</td>
<td class="nums"><strong><%= topic.posts.size - 1 %></strong></td>
<td class="lastpost">
<cite><%= topic.posts.last.user %></cite>
<em><span title="<%= topic.posts.last.updated_at %>"><%= link_to (l topic.posts.last.updated_at, :format => :short), topic.posts.last %></span></a></em>
</td>
</tr>
</tbody>
<% end %></table>
</form>
</div>
<div class="pages_btns s_clear">
<%= render 'layouts/pages', :count => @board.topics.count %>
<span id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})" class="pageback"><a href="index.php">返回首页</a></span>
<span class="postbtn" id="newspecialtmp" ><%= link_to t('topic.new'), new_topic_path %></span>
</div>
<p id="notice"><%= notice %></p>
<%# fast newtopic %>
<%= form_tag :controller => :topics do %>
<p>
<%=t 'topic.title' %><%= text_field_tag "topic[name]" %>
</p>
<p>
<%= text_area_tag "post[content]" %>
</p>
<%= hidden_field_tag "topic[category_id]", @board.id%>
<%= hidden_field_tag "topic[category_type]", :board%>
<%= submit_tag t("topic.submit") %>
<% end %>
<dl id="onlinelist">
<dt>
<span class="headactions"><a href="boarddisplay.php?fid=68&amp;page=1&amp;showoldetails=yes#online" class="nobdr"><img src="images/default/collapsed_yes.gif" alt="" /></a></span>
<h3>正在浏览此版块的会员</h3>
</dt>
</dl>
</div>
</div>
<ul class="popupmenu_popup postmenu" id="newspecial_menu" style="display: none">
<li><a href="post.php?action=newthread&amp;fid=68" onclick="showWindow('newthread', this.href);doane(event)">发新话题</a></li><li class="poll"><a href="post.php?action=newthread&amp;fid=68&amp;special=1">发布投票</a></li><li class="reward"><a href="post.php?action=newthread&amp;fid=68&amp;special=3">发布悬赏</a></li><li class="debate"><a href="post.php?action=newthread&amp;fid=68&amp;special=5">发布辩论</a></li><li class="activity"><a href="post.php?action=newthread&amp;fid=68&amp;special=4">发布活动</a></li><li class="trade"><a href="post.php?action=newthread&amp;fid=68&amp;special=2">发布商品</a></li></ul>
<ul class="popupmenu_popup headermenu_popup filter_popup" id="filtertype_menu" style="display: none;">
<li><a href="boarddisplay.php?fid=68">全部</a></li>
<li ><a href="boarddisplay.php?fid=68&amp;filter=poll">投票</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=trade">商品</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=reward">悬赏</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=activity">活动</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=debate">辩论</a></li></ul>
<ul class="popupmenu_popup" id="visitedboards_menu" style="display: none">
<li><a href="boarddisplay.php?fid=2&amp;sid=6e1Kys">综合讨论</a></li><li><a href="boarddisplay.php?fid=23&amp;sid=6e1Kys">版主申请</a></li><li><a href="boarddisplay.php?fid=48&amp;sid=6e1Kys">文文最速新闻</a></li><li><a href="boarddisplay.php?fid=76&amp;sid=6e1Kys">幻想乡大温泉</a></li></ul>
<script type="text/javascript">document.onkeyup = function(e){keyPageScroll(e, 0, 1, 'boarddisplay.php?fid=68', 1);}</script>
<div id="ad_footerbanner1"></div><div id="ad_footerbanner2"></div><div id="ad_footerbanner3"></div>
<script>$('umenu').innerHTML = '<span id="myrepeats" onmouseover="showMenu(this.id)">[切换]</span>' + $('umenu').innerHTML;</script><ul id="myrepeats_menu" class="popupmenu_popup" style="display:none;"><li class="wide" style="clear:both"><a href="plugin.php?id=myrepeats:memcp">设置马甲</a></li></ul></div>
</div><ul class="popupmenu_popup headermenu_popup" id="plugin_menu" style="display: none"> <li><a id="mn_plugin_family_family" href="plugin.php?id=family:family">家族门派</a></li>
</ul>
<ul class="popupmenu_popup headermenu_popup" id="1nNcin_menu" style="display: none"><li><a href="plugin.php?id=moodwall" hidefocus="true" >心情墙壁</a></li><li><a href="plugin.php?id=dps_medalcenter" hidefocus="true" >勋章中心</a></li><li><a href="magic.php" hidefocus="true" >道具中心</a></li><li><a href="plugin.php?id=rs_sign:sign" hidefocus="true" >每日签到</a></li><li><a href="pet.php" hidefocus="true" >口袋东方</a></li><li><a href="plugin.php?id=promotion:promotion" hidefocus="true" >宣传中心</a></li><li><a href="bank.php" hidefocus="true" >社区银行</a></li><li><a href="plugin.php?id=family:family" hidefocus="true" >家族领地</a></li></ul>
\ No newline at end of file
<%= form_for(@board) do |f| %>
<% if @board.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@board.errors.count, "error") %> prohibited this board from being saved:</h2>
<ul>
<% @board.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label t 'board.name' %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label t 'board.introduction' %><br />
<%= f.text_area :introduction %>
</div>
<div class="field">
<%= f.label t 'board.notice' %><br />
<%= f.text_area :notice %>
</div>
<div class="field">
<%= f.label t 'board.logo' %><br />
<%= f.text_field :logo %>
</div>
<div class="field">
<%= f.label t 'board.banner' %><br />
<%= f.text_field :banner %>
</div>
<div class="field">
<%= f.label t 'board.readperm' %><br />
<%= f.text_field :readperm %>
</div>
<div class="field">
<%= f.label t 'board.topicperm' %><br />
<%= f.text_field :topicperm %>
</div>
<div class="field">
<%= f.label t 'board.postperm' %><br />
<%= f.text_field :postperm %>
</div>
<div class="actions">
<%= f.submit t 'board.submit' %>
</div>
<% end %>
......@@ -14,12 +14,21 @@ zh-CN:
password: "密码"
password_repeat: "重复密码"
email: "邮箱"
credit: "积分"
forum:
next: "下一页"
prev: "上一页"
board:
control: "管理面板"
name: "版块名称"
introduction: "版块简介"
notice: "版块公告"
logo: "板块图标"
banner: "板块顶图"
readperm: "阅读权限"
topicperm: "主题权限"
postperm: "回帖权限"
submit: "提交"
stat:
onlineuser: "在线人数"
total: "总计"
......
......@@ -27,7 +27,7 @@ Reliz::Application.routes.draw do
match 'forum/:forum_id/new' => 'topics#new', :forum_id => /\d+/ #
get 'topic/control' => 'topics#control'
match '(:something)/:anything/', :controller => 'application', :action => 'redirect_to_thc', :something => /forum|boards|topic|topics|posts/, :anything => /.*/
match '(:something)(/:id)/:anything/', :controller => 'application', :action => 'redirect_to_thc', :something => /forum|boards|topic|topics|posts|users/, :id => /\d+/, :anything => /.*/
......
......@@ -7,6 +7,7 @@ class CreateUsers < ActiveRecord::Migration
t.string :email, :default => '', :null => false
t.references :usergroup, :default => '', :null => false
t.references :admingroup, :default => '', :null => false
t.boolean :locked, :default => false, :null => false
t.string :regip, :default => '', :null => false
t.string :lastloginip, :default => '', :null => false
t.integer :readnum, :default => 0, :null => false
......
......@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20111036031158) do
ActiveRecord::Schema.define(:version => 20111036031159) do
create_table "boards", :force => true do |t|
t.string "name"
......@@ -79,8 +79,8 @@ ActiveRecord::Schema.define(:version => 20111036031158) do
t.integer "user_id", :null => false
t.integer "type_id"
t.integer "category_id", :null => false
t.string "category_type", :null => false
t.string "name", :null => false
t.string "category_type", :default => "", :null => false
t.string "name", :default => "", :null => false
t.integer "displayorder", :default => 0, :null => false
t.integer "highlight", :default => 0, :null => false
t.integer "views", :default => 0, :null => false
......@@ -94,26 +94,27 @@ ActiveRecord::Schema.define(:version => 20111036031158) do
end
create_table "users", :force => true do |t|
t.string "name", :null => false
t.string "nickname", :default => "", :null => false
t.string "password", :null => false
t.string "email", :default => "", :null => false
t.integer "usergroup_id", :default => 0, :null => false
t.integer "admingroup_id", :default => 0, :null => false
t.string "regip", :default => "", :null => false
t.string "lastloginip", :default => "", :null => false
t.integer "readnum", :default => 0, :null => false
t.integer "viewnum", :default => 0, :null => false
t.integer "onlinetime", :default => 0, :null => false
t.integer "credit", :default => 0, :null => false
t.integer "credit1", :default => 0, :null => false
t.integer "credit2", :default => 0, :null => false
t.integer "credit3", :default => 0, :null => false
t.integer "credit4", :default => 0, :null => false
t.integer "credit5", :default => 0, :null => false
t.integer "credit6", :default => 0, :null => false
t.integer "credit7", :default => 0, :null => false
t.integer "credit8", :default => 0, :null => false
t.string "name", :default => "", :null => false
t.string "nickname", :default => "", :null => false
t.string "password", :default => "", :null => false
t.string "email", :default => "", :null => false
t.integer "usergroup_id", :default => 0, :null => false
t.integer "admingroup_id", :default => 0, :null => false
t.boolean "locked", :default => false, :null => false
t.string "regip", :default => "", :null => false
t.string "lastloginip", :default => "", :null => false
t.integer "readnum", :default => 0, :null => false
t.integer "viewnum", :default => 0, :null => false
t.integer "onlinetime", :default => 0, :null => false
t.integer "credit", :default => 0, :null => false
t.integer "credit1", :default => 0, :null => false
t.integer "credit2", :default => 0, :null => false
t.integer "credit3", :default => 0, :null => false
t.integer "credit4", :default => 0, :null => false
t.integer "credit5", :default => 0, :null => false
t.integer "credit6", :default => 0, :null => false
t.integer "credit7", :default => 0, :null => false
t.integer "credit8", :default => 0, :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
......
This source diff could not be displayed because it is too large. You can view the blob instead.
cd /d %~dp0
rails s
\ No newline at end of file
2124
\ No newline at end of file
3604
\ 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