优化页面代码

This commit is contained in:
sw 2014-10-11 15:48:51 +08:00
parent 9c3db03225
commit 75fb5a2cd3
2 changed files with 52 additions and 43 deletions

View File

@ -19,7 +19,7 @@
<% if journals.size >0 %>
<ul class="message-for-user">
<ul class="message-for-user">
<% for journal in journals%>
<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>
@ -27,18 +27,25 @@
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
<span class="font_lighter"><%= label %></span>
<div> <%= textilizable journal.notes%> </div>
<span class="font_lighter"><%= l(:label_bids_published) %>&nbsp;<%= time_tag(journal.created_on).html_safe %>&nbsp;<%= l(:label_bids_published_ago) %></span>
<span class="font_lighter">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<% if reply_allow %>
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%>
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal},
:remote => true,:method => 'post', :title => l(:button_quote))%>
<%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
%>
<% end %>
<% if @user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
</span>
</span>
@ -55,5 +62,5 @@
</div>
</li>
<% end %>
</ul>
</ul>
<% end %>

View File

@ -1,13 +1,15 @@
<%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline',
<%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),
:maxlength => 250 %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise", :style => "float: right; margin-top: 1px; margin-right: 4px;"%>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil ,
:class => "enterprise",
:style => "float: right; margin-top: 1px; margin-right: 4px;"%>
<% end %>