Project

General

Profile

Feature #3143 » 0001-Adds-Add-notes-link-to-issue-page-to-add-only-notes.patch

Marius BĂLTEANU, 2019-03-25 22:36

View differences:

app/views/issues/_action_menu.html.erb
<div class="contextual">
<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %>
<% if @issue.editable? %>
<%= link_to l(:button_add_notes), edit_issue_path(@issue), :onclick => 'showAndScrollToAddNotes(); return false;', :class => 'icon icon-add' %>
<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollToEditIssue(); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
<% end %>
<%= link_to l(:button_log_time), new_issue_time_entry_path(@issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %>
<%= watcher_link(@issue, User.current) %>
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %>
app/views/issues/_action_menu_edit.html.erb
<div style="clear: both;"></div>
<% if @issue.editable? %>
<div id="update" style="display:none;">
<div id="update" class="hidden">
<h3><%= l(:button_edit) %></h3>
<%= render :partial => 'edit' %>
</div>
app/views/issues/_edit.html.erb
<%= render :partial => 'conflict' if @conflict %>
<div class="box">
<% if @issue.attributes_editable? %>
<fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend>
<fieldset id="attributes" class="tabular"><legend><%= l(:label_change_properties) %></legend>
<div id="all_attributes">
<%= render :partial => 'form', :locals => {:f => f} %>
</div>
</fieldset>
<% end %>
<% if User.current.allowed_to?(:log_time, @project) %>
<fieldset class="tabular"><legend><%= l(:button_log_time) %></legend>
<fieldset id="log_time" class="tabular"><legend><%= l(:button_log_time) %></legend>
<%= labelled_fields_for :time_entry, @time_entry do |time_entry| %>
<div class="splitcontent">
<div class="splitcontentleft">
......
</fieldset>
<% end %>
<% if @issue.notes_addable? %>
<fieldset><legend><%= l(:field_notes) %></legend>
<fieldset id="add_notes"><legend><%= l(:field_notes) %></legend>
<%= f.text_area :notes, :cols => 60, :rows => 10, :class => 'wiki-edit', :no_label => true %>
<%= wikitoolbar_for 'issue_notes', preview_issue_path(:project_id => @project, :issue_id => @issue) %>
......
<%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
</fieldset>
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<fieldset id="add_attachments"><legend><%= l(:label_attachment_plural) %></legend>
<% if @issue.attachments.any? && @issue.safe_attribute?('deleted_attachment_ids') %>
<div class="contextual"><%= link_to l(:label_edit_attachments), '#', :onclick => "$('#existing-attachments').toggle(); return false;" %></div>
<div id="existing-attachments" style="<%= @issue.deleted_attachment_ids.blank? ? 'display:none;' : '' %>">
......
<%= hidden_field_tag 'issue_count', @issue_count if @issue_count %>
<% end %>
config/locales/en.yml
button_edit: Edit
button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
button_add: Add
button_add_notes: Add notes
button_change: Change
button_apply: Apply
button_clear: Clear
public/javascripts/application.js
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
}
function showAndScrollToEditIssue() {
$('#update h3').show();
$('#attributes').show();
$('#log_time').show();
showAndScrollTo('update', 'issue_notes');
}
function showAndScrollToAddNotes() {
$('#update h3').hide();
$('#attributes').hide();
$('#log_time').hide();
showAndScrollTo('update', 'issue_notes');
}
function toggleRowGroup(el) {
var tr = $(el).parents('tr').first();
var n = tr.next();
public/stylesheets/application.css
div.modal .box p {margin: 0.3em 0;}
.clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.hidden {display: none;}
.mobile-show {display: none;}
/***** Links *****/
(9-9/14)