Project

General

Profile

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

José Esteves, 2019-10-09 13:39

View differences:

app/views/issues/_action_menu.html.erb
1 1
<div class="contextual">
2
<%= 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? %>
2
<% if @issue.editable? %>
3
  <%= link_to l(:button_add_notes), edit_issue_path(@issue), :onclick => 'showAndScrollToAddNotes(); return false;', :class => 'icon icon-add' %>
4
  <%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollToEditIssue(); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
5
<% end %>
3 6
<%= 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) %>
4 7
<%= watcher_link(@issue, User.current) %>
5 8
<%= 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
3 3

  
4 4
<div style="clear: both;"></div>
5 5
<% if @issue.editable? %>
6
  <div id="update" style="display:none;">
6
  <div id="update" class="hidden">
7 7
    <h3><%= l(:button_edit) %></h3>
8 8
    <%= render :partial => 'edit' %>
9 9
  </div>
app/views/issues/_edit.html.erb
3 3
    <%= render :partial => 'conflict' if @conflict %>
4 4
    <div class="box">
5 5
    <% if @issue.attributes_editable? %>
6
        <fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend>
6
        <fieldset id="attributes" class="tabular"><legend><%= l(:label_change_properties) %></legend>
7 7
        <div id="all_attributes">
8 8
        <%= render :partial => 'form', :locals => {:f => f} %>
9 9
        </div>
10 10
        </fieldset>
11 11
    <% end %>
12 12
    <% if User.current.allowed_to?(:log_time, @project) %>
13
        <fieldset class="tabular"><legend><%= l(:button_log_time) %></legend>
13
        <fieldset id="log_time" class="tabular"><legend><%= l(:button_log_time) %></legend>
14 14
        <%= labelled_fields_for :time_entry, @time_entry do |time_entry| %>
15 15
        <div class="splitcontent">
16 16
        <div class="splitcontentleft">
......
28 28
    </fieldset>
29 29
    <% end %>
30 30
    <% if @issue.notes_addable? %>
31
      <fieldset><legend><%= l(:field_notes) %></legend>
31
      <fieldset id="add_notes"><legend><%= l(:field_notes) %></legend>
32 32
      <%= f.text_area :notes, :cols => 60, :rows => 10, :class => 'wiki-edit',
33 33
            :data => {
34 34
                :auto_complete => true,
......
44 44
      <%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
45 45
      </fieldset>
46 46

  
47
      <fieldset><legend><%= l(:label_attachment_plural) %></legend>
47
      <fieldset id="add_attachments"><legend><%= l(:label_attachment_plural) %></legend>
48 48
        <% if @issue.attachments.any? && @issue.safe_attribute?('deleted_attachment_ids') %>
49 49
        <div class="contextual"><%= link_to l(:label_edit_attachments), '#', :onclick => "$('#existing-attachments').toggle(); return false;" %></div>
50 50
        <div id="existing-attachments" style="<%= @issue.deleted_attachment_ids.blank? ? 'display:none;' : '' %>">
config/locales/en.yml
1087 1087
  button_edit: Edit
1088 1088
  button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
1089 1089
  button_add: Add
1090
  button_add_notes: Add notes
1090 1091
  button_change: Change
1091 1092
  button_apply: Apply
1092 1093
  button_clear: Clear
public/javascripts/application.js
28 28
  $('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
29 29
}
30 30

  
31
function showAndScrollToEditIssue() {
32
  $('#update h3').show();
33
  $('#attributes').show();
34
  $('#log_time').show();
35
  showAndScrollTo('update', 'issue_notes');
36
}
37

  
38
function showAndScrollToAddNotes() {
39
  $('#update h3').hide();
40
  $('#attributes').hide();
41
  $('#log_time').hide();
42
  showAndScrollTo('update', 'issue_notes');
43
}
44

  
31 45
function toggleRowGroup(el) {
32 46
  var tr = $(el).parents('tr').first();
33 47
  var n = tr.next();
public/stylesheets/application.css
128 128
div.modal .box p {margin: 0.3em 0;}
129 129

  
130 130
.clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; }
131

  
131
.hidden {display: none;}
132 132
.mobile-show {display: none;}
133 133

  
134 134
/***** Links *****/
(11-11/13)