Skip to content

Commit

Permalink
merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Nov 29, 2012
2 parents 58341ac + b199121 commit 0ddf930
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 38 deletions.
34 changes: 18 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# coding: utf-8
source 'https://rubygems.org'
source 'http://ruby.taobao.org'

gem "rails", "3.2.9"
gem "rails-i18n","0.1.8"
Expand All @@ -9,23 +9,16 @@ gem "jquery-atwho-rails", "0.1.6"
gem "md_emoji"
gem 'exception_notification'

group :assets do
gem 'sass-rails', "~> 3.2.3"
gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier', '>= 1.0.3'
end

# 上传组件
gem 'carrierwave', '0.6.2'
gem 'carrierwave-upyun', '0.1.5'
gem 'mini_magick','3.3', :require => false

# Mongoid 辅助插件
gem "mongoid", "3.0.1"
gem "mongoid", "3.0.14"
# gem 'mongo-rails-instrumentation','0.2.4'
gem 'mongoid_auto_increment_id', "0.5.0"
gem 'mongoid_rails_migrations', '~> 0.0.14'
gem "mongoid_colored_logger", :github => "huacnlee/mongoid_colored_logger"

# 用户系统
gem 'devise', '2.1.0'
Expand Down Expand Up @@ -74,13 +67,6 @@ gem "social-share-button", "~> 0.0.5"
# 表单
gem 'simple_form', "2.0.2"

# 用于组合小图片
gem "sprite-factory", "1.4.1", :require => false
gem 'chunky_png', "1.2.5", :require => false

# 禁用 assets 日志
gem 'quiet_assets', "1.0.1"

# API
gem 'grape', :github => 'intridea/grape', :branch => 'frontier'

Expand All @@ -102,8 +88,24 @@ group :development, :test do
gem 'api_taster'
gem "letter_opener"
gem 'thin'

# 禁用 assets 日志
gem 'quiet_assets', "1.0.1"

# 用于组合小图片
gem "sprite-factory", "1.4.1", :require => false
gem 'chunky_png', "1.2.5", :require => false

gem 'jasmine', '1.2.1'

gem "mongoid_colored_logger", "0.2.2"
end

group :assets do
gem 'sass-rails', "~> 3.2.3"
gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier', '>= 1.0.3'
gem 'turbo-sprockets-rails3', '0.3.2'
end

group :production do
Expand Down
36 changes: 21 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
GIT
remote: git://github.com/huacnlee/mongoid_colored_logger.git
revision: b6bf70abc264d9c093a78816334a969cab585946
specs:
mongoid_colored_logger (0.1.1)

GIT
remote: git://github.com/intridea/grape.git
revision: d24bd2f758544244ac65f19c69b94f0ffc34e71b
Expand All @@ -17,7 +11,7 @@ GIT
rack-mount

GEM
remote: https://rubygems.org/
remote: http://ruby.taobao.org/
specs:
actionmailer (3.2.9)
actionpack (= 3.2.9)
Expand Down Expand Up @@ -64,6 +58,7 @@ GEM
bootstrap_helper (1.4.1)
railties (~> 3.0)
thor (~> 0.14)
bson (1.7.1)
builder (3.0.4)
cancan (1.6.7)
capistrano (2.9.0)
Expand All @@ -88,7 +83,9 @@ GEM
cells (3.7.1)
actionpack (~> 3.0)
railties (~> 3.0)
celluloid (0.10.0)
celluloid (0.12.3)
facter (>= 1.6.12)
timers (>= 1.0.0)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
chunky_png (1.2.5)
Expand Down Expand Up @@ -180,19 +177,24 @@ GEM
mime-types (1.19)
mini_magick (3.3)
subexec (~> 0.1.0)
mongoid (3.0.1)
mongo (1.7.1)
bson (~> 1.7.1)
mongoid (3.0.14)
activemodel (~> 3.1)
moped (~> 1.1.1)
origin (~> 1.0.3)
moped (~> 1.1)
origin (~> 1.0)
tzinfo (~> 0.3.22)
mongoid_auto_increment_id (0.5.0)
mongoid (~> 3.0.0.rc)
mongoid_colored_logger (0.2.2)
mongo (~> 1.6)
mongoid
mongoid_rails_migrations (0.0.14)
activesupport (>= 3.0.0)
bundler (>= 1.0.0)
rails (>= 3.0.0)
railties (>= 3.0.0)
moped (1.1.2)
moped (1.3.0)
multi_json (1.0.4)
multi_xml (0.4.1)
multipart-post (1.1.4)
Expand All @@ -217,7 +219,7 @@ GEM
omniauth-oauth2 (1.0.0)
oauth2 (~> 0.5.0)
omniauth (~> 1.0)
origin (1.0.4)
origin (1.0.11)
orm_adapter (0.0.7)
polyglot (0.3.3)
postmark (0.9.15)
Expand Down Expand Up @@ -332,6 +334,9 @@ GEM
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
turbo-sprockets-rails3 (0.3.2)
railties (> 3.2.8, < 4.0.0)
sprockets (>= 2.0.0)
tzinfo (0.3.35)
uglifier (1.1.0)
execjs (>= 0.3.0)
Expand Down Expand Up @@ -380,9 +385,9 @@ DEPENDENCIES
md_emoji
memcache-client (= 1.8.5)
mini_magick (= 3.3)
mongoid (= 3.0.1)
mongoid (= 3.0.14)
mongoid_auto_increment_id (= 0.5.0)
mongoid_colored_logger!
mongoid_colored_logger (= 0.2.2)
mongoid_rails_migrations (~> 0.0.14)
newrelic_rpm
omniauth (~> 1.0.1)
Expand All @@ -406,6 +411,7 @@ DEPENDENCIES
social-share-button (~> 0.0.5)
sprite-factory (= 1.4.1)
thin
turbo-sprockets-rails3 (= 0.3.2)
uglifier (>= 1.0.3)
unicorn
will_paginate (= 3.0.2)
4 changes: 4 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def show
drop_breadcrumb("查看 #{@page.title}")
end
end

def comments
@page = Page.find_by_slug(params[:id])
end

def new
@page = Page.new
Expand Down
1 change: 0 additions & 1 deletion app/views/pages/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= simple_form_for @page do |f| %>
<%= render "shared/error_messages", :target => @page %>
<fieldset>
<legend><%= t("pages.edit_wiki_page")%></legend>
<%= render "shared/error_messages", :target => @page %>
Expand Down
6 changes: 6 additions & 0 deletions app/views/pages/comments.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="box">
<h1><%= link_to @page.title, page_path(@page.slug) %> 的评论</h1>
</div>
<div id="comments">
<%= render_cell :comments, :index, :commentable => @page, :current_user => current_user, :title => "评论" %>
</div>
10 changes: 7 additions & 3 deletions app/views/pages/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<div id="page_show" class="box">
<% if !@page.locked or admin? %>
<div class="info">
<%= link_to comments_page_path(@page.slug) do %>
<%= @page.comments_count %> 条评论
<% end %>,
版本 <%= render_page_version(@page) %><%= t("common.last_modified_at")%> <%= render_page_updated_at(@page) %>
<%= render_edit_page_button(@page) if can? :edit, @page %>
</div>
Expand All @@ -13,6 +16,9 @@
<%= raw @page.body_html %>
</div>
<div class="editors">
<div class="pull-right">
<%= link_to "发表评论", comments_page_path(@page.slug, :anchor => "new_comment"), :class => "btn btn-success" %>
</div>
<h3><%= t("pages.wiki_page_contributors")%></h3>
<div>
<% @page.editors.each do |item| %>
Expand All @@ -21,6 +27,4 @@
</div>
</div>
</div>
<div id="comments">
<%= render_cell :comments, :index, :commentable => @page, :current_user => current_user, :title => "评论" %>
</div>

2 changes: 1 addition & 1 deletion config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@
run "cd #{deploy_to}/current/; RAILS_ENV=production bundle exec rake db:migrate"
end

after "deploy:finalize_update","deploy:symlink", :init_shared_path, :link_shared_files #, :compile_assets, :sync_assets_to_cdn, :mongoid_migrate_database
after "deploy:finalize_update","deploy:symlink", :init_shared_path, :link_shared_files, :compile_assets, :sync_assets_to_cdn, :mongoid_migrate_database
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
get :recent
post :preview
end
member do
get :comments
end
end
resources :comments
resources :notes do
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/assets/resprite.rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'sprite_factory'
require 'chunky_png'
namespace :assets do
desc 'recreate sprite images and css'
task :resprite => :environment do
require 'sprite_factory'
require 'chunky_png'
SpriteFactory.library = :chunkypng
SpriteFactory.csspath = "image-path('sprites/$IMAGE')"
SpriteFactory.layout = "vertical"
Expand Down

0 comments on commit 0ddf930

Please sign in to comment.