From e6aab5baf2d90ffa39bb2d65d92862e46c626683 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 24 Dec 2014 09:30:45 +0800 Subject: [PATCH] =?UTF-8?q?#1650=20=E8=80=81=E5=B8=88=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=88=A0=E9=99=A4=E8=87=AA=E5=B7=B1=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E7=95=99=E8=A8=80=EF=BC=8C=E6=88=96=E5=B8=96?= =?UTF-8?q?=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 10 ++++++--- app/views/courses/_history.html.erb | 21 ++++++++++++++----- app/views/words/_journal_reply.html.erb | 3 ++- app/views/words/_journal_reply_items.html.erb | 3 ++- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 68b92c00e..23c74ed4b 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -1,8 +1,10 @@
- <% reply_allow = JournalsForMessage.create_by_user? User.current %> + <%# reply_allow = JournalsForMessage.create_by_user? User.current %> -

<%= l(:label_user_response) %>

+

+ <%= l(:label_user_response) %> +

<% if !User.current.logged?%>
@@ -30,5 +32,7 @@
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
-
    <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
    + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
\ No newline at end of file diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 19b5cef0d..555e94f6d 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -5,18 +5,29 @@ <% if journals.size > 0 %> <% for journal in journals %>
- +
- <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%><%= format_time(journal.created_on) %> + + <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%> + + + <%= format_time(journal.created_on) %> +
-

<%= textilizable journal.notes%>

+

+ <%= textilizable journal.notes%> +

<% ids = 'project_respond_form_'+ journal.id.to_s%> - <% if journal.user == User.current|| User.current.admin? %> + <% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %> <%= 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', @@ -43,7 +54,7 @@ <% end %>
- <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %> + <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
diff --git a/app/views/words/_journal_reply.html.erb b/app/views/words/_journal_reply.html.erb index 39321394c..5a6511999 100644 --- a/app/views/words/_journal_reply.html.erb +++ b/app/views/words/_journal_reply.html.erb @@ -1,7 +1,8 @@ <% id = "journal_reply_ul_" + journal.id.to_s%> +<% allow_delete ||= false%>
<% fetch_user_leaveWord_reply(journal).each do |reply|%> - <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %> + <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :allow_delete => allow_delete} %> <% end %>
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index fa69176a8..24577c2ee 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -1,4 +1,5 @@ <% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %> +<% allow_delete ||= false %> <% if parent_jour%> <% reply_allow = JournalsForMessage.create_by_user? User.current %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %> @@ -30,7 +31,7 @@ <%= format_time reply.created_on %>