commit
7b895e5cde
@ -1,47 +1,56 @@
|
||||
########fq
|
||||
module WordsHelper
|
||||
def message_list(object, state, user)
|
||||
unless state
|
||||
if object.size > 5
|
||||
object = object[-5, 5]
|
||||
end
|
||||
end
|
||||
object = object.reverse
|
||||
remove_allowed = (User.current.id == object.first.user_id)
|
||||
content = ''.html_safe
|
||||
lis = object.each do |t_object|
|
||||
s = ''.html_safe
|
||||
s << link_to(t_object.indice, {}, :class => "journal-link")
|
||||
s << avatar(t_object.user, :size => "16").to_s
|
||||
s << link_to_user(t_object.user, :class => 'user')
|
||||
time = time_tag(t_object.created_at)
|
||||
s << l(:field_add, :time => time).html_safe
|
||||
if !t_object.notes.blank?
|
||||
s << link_to(image_tag('comment.png'),
|
||||
{:controller => 'words', :action => 'new', :id => user, :journal_id => t_object},
|
||||
:remote => true,
|
||||
:method => 'post',
|
||||
:title => l(:button_quote))
|
||||
if remove_allowed || t_object.jour_id == User.current.id
|
||||
url = {:controller => 'words',
|
||||
:action => 'destroy',
|
||||
:object_id => t_object,
|
||||
:user_id => user}
|
||||
s << ' '
|
||||
s << link_to(image_tag('delete.png'), url,
|
||||
:remote => true, :method => 'delete', :class => "delete", :title => l(:button_delete))
|
||||
end
|
||||
end
|
||||
#time = '更新于' + time_tag(t_object.created_at) + '之前'
|
||||
|
||||
|
||||
# s << content_tag('div', time)
|
||||
|
||||
content << content_tag('li', s, :class => "user-#{t_object.jour_id}")
|
||||
content << textilizable(t_object.notes)
|
||||
end
|
||||
# content.present? ? content_tag('ul', content, :class => 'watchers') : content
|
||||
content
|
||||
end
|
||||
end
|
||||
|
||||
########fq
|
||||
module WordsHelper
|
||||
def message_list(object, state, user)
|
||||
unless state
|
||||
if object.size > 5
|
||||
object = object[-5, 5]
|
||||
end
|
||||
end
|
||||
object = object.reverse
|
||||
remove_allowed = (User.current.id == object.first.user_id)
|
||||
content = ''.html_safe
|
||||
lis = object.each do |t_object|
|
||||
s = ''.html_safe
|
||||
s << link_to(t_object.indice, {}, :class => "journal-link")
|
||||
s << avatar(t_object.user, :size => "16").to_s
|
||||
s << link_to_user(t_object.user, :class => 'user')
|
||||
time = time_tag(t_object.created_at)
|
||||
s << l(:field_add, :time => time).html_safe
|
||||
if !t_object.notes.blank?
|
||||
s << link_to(image_tag('comment.png'),
|
||||
{:controller => 'words', :action => 'new', :id => user, :journal_id => t_object},
|
||||
:remote => true,
|
||||
:method => 'post',
|
||||
:title => l(:button_quote))
|
||||
if remove_allowed || t_object.jour_id == User.current.id
|
||||
url = {:controller => 'words',
|
||||
:action => 'destroy',
|
||||
:object_id => t_object,
|
||||
:user_id => user}
|
||||
s << ' '
|
||||
s << link_to(image_tag('delete.png'), url,
|
||||
:remote => true, :method => 'delete', :class => "delete", :title => l(:button_delete))
|
||||
end
|
||||
end
|
||||
#time = '更新于' + time_tag(t_object.created_at) + '之前'
|
||||
|
||||
|
||||
# s << content_tag('div', time)
|
||||
|
||||
content << content_tag('li', s, :class => "user-#{t_object.jour_id}")
|
||||
content << textilizable(t_object.notes)
|
||||
end
|
||||
# content.present? ? content_tag('ul', content, :class => 'watchers') : content
|
||||
content
|
||||
end
|
||||
|
||||
def fetch_user_leaveWord_reply leaveWordObj
|
||||
if leaveWordObj.kind_of? JournalsForMessage
|
||||
leaveWordObj.children
|
||||
elsif leaveWordObj.kind_of? Fixnum
|
||||
JournalsForMessage.find(leaveWordObj).children
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,4 @@
|
||||
class ReplyForJournal < ActiveRecord::Base
|
||||
# attr_accessible :title, :body
|
||||
belongs_to :journals_for_messages
|
||||
end
|
@ -1,3 +1,3 @@
|
||||
<h3>test</h3>
|
||||
|
||||
<h3>test</h3>
|
||||
<%= debug @params %>
|
||||
|
@ -0,0 +1,7 @@
|
||||
|
||||
<% id = "journal_reply_ul_" + journal.id.to_s%>
|
||||
<ul class="messages-for-user-reply" id = <%= id %> >
|
||||
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
|
||||
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply.id} %>
|
||||
<% end %>
|
||||
</ul>
|
@ -0,0 +1,24 @@
|
||||
<li>
|
||||
<span class="portrait">
|
||||
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
|
||||
</span>
|
||||
<div class="body">
|
||||
<% id = 'project_respond_form_'+ reply.id.to_s %>
|
||||
<span><%= link_to reply.user.name, user_path(reply.user) %>: </span>
|
||||
<span class="message-notes"> <%= reply.notes %></span>
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<p style="margin-top: 4px; font-size: 9pt;">
|
||||
<span class="time"><%= format_time reply.created_on %></span>
|
||||
<span style="float: right;">
|
||||
<%#= toggle_link l(:label_projects_feedback_respond), id, {:focus => 'project_respond'} %>
|
||||
<%= link_to l(:label_projects_feedback_respond),'',
|
||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{reply.user.show_name}: '); return false;"}
|
||||
%>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div id='<%=id%>' class="respond-form">
|
||||
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</li>
|
@ -0,0 +1,9 @@
|
||||
<%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %>
|
||||
<%= text_area_tag 'user_notes', "", :class => 'noline', :style => "resize: none;", :rows => 4, :placeholder => l(:label_projects_feedback_respond_content) %>
|
||||
|
||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => journal.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id %>
|
||||
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn", :style => "margin-top: 1px;"%>
|
||||
|
||||
<% end %>
|
@ -0,0 +1,11 @@
|
||||
<% if @save_succ %>
|
||||
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(
|
||||
'<%= j(
|
||||
render :partial => "words/journal_reply_items",
|
||||
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm.id}
|
||||
) %>');
|
||||
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea').val('');
|
||||
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
|
||||
<% else %>
|
||||
alert("<%= l(:label_feedback_fail) %>");
|
||||
<% end %>
|
@ -1,3 +1,4 @@
|
||||
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => @content})) %>');
|
||||
$('#new_form_reference_user_id').val("<%= @id %>");
|
||||
showAndScrollTo("pre_show", "new_form_user_message");
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
class AddMissingAttributeToJournalsForMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :journals_for_messages, :m_parent_id, :string
|
||||
add_column :journals_for_messages, :is_readed, :boolean
|
||||
add_column :journals_for_messages, :m_reply_count, :int
|
||||
add_column :journals_for_messages, :m_reply_id, :int
|
||||
end
|
||||
end
|
Loading…
Reference in new issue