1.1pre1
This commit is contained in:
parent
3a2b273316
commit
6b030fd41d
83 changed files with 1089 additions and 136 deletions
|
@ -12,9 +12,9 @@
|
|||
= f.label :note
|
||||
%cite (255 symbols only)
|
||||
%br
|
||||
= f.text_area :note, :style => "width:97%;height:100px", :size => 255
|
||||
= f.text_area :note, :size => 255
|
||||
|
||||
%div
|
||||
%div.attach_holder
|
||||
= f.label :attachment
|
||||
%cite (less than 10 MB)
|
||||
%br
|
||||
|
@ -25,4 +25,4 @@
|
|||
|
||||
.clear
|
||||
%br
|
||||
= f.submit 'Add note', :class => "lbutton vm"
|
||||
= f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"
|
||||
|
|
|
@ -1,15 +1,28 @@
|
|||
%ul#notes-list
|
||||
- @notes.each do |note|
|
||||
- next unless note.author
|
||||
= render :partial => "notes/show", :locals => {:note => note}
|
||||
- if controller.action_name == "wall"
|
||||
%ul#notes-list= render "notes/notes_list"
|
||||
|
||||
%br
|
||||
%br
|
||||
- if can? current_user, :write_note, @project
|
||||
= render "notes/form"
|
||||
- else
|
||||
%ul#notes-list= render "notes/notes_list"
|
||||
%br
|
||||
%br
|
||||
- if can? current_user, :write_note, @project
|
||||
= render "notes/form"
|
||||
|
||||
:javascript
|
||||
$('.delete-note').live('ajax:success', function() {
|
||||
$(this).closest('li').fadeOut(); });
|
||||
|
||||
$("#new_note").live("ajax:before", function(){
|
||||
$("#submit_note").attr("disabled", "disabled");
|
||||
})
|
||||
|
||||
$("#new_note").live("ajax:complete", function(){
|
||||
$("#submit_note").removeAttr("disabled");
|
||||
})
|
||||
|
||||
|
||||
- if ["issues", "projects"].include?(controller.controller_name)
|
||||
:javascript
|
||||
$(function(){
|
||||
var int =self.setInterval("updatePage()", 20000);
|
||||
});
|
||||
|
|
4
app/views/notes/_notes_list.html.haml
Normal file
4
app/views/notes/_notes_list.html.haml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- @notes.each do |note|
|
||||
- next unless note.author
|
||||
= render :partial => "notes/show", :locals => {:note => note}
|
||||
|
|
@ -1,19 +1,17 @@
|
|||
%li{:id => dom_id(note)}
|
||||
%div.note_author
|
||||
= image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
|
||||
%div.note_content
|
||||
%div.note_content.left
|
||||
= simple_format(html_escape(note.note))
|
||||
- if note.attachment.url
|
||||
Attachment:
|
||||
= link_to note.attachment_identifier, note.attachment.url
|
||||
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
|
||||
%br
|
||||
%span
|
||||
%span
|
||||
[ #{note.author.name} ]
|
||||
|
||||
%span.author= note.author.name
|
||||
%cite.ago
|
||||
= time_ago_in_words(note.updated_at)
|
||||
ago
|
||||
%br
|
||||
%br
|
||||
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
|
||||
= link_to 'Remove', [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-note right negative"
|
||||
.clear
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
- if @note.valid?
|
||||
:plain
|
||||
$("#new_note .errors").remove();
|
||||
$("#notes-list").append("#{escape_javascript(render(:partial => 'show', :locals => {:note => @note} ))}");
|
||||
updatePage();
|
||||
$('#note_note').val("");
|
||||
- else
|
||||
:plain
|
||||
$("#new_note").replaceWith("#{escape_javascript(render('form'))}");
|
||||
|
||||
:plain
|
||||
$("#submit_note").removeAttr("disabled");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue