Merge branch 'slim'
This commit is contained in:
commit
59335d392d
1
Gemfile
1
Gemfile
|
@ -16,6 +16,7 @@ gem "mongoid"
|
|||
gem "mongoid-pagination"
|
||||
gem "bson_ext"
|
||||
gem "redcarpet"
|
||||
gem 'slim-rails'
|
||||
gem "simple_form"
|
||||
gem "mini_magick"
|
||||
gem 'carrierwave-mongoid'
|
||||
|
|
|
@ -49,12 +49,6 @@ div.bottom {
|
|||
width: 679px;
|
||||
}
|
||||
|
||||
div#disqus_thread {
|
||||
margin: 20px 20px 0 0;
|
||||
border-top: 1px solid #CCC;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
div.has_new, div.has_old {
|
||||
padding-right: 1em;
|
||||
a {
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
<%= simple_form_for(@post, :url=> admin_posts_path(@post)) do |f| %>
|
||||
<%= f.input :title %>
|
||||
<ul class="tab">
|
||||
<li class="active" id="content">content</li>
|
||||
<li id="preview" url='<%= preview_admin_posts_path %>'>preview</li>
|
||||
</ul>
|
||||
<%= link_to t(:upload_photo), "#", :id=>'upload_photo' %>
|
||||
<input type="file" style="display: none;" />
|
||||
<%= f.input :content, :as=> :text, :label=>false %>
|
||||
<div class="preview wikistyle"></div>
|
||||
<%= f.input :type, :as=>:select, :collection=> [ Post::TECH, Post::LIFE, Post::CREATOR ], :include_blank=>false %>
|
||||
<div class="submit">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -0,0 +1,14 @@
|
|||
= simple_form_for(@post, :url=> admin_posts_path(@post)) do |f|
|
||||
= f.input :title
|
||||
ul.tab
|
||||
li#content.active
|
||||
| content
|
||||
li#preview url=preview_admin_posts_path
|
||||
| preview
|
||||
= link_to t(:upload_photo), "#", :id=>'upload_photo'
|
||||
input[type="file" style="display: none;"]
|
||||
= f.input :content, :as=> :text, :label=>false
|
||||
.preview.wikistyle
|
||||
= f.input :type, :as=>:select, :collection=> [ Post::TECH, Post::LIFE, Post::CREATOR ], :include_blank=>false
|
||||
.submit
|
||||
= f.submit
|
|
@ -1,2 +0,0 @@
|
|||
<h1>Admin::Posts#create</h1>
|
||||
<p>Find me in app/views/admin/posts/create.html.erb</p>
|
|
@ -1,2 +0,0 @@
|
|||
<h1>Admin::Posts#destroy</h1>
|
||||
<p>Find me in app/views/admin/posts/destroy.html.erb</p>
|
|
@ -1,2 +0,0 @@
|
|||
<h1>Admin::Posts#edit</h1>
|
||||
<p>Find me in app/views/admin/posts/edit.html.erb</p>
|
|
@ -1,2 +0,0 @@
|
|||
<h1>Admin::Posts#index</h1>
|
||||
<p>Find me in app/views/admin/posts/index.html.erb</p>
|
|
@ -1,2 +0,0 @@
|
|||
<h3>新建博客</h3>
|
||||
<%= render "form" %>
|
|
@ -0,0 +1,2 @@
|
|||
h3 #{t('new_post')}
|
||||
= render 'form'
|
|
@ -1,2 +0,0 @@
|
|||
<h1>Admin::Posts#update</h1>
|
||||
<p>Find me in app/views/admin/posts/update.html.erb</p>
|
|
@ -1,13 +0,0 @@
|
|||
<div class="blog">
|
||||
<h2><%= link_to (post.title + "<strong> >></strong>").html_safe, blog_path(post) %></h2>
|
||||
<div class="content wikistyle"><%= post.content_html.html_safe %></div>
|
||||
<div class="cc">
|
||||
<%= t(:announce_at) %>
|
||||
<%= format_time(post.created_at) %> |
|
||||
<%= "浏览数 " + post.visited.to_s %> |
|
||||
<%= link_to t('comment'), blog_path(post) + "#disqus_thread" %> |
|
||||
<div class="bsync-custom icon-long-blue"><a title="一键分享到各大微博和社交网络" class="bshare-bsync" onclick="javascript:bSync.share(event,'', {title:'<%= post.title %>', summary: '<%= Nokogiri(HTML_Truncator.truncate(post.content_html, 100)).text.gsub("\n","") %>'})"></a></div>
|
||||
<script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bsync.js#uuid=df284dbb-7e09-4cac-9e90-5a186ac58e48"></script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom"></div>
|
|
@ -0,0 +1,11 @@
|
|||
.blog
|
||||
h2
|
||||
= link_to post.title, blog_path(post)
|
||||
.content.wikistyle
|
||||
= post.content_html.html_safe
|
||||
.cc
|
||||
= t(:announce_at)
|
||||
= format_time(post.created_at)
|
||||
| |
|
||||
= t(:visited_count) + post.visited.to_s
|
||||
.bottom
|
|
@ -1,16 +0,0 @@
|
|||
<div class="blogs">
|
||||
<% if @posts.size == 0 %>
|
||||
<div class="nocontent">没有新的内容, 感谢你的光临.</div>
|
||||
<% else %>
|
||||
<%= render :partial=> "post", :collection=> @posts %>
|
||||
<% end %>
|
||||
<% if @has_old %>
|
||||
<div class="has_old"><a href class="pagination" data-page="<%= @page + 1 %>">← 更早博客</a></div>
|
||||
<% end %>
|
||||
|
||||
<% if @has_new %>
|
||||
<div class="has_new"><a href class="pagination" data-page="<%= @page - 1 %>">更新博客 →</a></div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
.blogs
|
||||
- if @posts.size == 0
|
||||
.nocontent
|
||||
= t(:nocontent)
|
||||
- else
|
||||
= render :partial=> "post", :collection=> @posts
|
||||
- if @has_old
|
||||
.has_old
|
||||
a.pagination href="#" data-page="#{@page + 1}" #{t(:prev)}
|
||||
- if @has_new
|
||||
.has_new
|
||||
a.pagination href="#" data-page="#{@page - 1}" #{t(:next)}
|
|
@ -1,17 +0,0 @@
|
|||
<div class="blogs">
|
||||
<%= render :partial=> "post", :locals=> { :post=> @post } %>
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- Duoshuo Comment BEGIN -->
|
||||
<div class="ds-thread"></div>
|
||||
<script type="text/javascript">
|
||||
var duoshuoQuery = {short_name:"yafeilee"};
|
||||
(function() {
|
||||
var ds = document.createElement('script');
|
||||
ds.type = 'text/javascript';ds.async = true;
|
||||
ds.src = 'http://static.duoshuo.com/embed.js';
|
||||
ds.charset = 'UTF-8';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds);
|
||||
})();
|
||||
</script>
|
||||
<!-- Duoshuo Comment END -->
|
||||
</div>
|
|
@ -0,0 +1,2 @@
|
|||
.blogs
|
||||
= render :partial=> "post", :locals=> { :post=> @post }
|
|
@ -1,12 +0,0 @@
|
|||
<div class="slide">
|
||||
<div class="subscribe">
|
||||
<div class="subscribe_descrip">
|
||||
如果你想关注我的每一篇文章,推荐进行订阅, 将右面的链接复制到你的阅读器里吧.
|
||||
</div>
|
||||
<%= link_to(image_tag('rss.png'), rss_blogs_path) %>
|
||||
</div>
|
||||
<div class="broadcast"></div>
|
||||
<div class="comment"></div>
|
||||
<div class="recommend"></div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
.slide
|
||||
.subscribe
|
||||
.subscribe_descrip
|
||||
= t('rss_description')
|
||||
= link_to(image_tag('rss.png'), rss_blogs_path)
|
||||
.broadcast
|
||||
.comment
|
||||
.recommend
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>WinDy's Blog</title>
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<%= yield :js %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- head -->
|
||||
<div class="head">
|
||||
<div class="container">
|
||||
<ul class="nav">
|
||||
<li> <a id="home" href="/">首页<strong>Home</strong></a> </li>
|
||||
<li> <a id="tech" href="/tech">技术<strong>Tech</strong></a> </li>
|
||||
<li> <a id="life" href="/life">生活<strong>Life</strong></a> </li>
|
||||
<li> <a id="creator" href="creator">创业<strong>Creator</strong></a> </li>
|
||||
</ul>
|
||||
<strong class="descrip">WinDy的个人中心 - 记录人生经历 - 技术 生活 And 创业</strong>
|
||||
<a id="about" href="/about">关于我</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<%= yield %>
|
||||
<%= render "common/slide" %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-32883596-1']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,45 @@
|
|||
html
|
||||
head
|
||||
title WinDy's Blog
|
||||
= stylesheet_link_tag "application", :media => "all"
|
||||
= javascript_include_tag "application"
|
||||
= yield :js
|
||||
= csrf_meta_tags
|
||||
body
|
||||
.head
|
||||
.container
|
||||
ul.nav
|
||||
li
|
||||
a#home href="/"
|
||||
= t('head.home')
|
||||
strong Home
|
||||
li
|
||||
a#tech href="/tech"
|
||||
= t('head.tech')
|
||||
strong Tech
|
||||
li
|
||||
a#life href="/life"
|
||||
= t('head.life')
|
||||
strong Life
|
||||
li
|
||||
a#creator href="creator"
|
||||
= t('head.creator')
|
||||
strong Creator
|
||||
strong.descrip
|
||||
= t('head_description')
|
||||
a#about href="/about"
|
||||
= t('heade.about_me')
|
||||
.container
|
||||
= yield
|
||||
= render "common/slide"
|
||||
|
||||
javascript:
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-32883596-1']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
|
@ -1,2 +0,0 @@
|
|||
<h1>Photos#create</h1>
|
||||
<p>Find me in app/views/photos/create.html.erb</p>
|
|
@ -2,3 +2,17 @@ en:
|
|||
upload_photo: "上传图片"
|
||||
comment: "查看评论"
|
||||
announce_at: "发表在 "
|
||||
visited_count: "浏览数 "
|
||||
nocontent: "没有更多内容"
|
||||
prev: '← 更早博客'
|
||||
next: '更新博客 →'
|
||||
new_post: '新建博客'
|
||||
rss_description: '如果你想关注我的每一篇文章,推荐进行订阅, 将右面的链接复制到你的阅读器里吧.'
|
||||
head_description: 'WinDy的个人中心 - 记录人生经历 - 技术 生活 And 创业'
|
||||
|
||||
head:
|
||||
home: '首页'
|
||||
tech: '技术'
|
||||
life: '生活'
|
||||
creator: '创业'
|
||||
about_me: '关于我'
|
||||
|
|
Loading…
Reference in New Issue