调整页面代码

This commit is contained in:
sw 2014-10-28 17:22:35 +08:00
parent a594326bce
commit 591aa78dcf
6 changed files with 87 additions and 57 deletions

View File

@ -1,6 +1,8 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %> <% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %>
<p class="font_lighter" style="font-size: 15px; padding-left: 12px; "><%=tip1%></p> <p class="font_lighter" style="font-size: 15px; padding-left: 12px; ">
<%=tip1%>
</p>
<div id='leave-message'> <div id='leave-message'>
<%= render :partial => 'new', :locals => {:bid => @bid, :sta => @state} %> <%= render :partial => 'new', :locals => {:bid => @bid, :sta => @state} %>
@ -22,24 +24,31 @@
<ul class="message-for-user"> <ul class="message-for-user">
<% for journal in journals%> <% for journal in journals%>
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user"> <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="portrait">
<span class="body"> <%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span> </span>
<span class="font_lighter"><%= label %></span> <span class="body">
<div> <%= textilizable journal.notes%> </div> <span class="user">
<span class="font_lighter"> <%= link_to journal.user, user_path(journal.user)%>
<%= l(:label_bids_published) %>&nbsp; </span>
<%= time_tag(journal.created_on).html_safe %>&nbsp; <span class="font_lighter">
<%= l(:label_bids_published_ago) %> <%= label %>
</span> </span>
<% ids = 'project_respond_form_'+ journal.id.to_s%> <div>
<span> <%= 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>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<% if reply_allow %> <% if reply_allow %>
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal},
:remote => true,:method => 'post', :title => l(:button_quote))%> :remote => true,:method => 'post', :title => l(:button_quote))%>
<%= link_to l(:label_bid_respond_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;"} {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %>
%>
<% end %> <% end %>
<% if @user==User.current|| User.current.admin? %> <% if @user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), <%= link_to(l(:label_bid_respond_delete),
@ -47,14 +56,14 @@
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
</span>
</span> </span>
<div style="clear: both;"></div> </span>
<div style="clear: both;"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %> <% if reply_allow %>
<div id='<%= ids %>' class="respond-form"> <div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %> <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
</div> </div>
<% end %> <% end %>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<div> <div>

View File

@ -1,16 +1,34 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<div style="margin-left: 20px;"> <div style="margin-left: 20px;">
<span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span> <span class="portrait">
<%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%>
</span>
<span class="body" style="word-break: break-all;word-wrap: break-word;"> <span class="body" style="word-break: break-all;word-wrap: break-word;">
<h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%><%= link_to(@bid.name,respond_path(@bid)) %></h3> <h3>
<%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%>
<%= link_to(@bid.name,respond_path(@bid)) %>
</h3>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%> <% if @bid.reward_type.nil? or @bid.reward_type == 1%>
<p> <p>
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= l(:label_call_bonus) %>&nbsp; <%= l(:label_RMB_sign) %><%= @bid.budget %></span></strong> <strong>
<%= l(:label_bids_reward_method) %>
<span class="bonus">
<%= l(:label_call_bonus) %>
&nbsp;
<%= l(:label_RMB_sign) %>
<%= @bid.budget %>
</span>
</strong>
</p> </p>
<% elsif @bid.reward_type == 2%> <% elsif @bid.reward_type == 2%>
<p> <p>
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @bid.budget%></span></strong> <strong>
</p> <%= l(:label_bids_reward_method) %>
<span class="bonus">
<%= @bid.budget%>
</span>
</strong>
</p>
<% else %> <% else %>
<% end %> <% end %>
<div class="bid_description"> <div class="bid_description">

View File

@ -1,7 +1,7 @@
<% id = "journal_reply_ul_" + journal.id.to_s%> <% id = "journal_reply_ul_" + journal.id.to_s%>
<ul class="messages-for-user-reply" id = '<%= id %>' > <ul class="messages-for-user-reply" id = '<%= id %>' >
<% fetch_user_leaveWord_reply(journal).each do |reply|%> <% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %> <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %>
<% end %> <% end %>
</ul> </ul>

View File

@ -2,33 +2,39 @@
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()"> <li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<span class="portrait"> <span class="portrait">
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %> <%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
</span> </span>
<div class="message-body"> <div class="message-body">
<% id = 'project_respond_form_'+ reply.id.to_s %> <% id = 'project_respond_form_'+ reply.id.to_s %>
<p> <p>
<span><%= link_to reply.user.name, user_path(reply.user) %>:&nbsp;</span> <span>
<span class="message-notes"> <%= reply.notes %></span> <%= link_to reply.user.name, user_path(reply.user) %>
:&nbsp;
</span>
<span class="message-notes">
<%= reply.notes %>
</span>
</p> </p>
<p> <p>
<span class="time"><%= format_time reply.created_on %></span> <span class="time">
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' > <%= format_time reply.created_on %>
<% if reply_allow %> </span>
<%= link_to l(:label_projects_feedback_respond),'', <span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"} <% if reply_allow %>
%> <%= link_to l(:label_projects_feedback_respond),'',
<% end %> {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"} %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %> <% end %>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, <% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
<% end %> :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
</span> <% end %>
</span>
</p> </p>
</div> </div>
<div id='<%=id%>' class="respond-form"> <div id='<%=id%>' class="respond-form">
<% if reply_allow %> <% if reply_allow %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %> <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
<% end %> <% end %>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</li> </li>

View File

@ -1,5 +1,5 @@
<%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %> <%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline', <%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4, :style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content), :placeholder => l(:label_projects_feedback_respond_content),

View File

@ -5,15 +5,12 @@
) %>').hide(); ) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600); pre_append.fadeIn(600);
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea'); textarea.val('');
textarea.val(''); $('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide(); var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea1.val('');
var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea'); $('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
textarea1.val('');
$('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
setMaxLengthItem(pre_append.find('textarea')[0]); setMaxLengthItem(pre_append.find('textarea')[0]);
<% else %> <% else %>
alert("<%= l(:label_feedback_fail) %>"); alert("<%= l(:label_feedback_fail) %>");