socialforge/app/views/projects/feedback.html.erb

102 lines
3.5 KiB
Plaintext
Raw Normal View History

2013-12-30 20:53:48 +08:00
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
window.onload = setMaxLength;
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
for (var i=0;i<textareas.length;i++) {
var textarea = textareas[i];
setMaxLengthItem(textareas[i]);
}
}
function setMaxLengthItem(textarea){
if (textarea.getAttribute('maxlength')) {
var counter = document.createElement('div');
counter.className = 'counter';
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
textarea.parentNode.insertBefore(counterClone,textarea.nextSibling);
textarea.relatedElement = counterClone.getElementsByTagName('span')[0];
textarea.onkeyup = textarea.onchange = checkMaxLength;
textarea.onkeyup();
}
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
this.relatedElement.className = 'toomuch';
else
this.relatedElement.className = '';
this.relatedElement.firstChild.nodeValue = currentLength;
}
</script>
<!-- fq -->
2014-01-06 21:11:20 +08:00
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h3><%= l(:label_user_response) %></h3>
2014-01-06 21:11:20 +08:00
<% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;">
<%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %>
<hr/>
</div>
<% else %>
2013-12-30 16:03:28 +08:00
<div style="width: 80%; margin-left:10%;">
2014-01-06 21:11:20 +08:00
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%",
:class => 'noline'%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<% end %>
2013-12-30 16:03:28 +08:00
</div>
2014-01-06 21:11:20 +08:00
<% end %>
2013-12-30 16:03:28 +08:00
<div style="clear: both;"></div>
<% if @jour.size >0 %>
2013-12-30 16:03:28 +08:00
<ul class="message-for-user">
<% for journal in @jour%>
2013-12-30 17:13:44 +08:00
<li id='word_li_<%=journal.id.to_s%>' class="outer-message-for-user">
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
<span class="body">
2013-12-30 16:03:28 +08:00
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
2013-12-30 17:13:44 +08:00
<%= textilizable journal.notes%>
<span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span>
<% id = 'project_respond_form_'+journal.id.to_s%>
<span>
2014-01-06 21:11:20 +08:00
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'#',
2013-12-30 17:13:44 +08:00
{:focus => 'project_respond',
:onclick => "toggleAndSettingWordsVal($('##{id}'),
$('##{id} textarea'),
'#{l(:label_reply_plural)} #{journal.user.show_name}: ');
return false;"} %>
2014-01-06 21:11:20 +08:00
<% end %>
2013-12-30 17:13:44 +08:00
</span>
</span>
<div style="clear: both;"></div>
2014-01-06 21:11:20 +08:00
<% if reply_allow %>
2013-12-30 17:13:44 +08:00
<div id='<%= id %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
2013-12-30 17:13:44 +08:00
</div>
2014-01-06 21:11:20 +08:00
<% end %>
2013-12-30 17:13:44 +08:00
<div style="clear: both;"></div>
<div>
2013-12-30 16:03:28 +08:00
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
</div>
2013-12-30 17:13:44 +08:00
</li>
2013-12-30 16:03:28 +08:00
<% end %>
</ul>
<% end %>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
2013-12-24 10:57:59 +08:00
</ul>
</div>