Merge branch 'develop' into ouyangxuhua

Conflicts:
	app/helpers/application_helper.rb
This commit is contained in:
ouyangxuhua 2016-03-16 12:36:15 +08:00
commit ea6de1407e
5 changed files with 27 additions and 16 deletions

View File

@ -91,8 +91,12 @@ class BlogCommentsController < ApplicationController
def edit
@article = BlogComment.find(params[:id])
if User.current.admin? || User.current.id == @article.author_id
respond_to do |format|
format.html {render :layout=>'new_base_user'}
format.html { render :layout => 'new_base_user' }
end
else
render_403
end
end

View File

@ -2943,7 +2943,11 @@ int main(int argc, char** argv){
end
def user_url_in_org(user_id)
Setting.host_name + "/users/" + user_id.to_s
if Rails.env.development?
return "http://localhost:3000/users/" + user_id.to_s
else
return "https://" + Setting.host_name + "/users/" + user_id.to_s
end
end
def project_issues_url_in_org(project_id)
@ -3011,7 +3015,11 @@ def course_boards_url_in_org(course_id)
end
def logout_url_without_domain
Setting.host_name + "/logout"
if Rails.env.development?
return "http://localhost:3000/logout"
else
return "https://" + Setting.host_name + "/logout"
end
end
def signin_url_without_domain

View File

@ -1,6 +1,5 @@
<% if User.current.logged? && User.current.id == @user.id %>
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
<% end %>
<% end %>

View File

@ -38,7 +38,7 @@
<%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %>
</div>
<div class="postThemeWrap">
<% if @article.author.id == User.current.id%>
<% if @article.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
@ -48,7 +48,7 @@
l(:button_edit),
{:action => 'edit', :id => @article.id,:in_act => params[:in_act]},
:class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %>
) if User.current.admin? || User.current.id == @article.author.id %>
</li>
<li>
<%= link_to(
@ -57,7 +57,7 @@
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %>
) if User.current.admin? || User.current.id == @article.author.id %>
</li>
<li>
<% if @article.id == @article.blog.homepage_id %>

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
</div>
<div class="homepagePostDes">
<% if activity.author.id == User.current.id%>
<% if activity.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
@ -14,7 +14,7 @@
l(:button_edit),
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
:class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %>
) if User.current.admin? || User.current.id == activity.author.id %>
</li>
<li>
<%= link_to(
@ -23,7 +23,7 @@
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %>
) if User.current.admin? || User.current.id == activity.author.id %>
</li>
<li>
<% if activity.id == activity.blog.homepage_id %>