2014-05-17 11:15:27 +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>
|
|
|
|
<% if jour.size > 0 %>
|
|
|
|
<ul class="message-for-user">
|
|
|
|
<% for journal in jour%>
|
2014-05-27 20:01:21 +08:00
|
|
|
<% seems = homework.rates(:quality).where("rater_id = #{journal.user.id}").select("stars").first %>
|
2014-05-17 11:15:27 +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>
|
2014-05-17 15:39:18 +08:00
|
|
|
<span class="body">
|
2014-05-27 20:01:21 +08:00
|
|
|
<span class="user" style="font-size: 15px">
|
|
|
|
<%= link_to journal.user, user_path(journal.user)%>
|
|
|
|
<!--
|
|
|
|
<% if seems != nil %>
|
|
|
|
<div data-kls="HomeworkAttach" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled"
|
|
|
|
style="height: 15px; width: 100px; overflow: hidden; z-index: 1; position: relative;">
|
|
|
|
<div class="jRatingColor" style="width: <%=seems.stars * 2 * 10 %>%;"></div>
|
|
|
|
<div class="jRatingAverage" style="width: 0px; top: -20px;"></div>
|
|
|
|
<div class="jStar" style="width: 115px; height: 20px; top: -40px;
|
|
|
|
background: url('/images/seems_rateable/stars.png') repeat-x scroll 0% 0% transparent;">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
-->
|
|
|
|
</span>
|
2014-05-17 15:39:18 +08:00
|
|
|
<span class="font_lighter"><% label = l(:label_contest_requirement) %></span>
|
|
|
|
<div> <%= textilizable journal.notes%> </div>
|
|
|
|
<span class="font_lighter"><%= l(:label_bids_published) %>
|
|
|
|
<%= time_tag(journal.created_on).html_safe %>
|
|
|
|
<%= l(:label_bids_published_ago) %>
|
|
|
|
</span>
|
|
|
|
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
2014-11-02 16:15:14 +08:00
|
|
|
<span>
|
2015-03-10 14:25:17 +08:00
|
|
|
<%= link_to l(:button_reply),'',
|
2014-05-17 15:39:18 +08:00
|
|
|
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
|
|
|
|
%>
|
2014-11-02 16:15:14 +08:00
|
|
|
<% if journal.user==User.current|| User.current.admin? %>
|
2014-05-20 09:59:33 +08:00
|
|
|
<%= link_to(l(:label_bid_respond_delete), {:controller => 'homework_attach', :action => 'destroy_jour', :object_id => journal, :user_id => journal.user},
|
|
|
|
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
2014-05-17 15:39:18 +08:00
|
|
|
<% end %>
|
2014-11-02 16:15:14 +08:00
|
|
|
</span>
|
2014-05-17 11:15:27 +08:00
|
|
|
</span>
|
|
|
|
<div style="clear: both;"></div>
|
2014-05-17 15:39:18 +08:00
|
|
|
<div id='<%= ids %>' class="respond-form">
|
|
|
|
<%= render :partial => 'add_jour_reply', :locals => {:journal => journal, :m_reply_id => journal} %>
|
|
|
|
</div>
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
<div>
|
|
|
|
<%= render :partial => "jour_reply", :locals => {:journal => journal } %>
|
|
|
|
</div>
|
2014-05-17 11:15:27 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2014-05-27 20:01:21 +08:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
<!--分页-->
|
|
|
|
<div class="pagination" style="float:left;">
|
|
|
|
<ul>
|
|
|
|
<%= pagination_links_full @feedback_pages %>
|
|
|
|
</ul>
|
|
|
|
</div>
|