Merge branch 'show_feature'

This commit is contained in:
yafeilee 2014-03-30 16:17:27 +08:00
commit 152e300268
6 changed files with 48 additions and 11 deletions

View File

@ -27,10 +27,27 @@
.recent-title {
border-bottom: 1px solid #dddddd;
padding-bottom: 0.5rem;
margin-bottom: 0.275rem;
margin-bottom: 1rem;
}
.recent-content {
padding-bottom: 3rem;
li {
list-style: none;
}
margin-left: 0rem;
padding-left: 0rem;
}
@media only screen and (max-width: 40em) {
.self-introduce {
display: none;
}
}
.self-introduce {
margin-top: 2.2rem;
h1, h2, h3, h4, h5, h6 {
border-bottom: 1px solid #dddddd;
}
}

View File

@ -23,6 +23,13 @@
.next {
float: right;
i {
margin-left: 0.275rem;
}
}
.prev i {
margin-right: 0.275rem;
}
}

View File

@ -1,4 +1,8 @@
.markdown {
word-wrap: break-word;
overflow: hidden;
@media only screen and (min-width: 40.063em) {
h1, h2, h3, h4, h5, h6 {
font-size: 1.5rem;
@ -11,6 +15,10 @@
}
}
h1, h2, h3, h4, h5, h6 {
border-bottom: 1px solid #F7F7F7;
}
pre {
border: 1px solid #cccccc;
padding: 1rem 0.5rem;

View File

@ -13,7 +13,9 @@ class BlogsController < ApplicationController
def show
@post = Post.find(params[:id])
@comments = Comment.all.where(post_id: @post.id)
@prev = Post.where(:created_at.lt => @post.created_at).desc(:created_at).where(:id.ne => @post.id).first
@next = Post.where(:created_at.gt => @post.created_at).asc(:created_at).where(:id.ne => @post.id).first
@comments = @post.comments
end
private

View File

@ -7,7 +7,7 @@
p.ptag
| 标签:
span #{@newest.labels.collect{ |label| label.name}.join(', ')}
.content
.content.markdown
== @newest.sub_content
= link_to "阅读全文 >>", blog_path(@newest)
@ -17,13 +17,12 @@
ul.recent-content
- @recent.each do |re|
li = link_to "#{re.title}",blog_path(re)
.large-3.columns.large-offset-1
.large-3.columns.large-offset-1.self-introduce
h4 WELCOME
hr
p 我是李亚飞, WinDy 是我的网名.
h4 ABOUTME
hr
p 关于我
p 中国 * 深圳
p 邮件订阅, 微信扫一扫

View File

@ -7,7 +7,11 @@
= render partial: 'comment', locals: { comments: @comments }
.row
.small-12.large-8.columns
a.prev href="#"
span.has-tip data-tooltip="" title="hello" Prev
a.next href="#"
span.has-tip data-tooltip="" title="hello" Next
- if @prev
= link_to blog_path(@prev), class: 'prev' do
i.fi-arrow-left
| Prev
- if @next
= link_to blog_path(@next), class: 'next' do
| Next
i.fi-arrow-right