Feature #3143 » add_notes.diff
| 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? %>
|
||
|
<%= link_to l(:button_add_notes), edit_issue_path(@issue), :onclick => 'showAndScrollTo("new-notes-form", "new_notes"); return false;', :class =>'icon icon-comment' if User.current.allowed_to?(:add_issue_notes, @project) %>
|
||
|
<%= 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? && User.current.allowed_to?(:edit_issues, @project) %>
|
||
|
<%= 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/show.html.erb | ||
|---|---|---|
|
</div>
|
||
|
<%= render :partial => 'action_menu' %>
|
||
|
<div style="clear: both;"></div>
|
||
|
<% if @issue.editable? %>
|
||
|
<div id="update" style="display:none;">
|
||
|
<h3><%= l(:button_edit) %></h3>
|
||
|
<%= render :partial => 'edit' %>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
<% if @changesets.present? %>
|
||
|
<div id="issue-changesets">
|
||
|
<h3><%=l(:label_associated_revisions)%></h3>
|
||
| ... | ... | |
|
</div>
|
||
|
<% end %>
|
||
|
<div style="clear: both;"></div>
|
||
|
<%= render :partial => 'action_menu' %>
|
||
|
<div style="clear: both;"></div>
|
||
|
<% if @issue.editable? %>
|
||
|
<div id="update" style="display:none;">
|
||
|
<h3><%= l(:button_edit) %></h3>
|
||
|
<%= render :partial => 'edit' %>
|
||
|
</div>
|
||
|
<% if @issue.editable? || User.current.allowed_to?(:add_issue_notes, @project) %>
|
||
|
<%= render :partial => 'journals/new_notes_form' %>
|
||
|
<% end %>
|
||
|
<% other_formats_links do |f| %>
|
||
| app/views/journals/_new_notes_form.html.erb | ||
|---|---|---|
|
<div id="new-notes">
|
||
|
<div style="clear: both"></div>
|
||
|
<%= labelled_form_for @issue, :html => {:id => 'new-notes-form', :multipart => true} do |f| %>
|
||
|
<h4><%= l(:field_add_notes) %></h4>
|
||
|
<div class="box">
|
||
|
<fieldset><legend><%= l(:field_notes) %></legend>
|
||
|
<%= f.text_area :notes, :id => "new_notes", :class => 'wiki-edit', :rows => 10, :no_label => true %>
|
||
|
<%= wikitoolbar_for "new_notes" %>
|
||
|
<% if @issue.safe_attribute? 'private_notes' %>
|
||
|
<%= f.check_box :private_notes, :id => "private_new_notes", :no_label => true %>
|
||
|
<label for="private_new_notes"><%= l(:field_private_notes) %> </label>
|
||
|
<% end %>
|
||
|
<%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
|
||
|
</fieldset>
|
||
|
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
||
|
<p><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
|
||
|
</fieldset>
|
||
|
</div>
|
||
|
<p><%= submit_tag l(:button_submit) %>
|
||
|
<%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue),
|
||
|
"new-notes-form",
|
||
|
"new_notes_preview" %>
|
||
|
<div id="new_notes_preview" class="wiki"></div>
|
||
|
<% end %>
|
||
|
</div>
|
||
| app/views/journals/new.js.erb | ||
|---|---|---|
|
$('#issue_notes').val("<%= raw escape_javascript(@content) %>");
|
||
|
$('#new_notes').val("<%= raw escape_javascript(@content) %>");
|
||
|
<%
|
||
|
# when quoting a private journal, check the private checkbox
|
||
|
if @journal && @journal.private_notes?
|
||
|
%>
|
||
|
$('#issue_private_notes').prop('checked', true);
|
||
|
$('#private_new_notes').prop('checked', true);
|
||
|
<% end %>
|
||
|
showAndScrollTo("update", "notes");
|
||
|
$('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight;
|
||
|
showAndScrollTo("new-notes-form", "new_notes");
|
||
|
$('#new_notes').scrollTop = $('#new_notes').scrollHeight - $('#new_notes').clientHeight;
|
||
| config/locales/en.yml | ||
|---|---|---|
|
field_issue: Issue
|
||
|
field_status: Status
|
||
|
field_notes: Notes
|
||
|
field_add_notes: Add notes
|
||
|
field_is_closed: Issue closed
|
||
|
field_is_default: Default value
|
||
|
field_tracker: Tracker
|
||
| ... | ... | |
|
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/attachments.js | ||
|---|---|---|
|
Copyright (C) 2006-2016 Jean-Philippe Lang */
|
||
|
function addFile(inputEl, file, eagerUpload) {
|
||
|
if ($('#attachments_fields').children().length < 10) {
|
||
|
var attachmentsField = $(inputEl).parents('form').find('#attachments_fields')
|
||
|
if (attachmentsField.children().length < 10) {
|
||
|
var attachmentId = addFile.nextAttachmentId++;
|
||
| ... | ... | |
|
$('<input>', { type: 'text', 'class': 'filename readonly', name: 'attachments[' + attachmentId + '][filename]', readonly: 'readonly'} ).val(file.name),
|
||
|
$('<input>', { type: 'text', 'class': 'description', name: 'attachments[' + attachmentId + '][description]', maxlength: 255, placeholder: $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
|
||
|
$('<a> </a>').attr({ href: "#", 'class': 'remove-upload' }).click(removeFile).toggle(!eagerUpload)
|
||
|
).appendTo('#attachments_fields');
|
||
|
).appendTo(attachmentsField);
|
||
|
if(eagerUpload) {
|
||
|
ajaxUpload(file, attachmentId, fileSpan, inputEl);
|
||
| ... | ... | |
|
function addInputFiles(inputEl) {
|
||
|
var clearedFileInput = $(inputEl).clone().val('');
|
||
|
var attachmentsField = $(inputEl).parents('form').find('#attachments_fields')
|
||
|
if ($.ajaxSettings.xhr().upload && inputEl.files) {
|
||
|
// upload files using ajax
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
clearedFileInput.insertAfter('#attachments_fields');
|
||
|
clearedFileInput.insertAfter(attachmentsField);
|
||
|
}
|
||
|
function uploadAndAttachFiles(files, inputEl) {
|
||
| ... | ... | |
|
blockEventPropagation(e);
|
||
|
if ($.inArray('Files', e.dataTransfer.types) > -1) {
|
||
|
uploadAndAttachFiles(e.dataTransfer.files, $('input:file.file_selector'));
|
||
|
uploadAndAttachFiles(e.dataTransfer.files, $(this).find('input:file.file_selector'));
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
$.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
|
||
|
$('form div.box').has('input:file').each(function() {
|
||
|
$(this).on({
|
||
|
$(this).off().on({
|
||
|
dragover: dragOverHandler,
|
||
|
dragleave: dragOutHandler,
|
||
|
drop: handleFileDropEvent
|
||
| public/stylesheets/application.css | ||
|---|---|---|
|
#issue_tree td.checkbox, #relations td.checkbox {display:none;}
|
||
|
#relations td.buttons {padding:0;}
|
||
|
#new-notes {margin-top: 5px; line-height: 1.4em;}
|
||
|
#new-notes fieldset {margin-top: 5px; background-color: #f6f6f6;}
|
||
|
#new-notes #new-notes-form {display: inline;}
|
||
|
fieldset.collapsible {border-width: 1px 0 0 0;}
|
||
|
fieldset.collapsible>legend { padding-left: 16px; background: url(../images/arrow_expanded.png) no-repeat 0% 40%; cursor:pointer; }
|
||
|
fieldset.collapsible.collapsed>legend { background-image: url(../images/arrow_collapsed.png); }
|
||