Applied order for global template. (r-labs issueId: 1364)

This commit is contained in:
Akiko Takano 2015-03-01 06:19:56 +09:00
parent 64d7951431
commit ed59fa286e
2 changed files with 4 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class IssueTemplatesController < ApplicationController
end
end
@globalIssueTemplates = GlobalIssueTemplate.joins(:projects).where(["projects.id = ?", @project.id])
@globalIssueTemplates = GlobalIssueTemplate.joins(:projects).where(["projects.id = ?", @project.id]).order('position')
render :layout => !request.xhr?
end
@ -140,7 +140,7 @@ class IssueTemplatesController < ApplicationController
end
@globalIssueTemplates = GlobalIssueTemplate.joins(:projects).where(["tracker_id = ? AND projects.id = ?",
@tracker.id, @project.id])
@tracker.id, @project.id]).order('position')
if @globalIssueTemplates.any?
@ -165,7 +165,7 @@ class IssueTemplatesController < ApplicationController
@issue_template = IssueTemplate.find(params[:id]) if params[:id]
render :partial => 'common/preview'
end
# Reorder templates
def move
move_order(params[:to])

View File

@ -9,6 +9,7 @@
{:controller => 'issue_templates', :action => 'new', :project_id => @project},
:class => 'icon icon-add') %>
</div>
<div style="clear:both;"></div>
<% if @notice -%>
<div class="flash notice"><%= @notice -%></div>