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 %>