Initial Redmine tooling and local plugin forks
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<%= form_for @note, :as => :note, :remote => true, :url => add_note_url(note_source, @project), :html => {:multipart => true, :id => "add_note_form"} do |f| %>
|
||||
<%= render :partial => 'notes/form', :locals => {:f => f, :ajax_form => true} %>
|
||||
|
||||
<%= submit_tag l(:button_add_note), :id => "submit_add_note_form", :class => "button-small" %>
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_crm_note_show_extras), {}, :onclick => "$('#note_attributes .extended-attributes').toggle(); $('#note_attributes').toggleClass('box'); return false;" , :id => 'show_note_form_extras', :style => "float:right;" %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,22 @@
|
||||
<%= error_messages_for 'note' %>
|
||||
|
||||
<div id="note_attributes">
|
||||
<p class="extended-attributes" style="display: none;">
|
||||
<%= f.select :type_id, collection_for_note_types_select %>
|
||||
<label><%= l(:label_date) %>:</label>
|
||||
<%= f.text_field :created_on, :size => 15, :value => (@note.try(:created_on) || Date.today).to_date %><%= f.text_field :note_time, :value => (@note.try(:created_on) || Time.now).to_s(:time), :size => 5 %><%= calendar_for "note_created_on" %>
|
||||
</p>
|
||||
<%= f.text_area :content, :rows => 6, :class => 'wiki-edit' %><%# wikitoolbar_for 'note_content' %>
|
||||
<% if @note && @note.custom_field_values.any? %>
|
||||
<fieldset class="tabular extended-attributes" style="display: none;"><legend><%= l(:label_custom_field_plural) %></legend>
|
||||
<% @note.custom_field_values.each do |value| %>
|
||||
<p>
|
||||
<%= custom_field_tag_with_label :note, value %>
|
||||
</p>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<fieldset class="extended-attributes" style="display: none;"><legend><%= l(:label_attachment_plural) %></legend>
|
||||
<p id="note_attachments"><%= render :partial => 'attachments/form', :locals => {:container => @note} %></p>
|
||||
</fieldset>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<% if last_notes && last_notes.any? %>
|
||||
<h3><%= l(:label_crm_last_notes) %></h3>
|
||||
<div id="notes">
|
||||
<% last_notes.each do |note| %>
|
||||
<%= render :partial => 'notes/note_data', :locals => {:limit => 100}, :object => note %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,19 @@
|
||||
<% limit = -1 if limit.blank? %>
|
||||
<table class="note_data">
|
||||
<tr>
|
||||
<td class="avatar"><%= link_to avatar_to(note_data.source, :size => "32"), note_source_url(note_data.source), :id => "avatar" %></td>
|
||||
<td class="name">
|
||||
<h4 class="contacts_header">
|
||||
<%= note_type_icon(note_data) %>
|
||||
<%= link_to_source note_data.source %>,
|
||||
<%= time_tag(note_data.created_on) %>
|
||||
<%= l(:label_crm_time_ago) %>
|
||||
<%= link_to('¶'.html_safe, {:controller => 'notes', :action => 'show', :project_id => @project, :id => note_data}, :title => l(:button_show), :class => "wiki-anchor") %>
|
||||
</h4>
|
||||
<div class="note content preview">
|
||||
<%= truncate(note_data.content, :length => limit) %>
|
||||
<p><%= "<strong>#{l(:label_file_plural)}:</strong> #{note_data.attachments.collect{|a| a.filename}.join(', ')}".html_safe if note_data.attachments.any? %></p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,15 @@
|
||||
<div class="note_data_header">
|
||||
<table class="note_data">
|
||||
<tr>
|
||||
|
||||
<td class="avatar"><%= link_to avatar_to(note_header.source, :size => "32"), note_source_url(note_header.source), :id => "avatar" %> </td>
|
||||
<td class="name">
|
||||
<h2 class="note_title">
|
||||
<%= note_type_icon(note_header) %>
|
||||
<%= l(:label_crm_note_for) %> <%= note_header.source.name %>
|
||||
</h2>
|
||||
<p><%= authoring note_header.created_on, note_header.author %></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,52 @@
|
||||
<% show_info = true if show_info.nil? %>
|
||||
<% show_author = true if !show_author.nil? %>
|
||||
|
||||
<div id=<%="note_#{note_item.id}"%>>
|
||||
<table class="note_data">
|
||||
<tr>
|
||||
|
||||
<% if show_info %>
|
||||
<% if show_author %>
|
||||
<td class="avatar"><%= link_to avatar(note_item.author, :size => "32"), note_source_url(note_item.source), :id => "avatar" %></td>
|
||||
<% else %>
|
||||
<td class="avatar"><%= link_to avatar_to(note_item.source, :size => "32"), note_source_url(note_item.source), :id => "avatar" %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<td class="name">
|
||||
<div class="contextual">
|
||||
<%= link_to(image_tag('edit.png'), {:controller => 'notes', :action => 'edit', :project_id => @project, :id => note_item}, :class => "delete", :title => l(:button_edit)) if note_item.editable_by?(User.current, @project) %>
|
||||
|
||||
<%= link_to(image_tag('delete.png'),
|
||||
{:controller => :notes, :action => 'destroy', :id => note_item, :project_id => @project},
|
||||
:remote => true,
|
||||
:method => :delete,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => "delete", :title => l(:button_delete)) if note_item.destroyable_by?(User.current, @project) %>
|
||||
</div>
|
||||
<h4>
|
||||
<%= note_type_icon(note_item) %>
|
||||
<%= "#{note_item.subject} - " unless note_item.subject.blank? %>
|
||||
<%= link_to_source(note_item.source) + "," if show_info %>
|
||||
<%= authoring_note note_item.created_on, note_item.author %>
|
||||
<%= link_to('¶'.html_safe, {:controller => 'notes', :action => 'show', :project_id => @project, :id => note_item}, :title => l(:button_show), :class => "wiki-anchor") %>
|
||||
</h4>
|
||||
<div class="custom_fields">
|
||||
<% note_item.custom_values.each do |custom_value| %>
|
||||
<% if !custom_value.value.blank? %>
|
||||
<p><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="note">
|
||||
<div class="wiki">
|
||||
<%= note_content(note_item) %>
|
||||
</div>
|
||||
<%= auto_contacts_thumbnails(note_item) %>
|
||||
<%= render :partial => 'attachments/links', :locals => {:attachments => note_item.attachments, :options => {}} if note_item.attachments.any? %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<% unless @notes.empty? %>
|
||||
<% @notes.each do |note| %>
|
||||
<%= render :partial => 'notes/note_data', :locals => {:limit => 1000}, :object => note %>
|
||||
<% end %>
|
||||
<span class="pagination"> <%= pagination_links_full @notes_pages %> </span>
|
||||
<% else %>
|
||||
<p class="nodata"><%=l(:label_no_data)%></p>
|
||||
<% end %>
|
||||
@@ -0,0 +1,4 @@
|
||||
$('#notes').prepend("<%= escape_javascript(render(:partial => 'notes/note_item', :object => @note, :locals => {:note_source => @note_source})) %>")
|
||||
$('#note_<%= @note.id %>').effect('highlight', {}, 1000);
|
||||
$('#note_attachments').html("<%= escape_javascript(render(:partial => 'attachments/form')) %>");
|
||||
$('#add_note_form').get(0).reset();
|
||||
@@ -0,0 +1 @@
|
||||
$('#note_<%= params[:id] %>').effect('fade', {}, 1000);
|
||||
@@ -0,0 +1,51 @@
|
||||
<%= breadcrumb link_to(@note.source.name, note_source_url(@note.source)) %>
|
||||
|
||||
<%= render :partial => 'note_header', :object => @note %>
|
||||
|
||||
<%= form_for @note, :url => {:controller => "notes", :action => 'update', :project_id => @project, :id => @note}, :html => { :multipart => true} do |f| %>
|
||||
<div class = "box">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label><%= l(:field_type) %></label><br /><%= f.select :type_id, collection_for_note_types_select %>
|
||||
</td>
|
||||
<td>
|
||||
<label><%= l(:field_note_date) %></label><br /><%= f.text_field :created_on, :value => @note.created_on.to_date, :size => 15 %><%= f.text_field :note_time, :value => (@note.created_on || Time.now).to_s(:time), :size => 5 %><%= calendar_for "note_created_on" %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class = "content"><%= f.text_area :content , :cols => 80, :rows => 8, :class => 'wiki-edit', :label=>l(:field_contact_background) %>
|
||||
<%= wikitoolbar_for 'note_content' %> </p>
|
||||
<% if @note.custom_field_values.any? %>
|
||||
<fieldset class="tabular" ><legend><%= l(:label_custom_field_plural) %></legend>
|
||||
<% @note.custom_field_values.each do |value| %>
|
||||
<p>
|
||||
<%= custom_field_tag_with_label :note, value %>
|
||||
</p>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<%= link_to_attachments @note, :author => false %>
|
||||
</div>
|
||||
|
||||
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
||||
<p><%= render :partial => 'attachments/form', :locals => {:container => @note} %></p>
|
||||
</fieldset>
|
||||
<br>
|
||||
<%= submit_tag l(:button_save) -%>
|
||||
<% end -%>
|
||||
|
||||
<% html_title "#{l(:label_crm_note_for)} #{@note.source.name}" %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'common/sidebar' %>
|
||||
|
||||
<%= render :partial => 'common/recently_viewed' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %>
|
||||
<%= stylesheet_link_tag :contacts, :plugin => 'redmine_contacts' %>
|
||||
<%= stylesheet_link_tag :contacts_sidebar, :plugin => 'redmine_contacts' %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,57 @@
|
||||
<%= breadcrumb link_to(@note.source.name, note_source_url(@note.source)) %>
|
||||
|
||||
<%= render :partial => 'note_header', :object => @note %>
|
||||
|
||||
<div class = "box">
|
||||
<% form_for :note, @note, :url => {:controller => "notes", :action => 'create', :project_id => @project, :id => @note}, :html => { :multipart => true} do |f| %>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label><%= l(:field_type) %></label><br /><%= f.select :type_id, collection_for_note_types_select, { :include_blank => true } %>
|
||||
</td>
|
||||
<td>
|
||||
<label><%= l(:field_note_date) %></label><br /><%= f.text_field :created_on, :size => 15 %><%= calendar_for "note_created_on" %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<span class="note-custom-fields">
|
||||
<% @note.custom_field_values.each do |value| %>
|
||||
<p>
|
||||
<%= custom_field_tag_with_label :note, value %>
|
||||
</p>
|
||||
<% end -%>
|
||||
</span>
|
||||
<p class = "content"><%= f.text_area :content , :cols => 80, :rows => 8, :class => 'wiki-edit', :label=>l(:field_contact_background) %>
|
||||
<%= wikitoolbar_for 'note_content' %> </p>
|
||||
<%= link_to_attachments @note, :author => false %>
|
||||
<p>
|
||||
<label><%= l(:label_attachment_plural) %></label> <br />
|
||||
<span id="note_attachments_fields">
|
||||
<%= file_field_tag 'note_attachments[1][file]', :size => 30, :id => nil %>
|
||||
<%= text_field_tag 'attachments[1][description]', '', :size => 60, :id => nil %>
|
||||
|
||||
</span>
|
||||
<br />
|
||||
<small><%= link_to l(:label_add_another_file), '#', :onclick => 'addNoteFileField(); return false;' %>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</small>
|
||||
</p>
|
||||
<%= submit_tag l(:button_save) -%>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<% html_title "#{l(:label_crm_note_for)} #{@note.source.name}" %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'common/sidebar' %>
|
||||
|
||||
<%= render :partial => 'common/recently_viewed' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %>
|
||||
<%= stylesheet_link_tag :contacts, :plugin => 'redmine_contacts' %>
|
||||
<%= stylesheet_link_tag :contacts_sidebar, :plugin => 'redmine_contacts' %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,11 @@
|
||||
api.note do
|
||||
api.id @note.id
|
||||
api.source(:id => @note.source_id, :name => @note.source.name, :type => @note.source_type) unless @note.source.blank?
|
||||
api.subject @note.subject
|
||||
api.content @note.content
|
||||
api.type_id @note.type_id
|
||||
api.author(:id => @note.author_id, :name => @note.author.name) unless @note.author.nil?
|
||||
render_api_custom_values @note.custom_field_values, api
|
||||
api.created_on @note.created_on
|
||||
api.updated_on @note.updated_on
|
||||
end
|
||||
@@ -0,0 +1,33 @@
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized(l(:button_edit), {:controller => 'notes', :action => 'edit', :project_id => @project, :id => @note}, :class => 'icon icon-edit', :title => l(:button_edit)) %>
|
||||
</div>
|
||||
|
||||
<%= breadcrumb link_to(@note.source.name, note_source_url(@note.source)) %>
|
||||
|
||||
<%= render :partial => 'note_header', :object => @note %>
|
||||
<% @note.custom_values.each do |custom_value| %>
|
||||
<% if !custom_value.value.blank? %>
|
||||
<p><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="box wiki note">
|
||||
<%= textilizable(@note, :content) %>
|
||||
<%= auto_contacts_thumbnails(@note) %>
|
||||
</div>
|
||||
|
||||
<%= link_to_attachments @note, :author => false %>
|
||||
|
||||
<% html_title "#{l(:label_crm_note_for)} #{@note.source.name}" %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'common/sidebar' %>
|
||||
|
||||
<%= render :partial => 'common/recently_viewed' %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %>
|
||||
<%= stylesheet_link_tag :contacts, :plugin => 'redmine_contacts' %>
|
||||
<%= stylesheet_link_tag :contacts_sidebar, :plugin => 'redmine_contacts' %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user