Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Render template dropdown on the same row with the tracker #160

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions app/views/issue_templates/_issue_select_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<% return '' unless @issue.project.module_enabled? :issue_templates %>
<% return '' unless User.current.allowed_to?(:show_issue_templates, @issue.project) %>
<div id="template_area" style="display: none;">
<p>
<label for="issue_template"><%=h l(:issue_template)%></label>
<select id="issue_template" name="issue_template">
<option value="">---</option>
</select>

<a class="icon template_tooltip" id="link_template_dialog">
<a class="icon-only template_tooltip" id="link_template_dialog">
<%=h l(:display_and_filter_issue_templates_in_dialog, default: 'Filter Templates') %>
</a>
<% if setting.enable_help? %>
Expand All @@ -16,10 +15,10 @@
<%= l(:label_help_message) %>
</a>
<% end %>
<a class="icon icon-erase" title="<%= l(:erase_issue_subject_and_description, default: 'Erase') %>" id="erase_template">
<a class="icon-only icon-erase" title="<%= l(:erase_issue_subject_and_description, default: 'Erase') %>" id="erase_template">
<%= l(:erase_issue_subject_and_description, default: 'Erase') %>
</a>
<a class="icon icon-reload disabled" title="<%= l(:revert_before_applying_template, default: 'Revert') %>"
<a class="icon-only icon-reload disabled" title="<%= l(:revert_before_applying_template, default: 'Revert') %>"
id="revert_template" disabled="disabled">
<%= l(:revert_before_applying_template, default: 'Revert') %>
</a>
Expand All @@ -30,7 +29,6 @@
<span id="original_subject" style="display: none;"></span>
<span id="original_description" style="display: none;"></span>
<span id="template_status-area"></span>
</p>

<!-- dialog box -->
<div id="issue_template_dialog" style="overflow:visible; display: none;">
Expand Down Expand Up @@ -59,7 +57,7 @@
var tracker = '<%= @issue.tracker.id %>';
templateNS.set_pulldown(tracker, pulldown_url);

$('#template_area').insertBefore($('#issue_subject').parent());
$('#issue_tracker_id').parent('p').append($('#template_area'));

$("#issue_template").change(function(){
var is_triggered_by_status = '<%= is_triggered_by_status %>';
Expand Down
16 changes: 16 additions & 0 deletions assets/stylesheets/issue_templates.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
margin: 4px;
}

#template_area {
display: inline-block;
}

#template_area label {
float: none;
margin-left: 10px;
}

#template_area a {
display: inline-block;
margin-right: .85em;
Expand Down Expand Up @@ -267,3 +276,10 @@ div.form-inline.issue_templates #enabled_help_content {
a.icon.icon-del[disabled=disabled] {
opacity: 0.5;
}

@media screen and (max-width: 899px)
{
#template_area label {
margin-left: 0;
}
}
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# English strings go here for Rails i18n
en:
issue_templates: Issue templates
issue_template: Issue template
issue_template: Template
issue_template_note: Note
label_enabled: Enable
label_disabled: Disable
Expand Down