Commit 7ba1b251 authored by 神楽坂玲奈's avatar 神楽坂玲奈

临时

parent c0f9d7d2
...@@ -61,6 +61,7 @@ border-color:rgba(0, 0, 0, 0.2); ...@@ -61,6 +61,7 @@ border-color:rgba(0, 0, 0, 0.2);
display:block; display:block;
font:25px bold 'Nunito',sans-serif; font:25px bold 'Nunito',sans-serif;
float:left; float:left;
font-size:24px;
} }
.nav_link{ .nav_link{
...@@ -88,13 +89,16 @@ border-color:#e1e1e1; ...@@ -88,13 +89,16 @@ border-color:#e1e1e1;
width:900px; width:900px;
margin:0 auto; margin:0 auto;
padding:30px 0 0 0; padding:30px 0 0 0;
height:280px;
} }
#information{ #information{
width:390px; width:390px;
float:left; float:left;
} }
.title{ .title{
font:45px bold 'Nunito',sans-serif; font-size:45px ;
font-weight:bold;
font-family:'Nunito',sans-serif;
} }
.subtitle{ .subtitle{
font:30px "\5FAE\8F6F\96C5\9ED1"; font:30px "\5FAE\8F6F\96C5\9ED1";
...@@ -137,26 +141,28 @@ z-index:0; ...@@ -137,26 +141,28 @@ z-index:0;
clear:both; clear:both;
display:block; display:block;
float:right; float:right;
top:-212px;
*top:0;
} }
.show1{ .show1{
width:500px; width:500px;
height:275px; height:275px;
background:image-url("index/01.png"); background:image-url("index/01.png");
margin:-215px 0 0 -10px;
border-radius:10px; border-radius:10px;
} }
.show2{ .show2{
width:500px; width:500px;
height:275px; height:275px;
background:image-url("index/02.png"); background:image-url("index/02.png");
margin:-215px 0 0 -10px;
border-radius:10px; border-radius:10px;
} }
.show3{ .show3{
width:500px; width:500px;
height:275px; height:275px;
background:image-url("index/03.png"); background:image-url("index/03.png");
margin:-210px 0 0 -10px;
border-radius:10px; border-radius:10px;
} }
footer{ footer{
......
...@@ -59,13 +59,13 @@ class PostsController < ApplicationController ...@@ -59,13 +59,13 @@ class PostsController < ApplicationController
end end
@post.user = @current_user @post.user = @current_user
@post.displayorder = @post.topic.floor @post.displayorder = @post.topic.floor
@post.attachments.build
@actions = [@post, "发表回复"] @actions = [@post, "发表回复"]
respond_to do |format| respond_to do |format|
if @post.save if @post.save
format.html { redirect_to(@post.topic, :notice => 'Post was successfully created.') } format.html { redirect_to(@post.topic, :notice => 'Post was successfully created.') }
format.xml { render :xml => @post, :status => :created, :location => @post.topic } format.xml { render :xml => @post, :status => :created, :location => @post.topic }
else else
@post.attachments.build
format.html { render :action => "new" } format.html { render :action => "new" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity } format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end end
...@@ -76,13 +76,13 @@ class PostsController < ApplicationController ...@@ -76,13 +76,13 @@ class PostsController < ApplicationController
# PUT /posts/1.xml # PUT /posts/1.xml
def update def update
@post = Post.find(params[:id]) @post = Post.find(params[:id])
@post.attachments.build
@actions = [@post, "编辑帖子"] @actions = [@post, "编辑帖子"]
respond_to do |format| respond_to do |format|
if @post.update_attributes(params[:post]) if @post.update_attributes(params[:post])
format.html { redirect_to(@post.topic, :notice => 'Post was successfully updated.') } format.html { redirect_to(@post.topic, :notice => 'Post was successfully updated.') }
format.xml { head :ok } format.xml { head :ok }
else else
@post.attachments.build
format.html { render :action => "edit" } format.html { render :action => "edit" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity } format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end end
......
...@@ -98,6 +98,8 @@ class TopicsController < ApplicationController ...@@ -98,6 +98,8 @@ class TopicsController < ApplicationController
format.xml { render :xml => @topic, :status => :created, :location => @topic } format.xml { render :xml => @topic, :status => :created, :location => @topic }
else else
@topic.errors[:base] << ("验证码错误") if params[:captcha] != session[:captcha] @topic.errors[:base] << ("验证码错误") if params[:captcha] != session[:captcha]
@post = @topic.posts.first
@post.attachments.build
format.html { render :action => "new" } format.html { render :action => "new" }
format.xml { render :xml => @topic.errors, :status => :unprocessable_entity } format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }
end end
...@@ -108,14 +110,14 @@ class TopicsController < ApplicationController ...@@ -108,14 +110,14 @@ class TopicsController < ApplicationController
# PUT /topics/1.xml # PUT /topics/1.xml
def update def update
@topic = Topic.find(params[:id]) @topic = Topic.find(params[:id])
@post = @topic.posts.first
@post.attachments.build
@actions = [@topic.category, @topic, "编辑"] @actions = [@topic.category, @topic, "编辑"]
respond_to do |format| respond_to do |format|
if @topic.update_attributes(params[:topic]) if @topic.update_attributes(params[:topic])
format.html { redirect_to(@topic, :notice => 'Topic was successfully updated.') } format.html { redirect_to(@topic, :notice => 'Topic was successfully updated.') }
format.xml { head :ok } format.xml { head :ok }
else else
@post = @topic.posts.first
@post.attachments.build
format.html { render :action => "edit" } format.html { render :action => "edit" }
format.xml { render :xml => @topic.errors, :status => :unprocessable_entity } format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }
end end
......
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