修复匿名用户创建项目的问题
This commit is contained in:
parent
9beb8acb99
commit
0f82bbf797
|
@ -150,11 +150,15 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@issue_custom_fields = IssueCustomField.sorted.all
|
if User.current.login?
|
||||||
@trackers = Tracker.sorted.all
|
@issue_custom_fields = IssueCustomField.sorted.all
|
||||||
@project = Project.new
|
@trackers = Tracker.sorted.all
|
||||||
@project.safe_attributes = params[:project]
|
@project = Project.new
|
||||||
render :layout => 'base'
|
@project.safe_attributes = params[:project]
|
||||||
|
render :layout => 'base'
|
||||||
|
else
|
||||||
|
redirect_to signin_url
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def share
|
def share
|
||||||
|
@ -167,6 +171,10 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
unless User.current.login?
|
||||||
|
redirect_to signin_url
|
||||||
|
return
|
||||||
|
end
|
||||||
@issue_custom_fields = IssueCustomField.sorted.all
|
@issue_custom_fields = IssueCustomField.sorted.all
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
@project = Project.new
|
@project = Project.new
|
||||||
|
|
|
@ -93,21 +93,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<!--Document-->
|
|
||||||
<% elsif e.forge_act_type == "Document" %>
|
|
||||||
<div class="problem_main">
|
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
|
||||||
<div class="problem_txt fl mt5 break_word">
|
|
||||||
<a class="problem_name fl ">
|
|
||||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
|
||||||
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
|
||||||
|
|
||||||
<%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %><br />
|
|
||||||
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
|
|
||||||
<%= l :label_create_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<!--Attachment -->
|
<!--Attachment -->
|
||||||
<% elsif e.forge_act_type == "Attachment" %>
|
<% elsif e.forge_act_type == "Attachment" %>
|
||||||
<div class="problem_main">
|
<div class="problem_main">
|
||||||
|
|
Loading…
Reference in New Issue