Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change the fallbacks

  • Loading branch information...
commit a9849f3ad8d42f61b4a2743e4507b10e0f6f613e 1 parent 5783aaf
Leedy 刘当一 liudangyi authored
0  app/assets/images/fallback/big_default.jpg → app/assets/images/fallback/big_default.png
View
File renamed without changes
BIN  app/assets/images/fallback/default.jpg
View
Deleted file not rendered
0  app/assets/images/fallback/thumb_default.jpg → app/assets/images/fallback/default.png
View
File renamed without changes
BIN  app/assets/images/fallback/default_pic.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/fallback/small_default.jpg
View
Deleted file not rendered
BIN  app/assets/images/fallback/small_default.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/fallback/thumb_default.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2  app/controllers/bigpics_controller.rb
View
@@ -17,7 +17,7 @@ def show
@bigpic = Bigpic.find(params[:id])
respond_to do |format|
- format.html # show.html.erb
+ format.html { redirect_to bigpics_path.to_s + "##{@bigpic.id}" }
format.json { render json: @bigpic }
end
end
4 app/uploaders/avatar_uploader.rb
View
@@ -23,7 +23,7 @@ def store_dir
# Provide a default URL as a default if there hasn't been a file uploaded:
def default_url
# # For Rails 3.1+ asset pipeline compatibility:
- asset_path("fallback/" + [version_name, "default.jpg"].compact.join('_'))
+ asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
end
# Process files as they are uploaded:
@@ -39,7 +39,7 @@ def default_url
end
version :small do
- process :resize_to_fit => [250, 250]
+ process :resize_to_fit => [180, 180]
end
version :big do
2  app/uploaders/bigpic_uploader.rb
View
@@ -25,7 +25,7 @@ def default_url
# For Rails 3.1+ asset pipeline compatibility:
# asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
- "/images/fallback/" + [version_name, "default.png"].compact.join('_')
+ asset_path("fallback/default_pic.jpg")
end
# Process files as they are uploaded:
2  app/views/bigpics/show.html.slim
View
@@ -1,5 +1,5 @@
- if notice
- p#notice.alert.alert-success = notice
+ p#notice.alert = notice
h3
= @bigpic.title
4 app/views/home/index.html.slim
View
@@ -178,5 +178,5 @@
.yellow-ribbon
h4: a 相关链接
.relative-link
- a href="http://www.pku.edu.cn/" 北京大学
- a href="http://www.bdwm.net/" 北大未名BBS
+ a href="http://www.pku.edu.cn/" target="_blank" 北京大学
+ a href="http://www.bdwm.net/" target="_blank" 北大未名BBS
3  app/views/layouts/devise/sessions.html.slim
View
@@ -22,7 +22,8 @@ html
li = link_to '讨论版', posts_path
li = link_to '支持我们', donates_path
li = link_to '近期活动', events_path
- li = link_to '用户管理', user_manage_index_path
+ - if admin?
+ li = link_to '用户管理', user_manage_index_path
ul.nav.pull-right
- if not user_signed_in?
li = link_to '登陆', new_user_session_path
4 app/views/messages/index.html.slim
View
@@ -43,7 +43,7 @@ h1 留言板
}
.msg-form
- = current_user ? image_tag(current_user.avatar, width: '50', height: '50', class: 'pull-left') : image_tag("fallback/default.jpg", width: '50', class: 'pull-left')
+ = current_user ? image_tag(current_user.avatar, width: '50', height: '50', class: 'pull-left') : image_tag("fallback/default.png", width: '50', class: 'pull-left')
= form_for(@message) do |f|
= f.text_area :content, rows: 3, placeholder: '你想说什么?'
button type="submit" class="btn btn-primar-0-y" 留言
@@ -51,7 +51,7 @@ h1 留言板
ul.unstyled
- @messages.each do |message|
li.msg-li
- = message.author ? image_tag(message.author.avatar, width: '50', height: '50', class: 'pull-left') : image_tag("fallback/default.jpg", width: '50', class: 'pull-left')
+ = message.author ? image_tag(message.author.avatar, width: '50', height: '50', class: 'pull-left') : image_tag("fallback/default.png", width: '50', class: 'pull-left')
div style="margin-left: 60px;"
small.author = message.author ? message.author.name : "匿名用户"
|   
15 app/views/posts/show.html.slim
View
@@ -52,10 +52,7 @@
}
.post
- - if @post.author
- = image_tag @post.author.avatar, width: '80', height: '80', class: 'pull-left'
- - else
- = image_tag("fallback/default.jpg", width: '80', class: 'pull-left')
+ = image_tag @post.author.avatar, width: '80', height: '80', class: 'pull-left'
div style="margin-left: 90px; min-height: 80px;"
h4 style="margin-top: 0px;" = @post.title
p
@@ -75,10 +72,7 @@ ul.comments.unstyled
- if admin?
= link_to delete_comment_post_path(comment_id: comment.id), :remote => true, class: "delete-alert" do
i.icon-remove
- - if comment.author
- = image_tag comment.author.avatar, width: '50', height: '50', class: 'pull-left'
- - else
- = image_tag "fallback/default.jpg", width: '50', height: '50', class: 'pull-left'
+ = image_tag comment.author.avatar, width: '50', height: '50', class: 'pull-left'
div style="margin-left: 60px;"
p
- if comment.author
@@ -89,10 +83,7 @@ ul.comments.unstyled
small.time = beautify_time(comment.created_at) if comment.created_at
== comment.content
li.comment.cmt-form
- - if current_user
- = image_tag current_user.avatar, width: '50', height: '50', class: 'pull-left'
- - else
- = image_tag "fallback/default.jpg", width: '50', height: '50', class: 'pull-left'
+ = image_tag current_user.avatar, width: '50', height: '50', class: 'pull-left'
= form_for @comment, url: comment_post_path do |f|
= f.text_area :content, rows: 3, placeholder: '回复'
button type="submit" class="btn btn-primar-0-y" 回复
2  config/routes.rb
View
@@ -3,7 +3,7 @@
resources :mates
- resources :events, except: [:show] do
+ resources :events do
member do
get 'finish'
get 'unfinish'
Please sign in to comment.
Something went wrong with that request. Please try again.