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
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', :no_label => true %>
33 33
      <%= wikitoolbar_for 'issue_notes', preview_issue_path(:project_id => @project, :issue_id => @issue) %>
34 34

  
......
39 39
      <%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
40 40
      </fieldset>
41 41

  
42
      <fieldset><legend><%= l(:label_attachment_plural) %></legend>
42
      <fieldset id="add_attachments"><legend><%= l(:label_attachment_plural) %></legend>
43 43
        <% if @issue.attachments.any? && @issue.safe_attribute?('deleted_attachment_ids') %>
44 44
        <div class="contextual"><%= link_to l(:label_edit_attachments), '#', :onclick => "$('#existing-attachments').toggle(); return false;" %></div>
45 45
        <div id="existing-attachments" style="<%= @issue.deleted_attachment_ids.blank? ? 'display:none;' : '' %>">
......
76 76
    <%= hidden_field_tag 'issue_count', @issue_count if @issue_count %>
77 77

  
78 78
<% end %>
79

  
config/locales/en.yml
1060 1060
  button_edit: Edit
1061 1061
  button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
1062 1062
  button_add: Add
1063
  button_add_notes: Add notes
1063 1064
  button_change: Change
1064 1065
  button_apply: Apply
1065 1066
  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
118 118
div.modal .box p {margin: 0.3em 0;}
119 119

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

  
121
.hidden {display: none;}
122 122
.mobile-show {display: none;}
123 123

  
124 124
/***** Links *****/
(9-9/13)