diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 70a7fe1..b8b77fd 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -128,6 +128,9 @@ end %>
<%= render :partial => 'action_menu' %> +<% if @issue.editable? || User.current.allowed_to?(:add_issue_notes, @project) %> + <%= render :partial => 'journals/notes_new_form' %> +<% end %>
<% if @issue.editable? %> diff --git a/app/views/journals/_notes_new_form.html.erb b/app/views/journals/_notes_new_form.html.erb new file mode 100644 index 0000000..ddf6269 --- /dev/null +++ b/app/views/journals/_notes_new_form.html.erb @@ -0,0 +1,27 @@ +
+ <%= link_to l('button_add_notes'), {}, :id => "add-note", :class => "icon icon-comment", :onclick => "showAddNotesForm(); return false;"%> + +
+ <%= labelled_form_for @issue, :html => {:id => 'journal-new-form', :multipart => true} do |f| %> +
+ <%= l(:field_notes) %> + <%= f.text_area :notes, :id => "journal_new_notes", :class => 'wiki-edit', :rows => 10, :no_label => true %> + + <% if @issue.safe_attribute? 'private_notes' %> + <%= f.check_box :private_notes, :no_label => true %> + + <% end %> + <%= call_hook(:view_journals_notes_form_after_notes, { :issue => @issue}) %> + +

<%= render :partial => 'attachments/form', :locals => {:container => @issue} %>

+
+

<%= submit_tag l(:button_submit) %> + <%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), + "journal-new-form", + "journal_new_preview" %> | + <%= link_to l(:button_cancel), '#', :onclick => "hideAddNotesForm(); return false;" %>

+ +
+<% end %> +<%= wikitoolbar_for "journal_new_notes" %> +
diff --git a/config/locales/en.yml b/config/locales/en.yml index c198851..f8d93a7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1042,6 +1042,7 @@ en: button_close: Close button_reopen: Reopen button_import: Import + button_add_notes: Add notes status_active: active status_registered: registered diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 3409bc6..7057ffe 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -680,6 +680,16 @@ function toggleDisabledOnChange() { function toggleDisabledInit() { $('input[data-disables], input[data-enables]').each(toggleDisabledOnChange); } + +function showAddNotesForm(){ + $('#journal-new-form').show().find('#journal_new_notes').focus(); + $("a#add-note").hide(); +} +function hideAddNotesForm(){ + $('#journal-new-form').hide(); + $('#add-note').show(); +} + $(document).ready(function(){ $('#content').on('change', 'input[data-disables], input[data-enables]', toggleDisabledOnChange); toggleDisabledInit(); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 6ee3031..953779d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -380,6 +380,10 @@ div.issue.overdue .due-date .value { color: #c22; } #issue_tree td.checkbox, #relations td.checkbox {display:none;} #relations td.buttons {padding:0;} +#quick-note {margin-top: 5px; line-height: 1.4em;} +#quick-note fieldset {margin-top: 5px; background-color: #f6f6f6;} +#quick-note #journal-new-form {display: none;} + 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); }