Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Arena Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Ygopro Arena Web
Commits
36d7a8cf
Commit
36d7a8cf
authored
May 19, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件,发帖表单整理
parent
79f642db
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
625 additions
and
281 deletions
+625
-281
app/assets/javascripts/attachments.js.coffee
app/assets/javascripts/attachments.js.coffee
+3
-0
app/assets/javascripts/posts.js.coffee
app/assets/javascripts/posts.js.coffee
+5
-0
app/assets/stylesheets/attachments.css.scss
app/assets/stylesheets/attachments.css.scss
+3
-0
app/assets/stylesheets/markitup.css.scss
app/assets/stylesheets/markitup.css.scss
+2
-1
app/assets/stylesheets/posts.css.scss
app/assets/stylesheets/posts.css.scss
+5
-0
app/controllers/attachments_controller.rb
app/controllers/attachments_controller.rb
+83
-0
app/controllers/boards_controller.rb
app/controllers/boards_controller.rb
+7
-3
app/controllers/posts_controller.rb
app/controllers/posts_controller.rb
+3
-0
app/controllers/topics_controller.rb
app/controllers/topics_controller.rb
+10
-5
app/helpers/attachments_helper.rb
app/helpers/attachments_helper.rb
+2
-0
app/models/attachment.rb
app/models/attachment.rb
+4
-0
app/models/post.rb
app/models/post.rb
+2
-0
app/models/topic.rb
app/models/topic.rb
+1
-0
app/views/attachments/_form.html.erb
app/views/attachments/_form.html.erb
+37
-0
app/views/attachments/edit.html.erb
app/views/attachments/edit.html.erb
+6
-0
app/views/attachments/index.html.erb
app/views/attachments/index.html.erb
+31
-0
app/views/attachments/new.html.erb
app/views/attachments/new.html.erb
+5
-0
app/views/attachments/show.html.erb
app/views/attachments/show.html.erb
+30
-0
app/views/boards/show.html.erb
app/views/boards/show.html.erb
+153
-133
app/views/posts/_form.html.erb
app/views/posts/_form.html.erb
+40
-25
app/views/posts/_post.html.erb
app/views/posts/_post.html.erb
+13
-1
app/views/posts/edit.html.erb
app/views/posts/edit.html.erb
+4
-38
app/views/topics/show.html.erb
app/views/topics/show.html.erb
+67
-61
config/locales/zh-CN.yml
config/locales/zh-CN.yml
+2
-0
config/routes.rb
config/routes.rb
+2
-0
db/migrate/20120518234415_create_attachments.rb
db/migrate/20120518234415_create_attachments.rb
+13
-0
db/schema.rb
db/schema.rb
+17
-14
test/fixtures/attachments.yml
test/fixtures/attachments.yml
+15
-0
test/functional/attachments_controller_test.rb
test/functional/attachments_controller_test.rb
+49
-0
test/unit/attachment_test.rb
test/unit/attachment_test.rb
+7
-0
test/unit/helpers/attachments_helper_test.rb
test/unit/helpers/attachments_helper_test.rb
+4
-0
No files found.
app/assets/javascripts/attachments.js.coffee
0 → 100644
View file @
36d7a8cf
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
app/assets/javascripts/posts.js.coffee
0 → 100644
View file @
36d7a8cf
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
/
/=
require
jquery
.
markitup
//
=
require
jquery
.
markitup
.
set
\ No newline at end of file
app/assets/stylesheets/attachments.css.scss
0 → 100644
View file @
36d7a8cf
// Place all the styles related to the attachments controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
app/assets/stylesheets/markitup.css.scss
View file @
36d7a8cf
...
...
@@ -14,6 +14,7 @@
}
.markItUp
{
width
:
700px
;
height
:
201px
;
margin
:
5px
0
5px
0
;
padding
:
5px
;
box-shadow
:
0
0
5px
#8e8e8e
;
...
...
@@ -30,7 +31,7 @@
.markItUpEditor
{
font
:
12px
'Courier New'
,
Courier
,
monospace
;
border
:
0px
;
height
:
32
0px
;
height
:
16
0px
;
clear
:both
;
line-height
:
18px
;
overflow
:auto
;
...
...
app/assets/stylesheets/posts.css.scss
0 → 100644
View file @
36d7a8cf
// Place all the styles related to the cards controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
//= require markitup
//= require markitup.set
\ No newline at end of file
app/controllers/attachments_controller.rb
0 → 100644
View file @
36d7a8cf
class
AttachmentsController
<
ApplicationController
# GET /attachments
# GET /attachments.json
def
index
@attachments
=
Attachment
.
all
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
json
{
render
json:
@attachments
}
end
end
# GET /attachments/1
# GET /attachments/1.json
def
show
@attachment
=
Attachment
.
find
(
params
[
:id
])
respond_to
do
|
format
|
format
.
html
# show.html.erb
format
.
json
{
render
json:
@attachment
}
end
end
# GET /attachments/new
# GET /attachments/new.json
def
new
@attachment
=
Attachment
.
new
respond_to
do
|
format
|
format
.
html
# new.html.erb
format
.
json
{
render
json:
@attachment
}
end
end
# GET /attachments/1/edit
def
edit
@attachment
=
Attachment
.
find
(
params
[
:id
])
end
# POST /attachments
# POST /attachments.json
def
create
@attachment
=
Attachment
.
new
(
params
[
:attachment
])
respond_to
do
|
format
|
if
@attachment
.
save
format
.
html
{
redirect_to
@attachment
,
notice:
'Attachment was successfully created.'
}
format
.
json
{
render
json:
@attachment
,
status: :created
,
location:
@attachment
}
else
format
.
html
{
render
action:
"new"
}
format
.
json
{
render
json:
@attachment
.
errors
,
status: :unprocessable_entity
}
end
end
end
# PUT /attachments/1
# PUT /attachments/1.json
def
update
@attachment
=
Attachment
.
find
(
params
[
:id
])
respond_to
do
|
format
|
if
@attachment
.
update_attributes
(
params
[
:attachment
])
format
.
html
{
redirect_to
@attachment
,
notice:
'Attachment was successfully updated.'
}
format
.
json
{
head
:no_content
}
else
format
.
html
{
render
action:
"edit"
}
format
.
json
{
render
json:
@attachment
.
errors
,
status: :unprocessable_entity
}
end
end
end
# DELETE /attachments/1
# DELETE /attachments/1.json
def
destroy
@attachment
=
Attachment
.
find
(
params
[
:id
])
@attachment
.
destroy
respond_to
do
|
format
|
format
.
html
{
redirect_to
attachments_url
}
format
.
json
{
head
:no_content
}
end
end
end
app/controllers/boards_controller.rb
View file @
36d7a8cf
class
BoardsController
<
ApplicationController
#ApplicationHelper::addon_header.push "zh_header"
#ApplicationHelper::addon_top.push "zh_top"
#ApplicationHelper::addon_footer.push "zh_footer"
# GET /boards
# GET /boards.xml
def
index
...
...
@@ -21,7 +18,14 @@ class BoardsController < ApplicationController
@actions
=
[{
Board
.
human_attribute_name
(
:index
)
=>
boards_path
},
@board
]
@actions
=
[
@board
]
order
=
params
[
:order
].
blank?
?
'displayorder DESC, id DESC'
:
params
[
:order
]
@topics
=
@board
.
topics
.
page
(
params
[
:page
]).
order
(
order
)
@topic
=
Topic
.
new
#快速发帖
@topic
.
category_id
=
@board
.
id
@topic
.
category_type
=
:board
@topic
.
posts
.
build
.
attachments
.
build
respond_to
do
|
format
|
format
.
html
# show.html.erb
format
.
xml
{
render
:xml
=>
params
[
:page
]
&&
!
params
[
:page
].
empty?
?
@topics
:
@board
}
...
...
app/controllers/posts_controller.rb
View file @
36d7a8cf
...
...
@@ -32,6 +32,8 @@ class PostsController < ApplicationController
return
render
:text
=>
"Topic not found or locked."
end
@post
=
Post
.
new
@post
.
attachments
.
build
@post
.
attachments
.
build
@actions
=
[
@topic
,
:reply
]
respond_to
do
|
format
|
format
.
html
# new.html.erb
...
...
@@ -42,6 +44,7 @@ class PostsController < ApplicationController
# GET /posts/1/edit
def
edit
@post
=
Post
.
find
(
params
[
:id
])
@post
.
attachments
.
build
@actions
=
[
@post
,
:edit
]
end
...
...
app/controllers/topics_controller.rb
View file @
36d7a8cf
...
...
@@ -51,6 +51,9 @@ class TopicsController < ApplicationController
@topic
.
update_attribute
(
:viewnum
,
@topic
.
viewnum
+
1
)
@current_user
.
update_attribute
(
:viewnum
,
@current_user
.
viewnum
+
1
)
@post
=
Post
.
new
(
topic:
@topic
)
@post
.
attachments
.
build
respond_to
do
|
format
|
format
.
html
# show.html.erb
format
.
xml
{
render
:xml
=>
params
[
:page
]
&&
!
params
[
:page
].
empty?
?
@posts
:
@topic
}
...
...
@@ -87,13 +90,15 @@ class TopicsController < ApplicationController
@topic
.
user
=
@current_user
@topic
.
displayorder
=
0
@post
=
Post
.
new
(
params
[
:post
])
@post
.
displayorder
=
1
@post
.
topic
=
@topic
@post
.
user
=
@current_user
@topic
.
posts
.
first
.
displayorder
=
1
@topic
.
posts
.
first
.
user
=
@current_user
#@post = Post.new(params[:post])
#@post.displayorder = 1
#@post.topic = @topic
#@post.user = @current_user
respond_to
do
|
format
|
if
@topic
.
save
&&
@post
.
save
if
@topic
.
save
format
.
html
{
redirect_to
(
@topic
,
:notice
=>
'Topic was successfully created.'
)
}
format
.
xml
{
render
:xml
=>
@topic
,
:status
=>
:created
,
:location
=>
@topic
}
else
...
...
app/helpers/attachments_helper.rb
0 → 100644
View file @
36d7a8cf
module
AttachmentsHelper
end
app/models/attachment.rb
0 → 100644
View file @
36d7a8cf
class
Attachment
<
ActiveRecord
::
Base
belongs_to
:post
has_attached_file
:data
end
app/models/post.rb
View file @
36d7a8cf
...
...
@@ -2,6 +2,8 @@ class Post < ActiveRecord::Base
belongs_to
:topic
belongs_to
:user
has_many
:comments
has_many
:attachments
accepts_nested_attributes_for
:attachments
def
user
super
||
User
::
Guest
end
...
...
app/models/topic.rb
View file @
36d7a8cf
...
...
@@ -3,6 +3,7 @@ class Topic < ActiveRecord::Base
#belongs_to :type
belongs_to
:board
,
:foreign_key
=>
:category_id
has_many
:posts
accepts_nested_attributes_for
:posts
default_scope
where
(
:deleted
=>
false
)
self
.
per_page
=
20
...
...
app/views/attachments/_form.html.erb
0 → 100644
View file @
36d7a8cf
<%=
form_for
(
@attachment
)
do
|
f
|
%>
<%
if
@attachment
.
errors
.
any?
%>
<div
id=
"error_explanation"
>
<h2>
<%=
pluralize
(
@attachment
.
errors
.
count
,
"error"
)
%>
prohibited this attachment from being saved:
</h2>
<ul>
<%
@attachment
.
errors
.
full_messages
.
each
do
|
msg
|
%>
<li>
<%=
msg
%>
</li>
<%
end
%>
</ul>
</div>
<%
end
%>
<div
class=
"field"
>
<%=
f
.
label
:data_file_name
%>
<br
/>
<%=
f
.
text_field
:data_file_name
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
:data_content_type
%>
<br
/>
<%=
f
.
text_field
:data_content_type
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
:data_file_size
%>
<br
/>
<%=
f
.
number_field
:data_file_size
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
:data_updated_at
%>
<br
/>
<%=
f
.
datetime_select
:data_updated_at
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
:post_id
%>
<br
/>
<%=
f
.
number_field
:post_id
%>
</div>
<div
class=
"actions"
>
<%=
f
.
submit
%>
</div>
<%
end
%>
app/views/attachments/edit.html.erb
0 → 100644
View file @
36d7a8cf
<h1>
Editing attachment
</h1>
<%=
render
'form'
%>
<%=
link_to
'Show'
,
@attachment
%>
|
<%=
link_to
'Back'
,
attachments_path
%>
app/views/attachments/index.html.erb
0 → 100644
View file @
36d7a8cf
<h1>
Listing attachments
</h1>
<table>
<tr>
<th>
Data file name
</th>
<th>
Data content type
</th>
<th>
Data file size
</th>
<th>
Data updated at
</th>
<th>
Post
</th>
<th></th>
<th></th>
<th></th>
</tr>
<%
@attachments
.
each
do
|
attachment
|
%>
<tr>
<td>
<%=
attachment
.
data_file_name
%>
</td>
<td>
<%=
attachment
.
data_content_type
%>
</td>
<td>
<%=
attachment
.
data_file_size
%>
</td>
<td>
<%=
attachment
.
data_updated_at
%>
</td>
<td>
<%=
attachment
.
post_id
%>
</td>
<td>
<%=
link_to
'Show'
,
attachment
%>
</td>
<td>
<%=
link_to
'Edit'
,
edit_attachment_path
(
attachment
)
%>
</td>
<td>
<%=
link_to
'Destroy'
,
attachment
,
confirm:
'Are you sure?'
,
method: :delete
%>
</td>
</tr>
<%
end
%>
</table>
<br
/>
<%=
link_to
'New Attachment'
,
new_attachment_path
%>
app/views/attachments/new.html.erb
0 → 100644
View file @
36d7a8cf
<h1>
New attachment
</h1>
<%=
render
'form'
%>
<%=
link_to
'Back'
,
attachments_path
%>
app/views/attachments/show.html.erb
0 → 100644
View file @
36d7a8cf
<p
id=
"notice"
>
<%=
notice
%>
</p>
<p>
<b>
Data file name:
</b>
<%=
@attachment
.
data_file_name
%>
</p>
<p>
<b>
Data content type:
</b>
<%=
@attachment
.
data_content_type
%>
</p>
<p>
<b>
Data file size:
</b>
<%=
@attachment
.
data_file_size
%>
</p>
<p>
<b>
Data updated at:
</b>
<%=
@attachment
.
data_updated_at
%>
</p>
<p>
<b>
Post:
</b>
<%=
@attachment
.
post_id
%>
</p>
<%=
link_to
'Edit'
,
edit_attachment_path
(
@attachment
)
%>
|
<%=
link_to
'Back'
,
attachments_path
%>
app/views/boards/show.html.erb
View file @
36d7a8cf
<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>
<p
class=
"channelinfo"
>
<%=
@board
.
notice
%>
</p><p
id=
"modedby"
>
版主:
<%=
render
@board
.
moderators
%>
</p>
</div>
<%=
image_tag
@board
.
banner
%>
<div
class=
"pages_btns s_clear"
>
<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
(
:board_id
=>
@board
.
id
)
%>
</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&fid=68&infloat=yes&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&filter=&orderby=dateline"
class=
"order "
>
<%=
t
'topic.user_name'
%>
<%=
link_to
(
t
(
'topic.created_at'
),
:order
=>
'created_at%20DESC'
.
html_safe
)
%>
</a></td>
<td
class=
"nums"
><a
href=
"boarddisplay.php?fid=68&filter=&orderby=replies"
class=
"order "
>
<%=
t
'topic.reply_num'
%>
</a>
<a
href=
"boarddisplay.php?fid=68&filter=&orderby=views"
class=
"order "
>
<%=
t
'topic.view_num'
%>
</a></td>
<td
class=
"lastpost"
><cite><a
href=
"boarddisplay.php?fid=68&filter=&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"
>
</td>
<th
class=
"subject common"
>
<label>
</label>
<span
id=
"thread_
<%=
topic
.
id
%>
"
>
<%=
topic
%>
</span>
<%=
link_to
(
t
(
'topic.control.delete'
),
control_topics_path
(
topic
,
:deleted
=>
1
))
if
@current_user
.
role
.
topic_delete
%>
<%=
link_to
(
t
(
'topic.control.digest'
),
control_topics_path
(
topic
,
:digest
=>
1
))
if
@current_user
.
role
.
topic_digest
>
0
%>
<%=
link_to
(
t
(
'topic.control.displayorder'
),
control_topics_path
(
topic
,
:displayorder
=>
1
))
if
@current_user
.
role
.
topic_displayorder
>
0
%>
<%=
link_to
(
t
(
'topic.control.lock'
),
control_topics_path
(
topic
,
:locked
=>
1
))
if
@current_user
.
role
.
topic_lock
%>
<%=
link_to
(
t
(
'topic.control.highlight'
),
control_topics_path
(
topic
,
:highlight
=>
0xFF0000
))
if
@current_user
.
role
.
topic_highlight
%>
</th>
<td
class=
"author"
>
<cite>
<%=
topic
.
user
%>
</cite>
<em>
<%=
l
topic
.
created_at
,
:format
=>
:short
%>
</em>
</td>
<td
class=
"nums"
><strong>
<%=
topic
.
posts
.
size
-
1
%>
</strong>
/
<em>
<%=
topic
.
viewnum
%>
</em></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"
>
<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
(
:board_id
=>
@board
.
id
)
%>
</span>
<%=
will_paginate
@topics
%>
</div>
<p
id=
"notice"
>
<%=
notice
%>
</p>
<!--快速发帖-->
<%=
form_tag
:controller
=>
:topics
do
%>
<div
class=
"field"
id=
"topic_name_field"
>
<%=
t
'topic.title'
%><%=
text_field_tag
"topic[name]"
%>
</div>
<%=
render
'topics/editor_lite'
%>
<%=
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&page=1&showoldetails=yes#online"
class=
"nobdr"
>
<%=
image_tag
'common/collapsed_yes.gif'
%>
<h3>
正在浏览此版块的会员
</h3>
</dt>
</dl>
</div>
</div>
<ul
class=
"popupmenu_popup postmenu"
id=
"newspecial_menu"
style=
"display: none"
>
<li><a
href=
"post.php?action=newthread&fid=68"
onclick=
"showWindow('newthread', this.href);doane(event)"
>
发新话题
</a></li><li
class=
"poll"
><a
href=
"post.php?action=newthread&fid=68&special=1"
>
发布投票
</a></li><li
class=
"reward"
><a
href=
"post.php?action=newthread&fid=68&special=3"
>
发布悬赏
</a></li><li
class=
"debate"
><a
href=
"post.php?action=newthread&fid=68&special=5"
>
发布辩论
</a></li><li
class=
"activity"
><a
href=
"post.php?action=newthread&fid=68&special=4"
>
发布活动
</a></li><li
class=
"trade"
><a
href=
"post.php?action=newthread&fid=68&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&filter=poll"
>
投票
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=trade"
>
商品
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=reward"
>
悬赏
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=activity"
>
活动
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=debate"
>
辩论
</a></li></ul>
<ul
class=
"popupmenu_popup"
id=
"visitedboards_menu"
style=
"display: none"
>
<li><a
href=
"boarddisplay.php?fid=2&sid=6e1Kys"
>
综合讨论
</a></li><li><a
href=
"boarddisplay.php?fid=23&sid=6e1Kys"
>
版主申请
</a></li><li><a
href=
"boarddisplay.php?fid=48&sid=6e1Kys"
>
文文最速新闻
</a></li><li><a
href=
"boarddisplay.php?fid=76&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>
<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>
<p
class=
"channelinfo"
>
<%=
@board
.
notice
%>
</p><p
id=
"modedby"
>
版主:
<%=
render
@board
.
moderators
%>
</p>
</div>
<%=
image_tag
@board
.
banner
%>
<div
class=
"pages_btns s_clear"
>
<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
(
:board_id
=>
@board
.
id
)
%>
</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&fid=68&infloat=yes&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&filter=&orderby=dateline"
class=
"order "
>
<%=
t
'topic.user_name'
%>
<%=
link_to
(
t
(
'topic.created_at'
),
:order
=>
'created_at%20DESC'
.
html_safe
)
%>
</a></td>
<td
class=
"nums"
><a
href=
"boarddisplay.php?fid=68&filter=&orderby=replies"
class=
"order "
>
<%=
t
'topic.reply_num'
%>
</a>
<a
href=
"boarddisplay.php?fid=68&filter=&orderby=views"
class=
"order "
>
<%=
t
'topic.view_num'
%>
</a></td>
<td
class=
"lastpost"
><cite><a
href=
"boarddisplay.php?fid=68&filter=&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"
>
</td>
<th
class=
"subject common"
>
<label>
</label>
<span
id=
"thread_
<%=
topic
.
id
%>
"
>
<%=
topic
%>
</span>
<%=
link_to
(
t
(
'topic.control.delete'
),
control_topics_path
(
topic
,
:deleted
=>
1
))
if
@current_user
.
role
.
topic_delete
%>
<%=
link_to
(
t
(
'topic.control.digest'
),
control_topics_path
(
topic
,
:digest
=>
1
))
if
@current_user
.
role
.
topic_digest
>
0
%>
<%=
link_to
(
t
(
'topic.control.displayorder'
),
control_topics_path
(
topic
,
:displayorder
=>
1
))
if
@current_user
.
role
.
topic_displayorder
>
0
%>
<%=
link_to
(
t
(
'topic.control.lock'
),
control_topics_path
(
topic
,
:locked
=>
1
))
if
@current_user
.
role
.
topic_lock
%>
<%=
link_to
(
t
(
'topic.control.highlight'
),
control_topics_path
(
topic
,
:highlight
=>
0xFF0000
))
if
@current_user
.
role
.
topic_highlight
%>
</th>
<td
class=
"author"
>
<cite>
<%=
topic
.
user
%>
</cite>
<em>
<%=
l
topic
.
created_at
,
:format
=>
:short
%>
</em>
</td>
<td
class=
"nums"
><strong>
<%=
topic
.
posts
.
size
-
1
%>
</strong>
/
<em>
<%=
topic
.
viewnum
%>
</em></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"
>
<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
(
:board_id
=>
@board
.
id
)
%>
</span>
<%=
will_paginate
@topics
%>
</div>
<p
id=
"notice"
>
<%=
notice
%>
</p>
<!--快速发帖-->
<%=
form_for
(
@topic
,
:html
=>
{
:multipart
=>
true
})
do
|
f
|
%>
<div
class=
"field"
id=
"topic_name_field"
>
<%=
f
.
label
"name"
%>
<%=
f
.
text_field
:name
%>
</div>
<div
class=
"field"
>
<%=
f
.
fields_for
:posts
do
|
post_fields
|
%>
<%=
post_fields
.
text_area
:content
,
:id
=>
:fastpostmessage
%>
<div
class=
"field"
>
<%=
post_fields
.
label
:attachments
%>
<%=
post_fields
.
fields_for
:attachments
do
|
attachment_form
|
%>
<div
class=
"field"
style=
"display:inline"
>
<%=
attachment_form
.
file_field
:data
%>
</div>
<%
end
%>
</div>
<%
end
%>
</div>
<%=
f
.
hidden_field
:category_id
%>
<%=
f
.
hidden_field
:category_type
%>
<div
class=
"actions"
>
<%=
f
.
submit
%>
</div>
<%
end
%>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#fastpostmessage
'
).
markItUp
(
mySettings
);
});
</script>
<dl
id=
"onlinelist"
>
<dt>
<span
class=
"headactions"
><a
href=
"boarddisplay.php?fid=68&page=1&showoldetails=yes#online"
class=
"nobdr"
>
<%=
image_tag
'common/collapsed_yes.gif'
%>
<h3>
正在浏览此版块的会员
</h3>
</dt>
</dl>
</div>
</div>
<ul
class=
"popupmenu_popup postmenu"
id=
"newspecial_menu"
style=
"display: none"
>
<li><a
href=
"post.php?action=newthread&fid=68"
onclick=
"showWindow('newthread', this.href);doane(event)"
>
发新话题
</a></li><li
class=
"poll"
><a
href=
"post.php?action=newthread&fid=68&special=1"
>
发布投票
</a></li><li
class=
"reward"
><a
href=
"post.php?action=newthread&fid=68&special=3"
>
发布悬赏
</a></li><li
class=
"debate"
><a
href=
"post.php?action=newthread&fid=68&special=5"
>
发布辩论
</a></li><li
class=
"activity"
><a
href=
"post.php?action=newthread&fid=68&special=4"
>
发布活动
</a></li><li
class=
"trade"
><a
href=
"post.php?action=newthread&fid=68&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&filter=poll"
>
投票
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=trade"
>
商品
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=reward"
>
悬赏
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=activity"
>
活动
</a></li><li
><a
href=
"boarddisplay.php?fid=68&filter=debate"
>
辩论
</a></li></ul>
<ul
class=
"popupmenu_popup"
id=
"visitedboards_menu"
style=
"display: none"
>
<li><a
href=
"boarddisplay.php?fid=2&sid=6e1Kys"
>
综合讨论
</a></li><li><a
href=
"boarddisplay.php?fid=23&sid=6e1Kys"
>
版主申请
</a></li><li><a
href=
"boarddisplay.php?fid=48&sid=6e1Kys"
>
文文最速新闻
</a></li><li><a
href=
"boarddisplay.php?fid=76&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>
app/views/posts/_form.html.erb
View file @
36d7a8cf
<%=
form_for
(
@post
)
do
|
f
|
%>
<%=
form_for
(
@post
,
:html
=>
{
:multipart
=>
true
}
)
do
|
f
|
%>
<%
if
@post
.
errors
.
any?
%>
<div
id=
"error_explanation"
>
<h2>
<%=
pluralize
(
@post
.
errors
.
count
,
"error"
)
%>
prohibited this post from being saved:
</h2>
<ul>
<%
@post
.
errors
.
full_messages
.
each
do
|
msg
|
%>
<li>
<%=
msg
%>
</li>
<%
end
%>
<%
@post
.
errors
.
full_messages
.
each
do
|
msg
|
%>
<li>
<%=
msg
%>
</li>
<%
end
%>
</ul>
</div>
<%
end
%>
<div
class=
"field"
>
<%=
f
.
label
:topic
%>
<br
/>
<%=
f
.
text_field
:topic
%>
<
!--<
div class="field">
<%=
f
.
label
:topic
%>
<br />
<%=
f
.
text_field
:topic
%>
</div>
<div class="field">
<%=
f
.
label
:user
%>
<br
/>
<%=
f
.
text_field
:user
%>
</div>
<%=
f
.
label
:user
%>
<br />
<%=
f
.
text_field
:user
%>
</div>
-->
<div
class=
"field"
>
<%=
f
.
label
:content
%>
<br
/>
<%=
f
.
text_area
:content
%>
<%=
f
.
text_area
:content
,
:id
=>
:fastpostmessage
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
:displayorder
%>
<br
/>
<%=
f
.
text_field
:displayorder
%>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#fastpostmessage
'
).
markItUp
(
mySettings
);
});
</script>
<!--<div class="field">
<%=
f
.
label
:displayorder
%>
<br />
<%=
f
.
text_field
:displayorder
%>
</div>
<div class="field">
<%=
f
.
label
:readperm
%>
<br
/>
<%=
f
.
text_field
:readperm
%>
<%=
f
.
label
:readperm
%>
<br />
<%=
f
.
text_field
:readperm
%>
</div>
<div class="field">
<%=
f
.
label
:private
%>
<br
/>
<%=
f
.
check_box
:private
%>
<%=
f
.
label
:private
%>
<br />
<%=
f
.
check_box
:private
%>
</div>
<div class="field">
<%=
f
.
label
:anonymous
%>
<br
/>
<%=
f
.
check_box
:anonymous
%>
<%=
f
.
label
:anonymous
%>
<br />
<%=
f
.
check_box
:anonymous
%>
</div>
<div class="field">
<%=
f
.
label
:ubb
%>
<br
/>
<%=
f
.
check_box
:ubb
%>
<%=
f
.
label
:ubb
%>
<br />
<%=
f
.
check_box
:ubb
%>
</div>
<div class="field">
<%=
f
.
label
:html
%>
<br
/>
<%=
f
.
check_box
:html
%>
</div>
<%=
f
.
label
:html
%>
<br />
<%=
f
.
check_box
:html
%>
</div>-->
<%=
f
.
label
"附件"
%>
<br
/>
<%=
f
.
fields_for
:attachments
do
|
attachment_form
|
%>
<div
class=
"asset field"
>
<%
if
attachment_form
.
object
.
data
.
exists?
%>
<%=
attachment_form
.
object
.
data
.
original_filename
%>
<%
else
%>
<%=
attachment_form
.
file_field
:data
%>
<%
end
%>
</div>
<%
end
%>
<div
class=
"actions"
>
<%=
f
.
submit
%>
</div>
...
...
app/views/posts/_post.html.erb
View file @
36d7a8cf
...
...
@@ -52,7 +52,19 @@
<div
class=
"t_msgfontfix"
>
<table
cellspacing=
"0"
cellpadding=
"0"
><tbody><tr><td
class=
"t_msgfont"
id=
"postmessage_751931"
>
<%=
post
.
content
.
bbcode_to_html
.
html_safe
%>
</td></tr></tbody></table>
</div>
<%
if
!
post
.
attachments
.
empty?
%>
<p>
<b>
<%=
post
.
attachments
.
size
%>
个附件:
</b>
<ul>
<%
post
.
attachments
.
each
do
|
attachment
|
%>
<li>
<%=
link_to
attachment
.
data
.
original_filename
,
attachment
.
data
.
url
%>
</li>
<%
if
attachment
.
data
.
content_type
[
0
,
5
]
==
"image"
%>
<%=
image_tag
attachment
.
data
.
url
%>
<%
end
%>
<%
end
%>
</ul>
</p>
<%
end
%>
<div
id=
"post_rate_div_751931"
></div>
</div>
...
...
app/views/posts/edit.html.erb
View file @
36d7a8cf
<%=
form_for
(
@post
)
do
|
f
|
%>
<%
if
@post
.
errors
.
any?
%>
<div
id=
"error_explanation"
>
<h2>
<%=
pluralize
(
@post
.
errors
.
count
,
"error"
)
%>
prohibited this post from being saved:
</h2>
<h1>
Editing post
</h1>
<ul>
<%
@post
.
errors
.
full_messages
.
each
do
|
msg
|
%>
<li>
<%=
msg
%>
</li>
<%
end
%>
</ul>
</div>
<%
end
%>
<%=
render
'form'
%>
<!--<div class="field">
<%=
f
.
label
:topic
%>
<br />
<%=
f
.
text_field
:topic
%>
</div>-->
<div
class=
"field"
>
<%=
render
'topics/editor'
,
:content
=>
@post
.
content
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
t
'post.private'
%>
<br
/>
<%=
f
.
check_box
:private
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
t
'post.anonymous'
%>
<br
/>
<%=
f
.
check_box
:anonymous
%>
</div>
<!--<div class="field">
<%=
f
.
label
:ubb
%>
<br />
<%=
f
.
check_box
:ubb
%>
</div>
<div class="field">
<%=
f
.
label
:html
%>
<br />
<%=
f
.
check_box
:html
%>
</div>-->
<div
class=
"actions"
>
<%=
f
.
submit
t
'post.submit'
%>
</div>
<%
end
%>
<%=
link_to
'Show'
,
@post
%>
|
<%=
link_to
'Back'
,
posts_path
%>
app/views/topics/show.html.erb
View file @
36d7a8cf
...
...
@@ -37,71 +37,77 @@
<input
type=
"hidden"
name=
"optgroup"
>
<input
type=
"hidden"
name=
"operation"
>
<input
type=
"hidden"
name=
"listextra"
value=
"page%3D1"
>
</form>
<script
type=
"text/javascript"
>
var
tagarray
=
[
'
论坛
'
,
'
东方
'
,
'
时间
'
,
'
游戏
'
,
'
沙包
'
,
'
少女
'
,
'
DotA
'
,
'
日本
'
,
'
地图
'
,
'
漫画
'
,
'
新闻
'
,
'
动画
'
,
'
大小姐
'
,
'
名字
'
,
'
兔子
'
,
'
朋友
'
,
'
动漫
'
,
'
中国
'
,
'
故事
'
,
'
电脑
'
,
'
音乐
'
,
'
神马
'
,
'
小说
'
,
'
速度
'
,
'
人物
'
,
'
小姐
'
,
'
人偶
'
,
'
天子
'
,
'
图片
'
,
'
角色
'
,
'
宠物
'
,
'
大丈夫
'
,
'
幻想
'
,
'
主题
'
,
'
头像
'
,
'
手机
'
,
'
魔兽
'
,
'
DOTS
'
,
'
东方幻想
'
,
'
新人
'
,
'
THD
'
,
'
下载地址
'
,
'
妹妹
'
,
'
老师
'
,
'
河童
'
,
'
攻击力
'
,
'
心情
'
,
'
世界
'
,
'
BUG
'
,
'
个人
'
,
'
hello
'
,
'
上海
'
,
'
笨蛋
'
,
'
爱丽丝
'
,
'
历史
'
,
'
主人公
'
,
'
连载
'
,
'
平衡
'
,
'
百合
'
,
'
漫画家
'
,
'
美少女
'
,
'
攻略
'
,
'
技能
'
,
'
单行本
'
,
'
强力
'
,
'
在线
'
,
'
三次元
'
,
'
姐姐
'
,
'
同人
'
,
'
打酱油
'
,
'
空间
'
,
'
主题曲
'
,
'
视频
'
,
'
歌曲
'
,
'
地方
'
,
'
动画制作
'
,
'
天气
'
,
'
胜利
'
,
'
东方系列
'
,
'
表情
'
,
'
我不知道
'
,
'
机器人
'
,
'
软件
'
,
'
秋叶原
'
,
'
师傅
'
,
'
电影
'
,
'
女性
'
,
'
生日快乐
'
,
'
爱好者
'
,
'
教学
'
,
'
官方网站
'
,
'
TouHou
'
,
'
资源
'
,
'
对战
'
,
'
玩游戏
'
,
'
萝莉
'
,
'
网通
'
,
'
蓬莱
'
,
'
人生
'
,
'
中文
'
];
var
tagencarray
=
[
'
%C2%DB%CC%B3
'
,
'
%B6%AB%B7%BD
'
,
'
%CA%B1%BC%E4
'
,
'
%D3%CE%CF%B7
'
,
'
%C9%B3%B0%FC
'
,
'
%C9%D9%C5%AE
'
,
'
DotA
'
,
'
%C8%D5%B1%BE
'
,
'
%B5%D8%CD%BC
'
,
'
%C2%FE%BB%AD
'
,
'
%D0%C2%CE%C5
'
,
'
%B6%AF%BB%AD
'
,
'
%B4%F3%D0%A1%BD%E3
'
,
'
%C3%FB%D7%D6
'
,
'
%CD%C3%D7%D3
'
,
'
%C5%F3%D3%D1
'
,
'
%B6%AF%C2%FE
'
,
'
%D6%D0%B9%FA
'
,
'
%B9%CA%CA%C2
'
,
'
%B5%E7%C4%D4
'
,
'
%D2%F4%C0%D6
'
,
'
%C9%F1%C2%ED
'
,
'
%D0%A1%CB%B5
'
,
'
%CB%D9%B6%C8
'
,
'
%C8%CB%CE%EF
'
,
'
%D0%A1%BD%E3
'
,
'
%C8%CB%C5%BC
'
,
'
%CC%EC%D7%D3
'
,
'
%CD%BC%C6%AC
'
,
'
%BD%C7%C9%AB
'
,
'
%B3%E8%CE%EF
'
,
'
%B4%F3%D5%C9%B7%F2
'
,
'
%BB%C3%CF%EB
'
,
'
%D6%F7%CC%E2
'
,
'
%CD%B7%CF%F1
'
,
'
%CA%D6%BB%FA
'
,
'
%C4%A7%CA%DE
'
,
'
DOTS
'
,
'
%B6%AB%B7%BD%BB%C3%CF%EB
'
,
'
%D0%C2%C8%CB
'
,
'
THD
'
,
'
%CF%C2%D4%D8%B5%D8%D6%B7
'
,
'
%C3%C3%C3%C3
'
,
'
%C0%CF%CA%A6
'
,
'
%BA%D3%CD%AF
'
,
'
%B9%A5%BB%F7%C1%A6
'
,
'
%D0%C4%C7%E9
'
,
'
%CA%C0%BD%E7
'
,
'
BUG
'
,
'
%B8%F6%C8%CB
'
,
'
hello
'
,
'
%C9%CF%BA%A3
'
,
'
%B1%BF%B5%B0
'
,
'
%B0%AE%C0%F6%CB%BF
'
,
'
%C0%FA%CA%B7
'
,
'
%D6%F7%C8%CB%B9%AB
'
,
'
%C1%AC%D4%D8
'
,
'
%C6%BD%BA%E2
'
,
'
%B0%D9%BA%CF
'
,
'
%C2%FE%BB%AD%BC%D2
'
,
'
%C3%C0%C9%D9%C5%AE
'
,
'
%B9%A5%C2%D4
'
,
'
%BC%BC%C4%DC
'
,
'
%B5%A5%D0%D0%B1%BE
'
,
'
%C7%BF%C1%A6
'
,
'
%D4%DA%CF%DF
'
,
'
%C8%FD%B4%CE%D4%AA
'
,
'
%BD%E3%BD%E3
'
,
'
%CD%AC%C8%CB
'
,
'
%B4%F2%BD%B4%D3%CD
'
,
'
%BF%D5%BC%E4
'
,
'
%D6%F7%CC%E2%C7%FA
'
,
'
%CA%D3%C6%B5
'
,
'
%B8%E8%C7%FA
'
,
'
%B5%D8%B7%BD
'
,
'
%B6%AF%BB%AD%D6%C6%D7%F7
'
,
'
%CC%EC%C6%F8
'
,
'
%CA%A4%C0%FB
'
,
'
%B6%AB%B7%BD%CF%B5%C1%D0
'
,
'
%B1%ED%C7%E9
'
,
'
%CE%D2%B2%BB%D6%AA%B5%C0
'
,
'
%BB%FA%C6%F7%C8%CB
'
,
'
%C8%ED%BC%FE
'
,
'
%C7%EF%D2%B6%D4%AD
'
,
'
%CA%A6%B8%B5
'
,
'
%B5%E7%D3%B0
'
,
'
%C5%AE%D0%D4
'
,
'
%C9%FA%C8%D5%BF%EC%C0%D6
'
,
'
%B0%AE%BA%C3%D5%DF
'
,
'
%BD%CC%D1%A7
'
,
'
%B9%D9%B7%BD%CD%F8%D5%BE
'
,
'
TouHou
'
,
'
%D7%CA%D4%B4
'
,
'
%B6%D4%D5%BD
'
,
'
%CD%E6%D3%CE%CF%B7
'
,
'
%C2%DC%C0%F2
'
,
'
%CD%F8%CD%A8
'
,
'
%C5%EE%C0%B3
'
,
'
%C8%CB%C9%FA
'
,
'
%D6%D0%CE%C4
'
];
parsetag
(
751906
);
</script>
<div
class=
"forumcontrol s_clear"
>
<table
cellspacing=
"0"
cellpadding=
"0"
class=
"narrow"
>
<tbody><tr>
<td
class=
"modaction"
>
<span
id=
"modopttmp"
onclick=
"$('modopt').id = 'modopttmp';this.id = 'modopt';showMenu({'ctrlid':this.id})"
class=
"dropmenu"
>
主题管理
</span>
</td>
<td>
<%=
@topic
.
floor
%>
#:
<span
class=
"pageback"
id=
"visitedforums"
onmouseover=
"$('visitedforums').id = 'visitedforumstmp';this.id = 'visitedforums';showMenu({'ctrlid':this.id})"
><a
href=
"forumdisplay.php?fid=2&page=1"
>
返回列表
</a></span>
</td>
</tr>
</tbody></table>
</div>
</form>
<script
type=
"text/javascript"
>
var
tagarray
=
[
'
论坛
'
,
'
东方
'
,
'
时间
'
,
'
游戏
'
,
'
沙包
'
,
'
少女
'
,
'
DotA
'
,
'
日本
'
,
'
地图
'
,
'
漫画
'
,
'
新闻
'
,
'
动画
'
,
'
大小姐
'
,
'
名字
'
,
'
兔子
'
,
'
朋友
'
,
'
动漫
'
,
'
中国
'
,
'
故事
'
,
'
电脑
'
,
'
音乐
'
,
'
神马
'
,
'
小说
'
,
'
速度
'
,
'
人物
'
,
'
小姐
'
,
'
人偶
'
,
'
天子
'
,
'
图片
'
,
'
角色
'
,
'
宠物
'
,
'
大丈夫
'
,
'
幻想
'
,
'
主题
'
,
'
头像
'
,
'
手机
'
,
'
魔兽
'
,
'
DOTS
'
,
'
东方幻想
'
,
'
新人
'
,
'
THD
'
,
'
下载地址
'
,
'
妹妹
'
,
'
老师
'
,
'
河童
'
,
'
攻击力
'
,
'
心情
'
,
'
世界
'
,
'
BUG
'
,
'
个人
'
,
'
hello
'
,
'
上海
'
,
'
笨蛋
'
,
'
爱丽丝
'
,
'
历史
'
,
'
主人公
'
,
'
连载
'
,
'
平衡
'
,
'
百合
'
,
'
漫画家
'
,
'
美少女
'
,
'
攻略
'
,
'
技能
'
,
'
单行本
'
,
'
强力
'
,
'
在线
'
,
'
三次元
'
,
'
姐姐
'
,
'
同人
'
,
'
打酱油
'
,
'
空间
'
,
'
主题曲
'
,
'
视频
'
,
'
歌曲
'
,
'
地方
'
,
'
动画制作
'
,
'
天气
'
,
'
胜利
'
,
'
东方系列
'
,
'
表情
'
,
'
我不知道
'
,
'
机器人
'
,
'
软件
'
,
'
秋叶原
'
,
'
师傅
'
,
'
电影
'
,
'
女性
'
,
'
生日快乐
'
,
'
爱好者
'
,
'
教学
'
,
'
官方网站
'
,
'
TouHou
'
,
'
资源
'
,
'
对战
'
,
'
玩游戏
'
,
'
萝莉
'
,
'
网通
'
,
'
蓬莱
'
,
'
人生
'
,
'
中文
'
];
var
tagencarray
=
[
'
%C2%DB%CC%B3
'
,
'
%B6%AB%B7%BD
'
,
'
%CA%B1%BC%E4
'
,
'
%D3%CE%CF%B7
'
,
'
%C9%B3%B0%FC
'
,
'
%C9%D9%C5%AE
'
,
'
DotA
'
,
'
%C8%D5%B1%BE
'
,
'
%B5%D8%CD%BC
'
,
'
%C2%FE%BB%AD
'
,
'
%D0%C2%CE%C5
'
,
'
%B6%AF%BB%AD
'
,
'
%B4%F3%D0%A1%BD%E3
'
,
'
%C3%FB%D7%D6
'
,
'
%CD%C3%D7%D3
'
,
'
%C5%F3%D3%D1
'
,
'
%B6%AF%C2%FE
'
,
'
%D6%D0%B9%FA
'
,
'
%B9%CA%CA%C2
'
,
'
%B5%E7%C4%D4
'
,
'
%D2%F4%C0%D6
'
,
'
%C9%F1%C2%ED
'
,
'
%D0%A1%CB%B5
'
,
'
%CB%D9%B6%C8
'
,
'
%C8%CB%CE%EF
'
,
'
%D0%A1%BD%E3
'
,
'
%C8%CB%C5%BC
'
,
'
%CC%EC%D7%D3
'
,
'
%CD%BC%C6%AC
'
,
'
%BD%C7%C9%AB
'
,
'
%B3%E8%CE%EF
'
,
'
%B4%F3%D5%C9%B7%F2
'
,
'
%BB%C3%CF%EB
'
,
'
%D6%F7%CC%E2
'
,
'
%CD%B7%CF%F1
'
,
'
%CA%D6%BB%FA
'
,
'
%C4%A7%CA%DE
'
,
'
DOTS
'
,
'
%B6%AB%B7%BD%BB%C3%CF%EB
'
,
'
%D0%C2%C8%CB
'
,
'
THD
'
,
'
%CF%C2%D4%D8%B5%D8%D6%B7
'
,
'
%C3%C3%C3%C3
'
,
'
%C0%CF%CA%A6
'
,
'
%BA%D3%CD%AF
'
,
'
%B9%A5%BB%F7%C1%A6
'
,
'
%D0%C4%C7%E9
'
,
'
%CA%C0%BD%E7
'
,
'
BUG
'
,
'
%B8%F6%C8%CB
'
,
'
hello
'
,
'
%C9%CF%BA%A3
'
,
'
%B1%BF%B5%B0
'
,
'
%B0%AE%C0%F6%CB%BF
'
,
'
%C0%FA%CA%B7
'
,
'
%D6%F7%C8%CB%B9%AB
'
,
'
%C1%AC%D4%D8
'
,
'
%C6%BD%BA%E2
'
,
'
%B0%D9%BA%CF
'
,
'
%C2%FE%BB%AD%BC%D2
'
,
'
%C3%C0%C9%D9%C5%AE
'
,
'
%B9%A5%C2%D4
'
,
'
%BC%BC%C4%DC
'
,
'
%B5%A5%D0%D0%B1%BE
'
,
'
%C7%BF%C1%A6
'
,
'
%D4%DA%CF%DF
'
,
'
%C8%FD%B4%CE%D4%AA
'
,
'
%BD%E3%BD%E3
'
,
'
%CD%AC%C8%CB
'
,
'
%B4%F2%BD%B4%D3%CD
'
,
'
%BF%D5%BC%E4
'
,
'
%D6%F7%CC%E2%C7%FA
'
,
'
%CA%D3%C6%B5
'
,
'
%B8%E8%C7%FA
'
,
'
%B5%D8%B7%BD
'
,
'
%B6%AF%BB%AD%D6%C6%D7%F7
'
,
'
%CC%EC%C6%F8
'
,
'
%CA%A4%C0%FB
'
,
'
%B6%AB%B7%BD%CF%B5%C1%D0
'
,
'
%B1%ED%C7%E9
'
,
'
%CE%D2%B2%BB%D6%AA%B5%C0
'
,
'
%BB%FA%C6%F7%C8%CB
'
,
'
%C8%ED%BC%FE
'
,
'
%C7%EF%D2%B6%D4%AD
'
,
'
%CA%A6%B8%B5
'
,
'
%B5%E7%D3%B0
'
,
'
%C5%AE%D0%D4
'
,
'
%C9%FA%C8%D5%BF%EC%C0%D6
'
,
'
%B0%AE%BA%C3%D5%DF
'
,
'
%BD%CC%D1%A7
'
,
'
%B9%D9%B7%BD%CD%F8%D5%BE
'
,
'
TouHou
'
,
'
%D7%CA%D4%B4
'
,
'
%B6%D4%D5%BD
'
,
'
%CD%E6%D3%CE%CF%B7
'
,
'
%C2%DC%C0%F2
'
,
'
%CD%F8%CD%A8
'
,
'
%C5%EE%C0%B3
'
,
'
%C8%CB%C9%FA
'
,
'
%D6%D0%CE%C4
'
];
parsetag
(
751906
);
</script>
<div
class=
"forumcontrol s_clear"
>
<table
cellspacing=
"0"
cellpadding=
"0"
class=
"narrow"
>
<tbody><tr>
<td
class=
"modaction"
>
<span
id=
"modopttmp"
onclick=
"$('modopt').id = 'modopttmp';this.id = 'modopt';showMenu({'ctrlid':this.id})"
class=
"dropmenu"
>
主题管理
</span>
</td>
<td>
<%=
@topic
.
floor
%>
#:
<span
class=
"pageback"
id=
"visitedforums"
onmouseover=
"$('visitedforums').id = 'visitedforumstmp';this.id = 'visitedforums';showMenu({'ctrlid':this.id})"
><a
href=
"forumdisplay.php?fid=2&page=1"
>
返回列表
</a></span>
</td>
</tr>
</tbody></table>
</div>
<script
type=
"text/javascript"
>
var
postminchars
=
parseInt
(
'
10
'
);
var
postmaxchars
=
parseInt
(
'
102400
'
);
var
disablepostctrl
=
parseInt
(
'
0
'
);
</script>
<div
id=
"f_post"
class=
"mainbox viewthread"
>
<%=
form_tag
:controller
=>
:posts
do
%>
<table
cellspacing=
"0"
cellpadding=
"0"
>
<tbody><tr>
<td
class=
"postauthor"
>
<div
class=
"avatar"
>
<%=
image_tag
@current_user
.
avatar
.
url
(
:middle
)
%>
</td>
<td
class=
"postcontent"
>
<!--<input type="hidden" name="formhash" value="ba0236f6">
<input type="hidden" name="subject" value="">
<input type="hidden" name="usesig" value="0">-->
<div
id=
"f_post"
class=
"mainbox viewthread"
>
<table
cellspacing=
"0"
cellpadding=
"0"
>
<tbody><tr>
<td
class=
"postauthor"
>
<div
class=
"avatar"
>
<%=
image_tag
@current_user
.
avatar
.
url
(
:middle
)
%>
</div>
</td>
<td
class=
"postcontent"
>
<%=
form_for
(
@post
,
:html
=>
{
:multipart
=>
true
})
do
|
f
|
%>
<div
class=
"field"
>
<%=
f
.
text_area
:content
,
:id
=>
:fastpostmessage
%>
</div>
<div
class=
"field"
>
<%=
f
.
label
:attachments
%>
<%=
f
.
fields_for
:attachments
do
|
attachment_form
|
%>
<div
class=
"field"
style=
"display:inline"
>
<%=
attachment_form
.
file_field
:data
%>
</div>
<%
end
%>
</div>
<%=
f
.
hidden_field
:topic_id
%>
<div
class=
"actions"
>
<%=
f
.
submit
%>
</div>
<%
end
%>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#fastpostmessage
'
).
markItUp
(
mySettings
);
});
</script>
</td>
</tr>
</tbody></table>
<span
id=
"fastpostreturn"
>
<%=
render
'topics/editor_lite'
%>
</span>
<p>
<%=
submit_tag
t
(
"topic.reply"
),
:id
=>
:replysubmit
,
:tabindex
=>
5
%>
<input
id=
"fastpostrefresh"
type=
"checkbox"
>
<label
for=
"fastpostrefresh"
>
回帖后跳转到最后一页
</label></p><script
type=
"text/javascript"
>
if
(
getcookie
(
'
discuz_fastpostrefresh
'
)
==
1
)
{
$
(
'
fastpostrefresh
'
).
checked
=
true
;}
</script>
<p></p>
</td>
</tr>
</tbody></table>
<%=
hidden_field_tag
'post[topic_id]'
,
@topic
.
id
%>
<%
end
%>
</div>
<div
id=
"authornewfeed_menu"
style=
"display:none"
></div><script
type=
"text/javascript"
src=
"http://www.touhou.cc/blog/api/discuz.php?pagetype=viewthread&status=3&uid=359&infosidestatus=0&feedpostnum=14&updateuid=14806&pid=751906&plugin=1"
></script><script
language=
"javascript"
>
$
(
"
modopt_menu
"
).
innerHTML
+=
"
<li class=
\"
wide
\"
><a href=
\"
plugin.php?id=dps_postawards:postawards&tid=29727
\"
onclick=
\"
showWindow('paward', this.href);return false;
\"
>楼层奖惩</a></li>
"
;
</script>
<ul
class=
"popupmenu_popup"
id=
"visitedforums_menu"
style=
"display: none"
>
<li><a
href=
"forumdisplay.php?fid=70&sid=FrmND8"
>
悬赏求物
</a></li><li><a
href=
"forumdisplay.php?fid=104&sid=FrmND8"
>
精美图库
</a></li><li><a
href=
"forumdisplay.php?fid=22&sid=FrmND8"
>
内务讨论
</a></li><li><a
href=
"forumdisplay.php?fid=76&sid=FrmND8"
>
幻想乡大温泉
</a></li><li><a
href=
"forumdisplay.php?fid=91&sid=FrmND8"
>
制作专区
</a></li><li><a
href=
"forumdisplay.php?fid=48&sid=FrmND8"
>
文文最速新闻
</a></li><li><a
href=
"forumdisplay.php?fid=32&sid=FrmND8"
>
资源发布
</a></li></ul>
</div>
<div
id=
"authornewfeed_menu"
style=
"display:none"
></div><script
type=
"text/javascript"
src=
"http://www.touhou.cc/blog/api/discuz.php?pagetype=viewthread&status=3&uid=359&infosidestatus=0&feedpostnum=14&updateuid=14806&pid=751906&plugin=1"
></script><script
language=
"javascript"
>
$
(
"
modopt_menu
"
).
innerHTML
+=
"
<li class=
\"
wide
\"
><a href=
\"
plugin.php?id=dps_postawards:postawards&tid=29727
\"
onclick=
\"
showWindow('paward', this.href);return false;
\"
>楼层奖惩</a></li>
"
;
</script>
<ul
class=
"popupmenu_popup"
id=
"visitedforums_menu"
style=
"display: none"
>
<li><a
href=
"forumdisplay.php?fid=70&sid=FrmND8"
>
悬赏求物
</a></li><li><a
href=
"forumdisplay.php?fid=104&sid=FrmND8"
>
精美图库
</a></li><li><a
href=
"forumdisplay.php?fid=22&sid=FrmND8"
>
内务讨论
</a></li><li><a
href=
"forumdisplay.php?fid=76&sid=FrmND8"
>
幻想乡大温泉
</a></li><li><a
href=
"forumdisplay.php?fid=91&sid=FrmND8"
>
制作专区
</a></li><li><a
href=
"forumdisplay.php?fid=48&sid=FrmND8"
>
文文最速新闻
</a></li><li><a
href=
"forumdisplay.php?fid=32&sid=FrmND8"
>
资源发布
</a></li></ul>
<div
id=
"favoritewin"
style=
"display: none"
>
<h5>
<a
href=
"javascript:;"
onclick=
"ajaxget('my.php?item=favorites&tid=29727', 'favorite_msg');return false;"
class=
"lightlink"
>
[收藏此主题]
</a>
<a
href=
"javascript:;"
onclick=
"ajaxget('my.php?item=attention&action=add&tid=29727', 'favorite_msg');return false;"
class=
"lightlink"
>
[关注此主题的新回复]
</a>
</h5>
<span
id=
"favorite_msg"
></span>
</div>
<div
id=
"favoritewin"
style=
"display: none"
>
<h5>
<a
href=
"javascript:;"
onclick=
"ajaxget('my.php?item=favorites&tid=29727', 'favorite_msg');return false;"
class=
"lightlink"
>
[收藏此主题]
</a>
<a
href=
"javascript:;"
onclick=
"ajaxget('my.php?item=attention&action=add&tid=29727', 'favorite_msg');return false;"
class=
"lightlink"
>
[关注此主题的新回复]
</a>
</h5>
<span
id=
"favorite_msg"
></span>
</div>
<div
id=
"sharewin"
style=
"display: none"
>
<h5>
<a
href=
"javascript:;"
onclick=
"setCopy('蕾蒂+毒人 怎么破\nhttp://www.touhou.cc/bbs/viewthread.php?tid=29727&fromuid=359', '帖子地址已经复制到剪贴板<br />您可以用快捷键 Ctrl + V 粘贴到 QQ、MSN 里。')"
class=
"lightlink"
>
[通过 QQ、MSN 分享给朋友]
</a><br><br>
<a
href=
"javascript:;"
class=
"lightlink"
onclick=
"hideWindow('confirm');showWindow('sendpm', 'pm.php?action=new&operation=share&tid=29727');"
>
[通过站内短消息分享给朋友]
</a>
</h5>
</div>
<div
id=
"sharewin"
style=
"display: none"
>
<h5>
<a
href=
"javascript:;"
onclick=
"setCopy('蕾蒂+毒人 怎么破\nhttp://www.touhou.cc/bbs/viewthread.php?tid=29727&fromuid=359', '帖子地址已经复制到剪贴板<br />您可以用快捷键 Ctrl + V 粘贴到 QQ、MSN 里。')"
class=
"lightlink"
>
[通过 QQ、MSN 分享给朋友]
</a><br><br>
<a
href=
"javascript:;"
class=
"lightlink"
onclick=
"hideWindow('confirm');showWindow('sendpm', 'pm.php?action=new&operation=share&tid=29727');"
>
[通过站内短消息分享给朋友]
</a>
</h5>
</div>
<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"
><a
href=
"plugin.php?id=myrepeats:switch&username=%B2%A4%C2%DC%B0%FC"
>
菠萝包
</a></li><li
class=
"wide"
style=
"clear:both"
><a
href=
"plugin.php?id=myrepeats:memcp"
>
设置马甲
</a></li></ul></div>
<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"
><a
href=
"plugin.php?id=myrepeats:switch&username=%B2%A4%C2%DC%B0%FC"
>
菠萝包
</a></li><li
class=
"wide"
style=
"clear:both"
><a
href=
"plugin.php?id=myrepeats:memcp"
>
设置马甲
</a></li></ul></div>
config/locales/zh-CN.yml
View file @
36d7a8cf
...
...
@@ -259,6 +259,8 @@ zh-CN:
top_traps
:
"
热门陷阱"
board
:
index
:
"
论坛"
post
:
attachments
:
"
附件"
mycard
:
download
:
"
立即下载"
battlenet
:
"
YGO战网"
...
...
config/routes.rb
View file @
36d7a8cf
MycardServerHttp
::
Application
.
routes
.
draw
do
resources
:attachments
resources
:moderators
resources
:servers
...
...
db/migrate/20120518234415_create_attachments.rb
0 → 100644
View file @
36d7a8cf
class
CreateAttachments
<
ActiveRecord
::
Migration
def
change
create_table
:attachments
do
|
t
|
t
.
string
:data_file_name
t
.
string
:data_content_type
t
.
integer
:data_file_size
t
.
datetime
:data_updated_at
t
.
integer
:post_id
t
.
timestamps
end
end
end
db/schema.rb
View file @
36d7a8cf
...
...
@@ -11,7 +11,17 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
20120510085131
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
20120518234415
)
do
create_table
"attachments"
,
:force
=>
true
do
|
t
|
t
.
string
"data_file_name"
t
.
string
"data_content_type"
t
.
integer
"data_file_size"
t
.
datetime
"data_updated_at"
t
.
integer
"post_id"
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
end
create_table
"boards"
,
:force
=>
true
do
|
t
|
t
.
string
"name"
,
:default
=>
""
,
:null
=>
false
...
...
@@ -76,8 +86,11 @@ ActiveRecord::Schema.define(:version => 20120510085131) do
t
.
string
"replay"
t
.
integer
"user1_credits"
t
.
integer
"user2_credits"
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
t
.
integer
"version"
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
t
.
boolean
"user1_public"
,
:default
=>
true
,
:null
=>
false
t
.
boolean
"user2_public"
,
:default
=>
true
,
:null
=>
false
end
add_index
"duels"
,
[
"user1_id"
],
:name
=>
"index_duels_on_user1_id"
...
...
@@ -195,16 +208,6 @@ ActiveRecord::Schema.define(:version => 20120510085131) do
t
.
datetime
"updated_at"
,
:null
=>
false
end
create_table
"sessions"
,
:force
=>
true
do
|
t
|
t
.
string
"session_id"
,
:null
=>
false
t
.
text
"data"
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
end
add_index
"sessions"
,
[
"session_id"
],
:name
=>
"index_sessions_on_session_id"
add_index
"sessions"
,
[
"updated_at"
],
:name
=>
"index_sessions_on_updated_at"
create_table
"settings"
,
:primary_key
=>
"name"
,
:force
=>
true
do
|
t
|
t
.
text
"value"
end
...
...
@@ -231,7 +234,7 @@ ActiveRecord::Schema.define(:version => 20120510085131) do
create_table
"users"
,
:force
=>
true
do
|
t
|
t
.
string
"name"
,
:null
=>
false
t
.
string
"password"
t
.
string
"email"
t
.
string
"email"
,
:default
=>
""
,
:null
=>
false
t
.
string
"nickname"
,
:default
=>
""
,
:null
=>
false
t
.
text
"signature"
t
.
integer
"credits"
,
:default
=>
0
,
:null
=>
false
...
...
test/fixtures/attachments.yml
0 → 100644
View file @
36d7a8cf
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
one
:
data_file_name
:
MyString
data_content_type
:
MyString
data_file_size
:
1
data_updated_at
:
2012-05-19 07:44:15
post_id
:
1
two
:
data_file_name
:
MyString
data_content_type
:
MyString
data_file_size
:
1
data_updated_at
:
2012-05-19 07:44:15
post_id
:
1
test/functional/attachments_controller_test.rb
0 → 100644
View file @
36d7a8cf
require
'test_helper'
class
AttachmentsControllerTest
<
ActionController
::
TestCase
setup
do
@attachment
=
attachments
(
:one
)
end
test
"should get index"
do
get
:index
assert_response
:success
assert_not_nil
assigns
(
:attachments
)
end
test
"should get new"
do
get
:new
assert_response
:success
end
test
"should create attachment"
do
assert_difference
(
'Attachment.count'
)
do
post
:create
,
attachment:
@attachment
.
attributes
end
assert_redirected_to
attachment_path
(
assigns
(
:attachment
))
end
test
"should show attachment"
do
get
:show
,
id:
@attachment
assert_response
:success
end
test
"should get edit"
do
get
:edit
,
id:
@attachment
assert_response
:success
end
test
"should update attachment"
do
put
:update
,
id:
@attachment
,
attachment:
@attachment
.
attributes
assert_redirected_to
attachment_path
(
assigns
(
:attachment
))
end
test
"should destroy attachment"
do
assert_difference
(
'Attachment.count'
,
-
1
)
do
delete
:destroy
,
id:
@attachment
end
assert_redirected_to
attachments_path
end
end
test/unit/attachment_test.rb
0 → 100644
View file @
36d7a8cf
require
'test_helper'
class
AttachmentTest
<
ActiveSupport
::
TestCase
# test "the truth" do
# assert true
# end
end
test/unit/helpers/attachments_helper_test.rb
0 → 100644
View file @
36d7a8cf
require
'test_helper'
class
AttachmentsHelperTest
<
ActionView
::
TestCase
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment