diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 44d68de26..c58cd3f82 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -79,7 +79,7 @@ class AttachmentsController < ApplicationController else candown = @attachment.is_public == 1 end - if candown || User.current.admin? + if candown || User.current.admin? || User.current.id == @attachment.author_id @attachment.increment_download if stale?(:etag => @attachment.digest) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ccbff8e50..ea37766b6 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -418,6 +418,8 @@ class ProjectsController < ApplicationController @jour = @jours[@offset, @limit] @state = false @base_courses_tag = @project.project_type + + respond_to do |format| format.html{render :layout => 'base_courses' if @base_courses_tag==1} format.api diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 110f81537..af850d626 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -88,7 +88,15 @@ class WordsController < ApplicationController #format.api { render_api_ok } end end - + + def destroyJournal + @journalP=JournalsForMessage.find(params[:object_id]) + @journalP.destroy + respond_to do |format| + format.js + end + end + def new @jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id] if @jour diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 3116a9a68..b943cf565 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -44,6 +44,13 @@ <% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%> <% hasCourse=true%> + <% _bool=false %> + <% User.current.courses.each do |course| %> + <% if !course_endTime_timeout?(course) %> + <% _bool=true %> + <% end %> + <% end %> + <% if _bool %>