Paginas wiki, arquivos e disciplinas ocultas
This commit is contained in:
@@ -35,6 +35,7 @@ class AttachmentsController < ApplicationController
|
||||
def create
|
||||
@attachment.course_id = @course.id
|
||||
@attachment.path = params[:attachment][:path]
|
||||
@attachment.front_page = params[:attachment][:front_page]
|
||||
@attachment.description = params[:attachment][:description]
|
||||
@attachment.file_name = "blank"
|
||||
unless params[:attachment][:file].nil?
|
||||
@@ -58,6 +59,7 @@ class AttachmentsController < ApplicationController
|
||||
|
||||
def update
|
||||
@attachment.path = params[:attachment][:path]
|
||||
@attachment.front_page = params[:attachment][:front_page]
|
||||
@attachment.description = params[:attachment][:description]
|
||||
unless params[:attachment][:file].nil?
|
||||
@attachment.file = params[:attachment][:file]
|
||||
@@ -93,10 +95,11 @@ class AttachmentsController < ApplicationController
|
||||
end
|
||||
|
||||
def download
|
||||
|
||||
send_file("#{RAILS_ROOT}/public/upload/#{@course.id}/#{@attachment.id}",
|
||||
:filename => @attachment.file_name,
|
||||
:type => @attachment.content_type,
|
||||
:disposition => 'attachment',
|
||||
:disposition => 'inline',
|
||||
:streaming => 'true')
|
||||
end
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ class CoursesController < ApplicationController
|
||||
@period = params[:period] || App.current_period
|
||||
|
||||
if logged_in? and !@current_user.courses.empty?
|
||||
@courses = Course.find(:all, :order => 'grade asc, full_name asc', :conditions => ['period = ? and id not in (?)', @period, @current_user.courses])
|
||||
@courses = Course.find(:all, :order => 'grade asc, full_name asc', :conditions => ['period = ? and hidden = ? and id not in (?)', @period, false, @current_user.courses])
|
||||
else
|
||||
@courses = Course.find(:all, :order => 'grade asc, full_name asc', :conditions => ['period = ?', @period])
|
||||
@courses = Course.find(:all, :order => 'grade asc, full_name asc', :conditions => ['period = ? and hidden = ?', @period, false])
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
@@ -22,7 +22,9 @@ class LogController < ApplicationController
|
||||
if @course
|
||||
@log_entries = @course.log_entries.paginate(:page => params[:page], :per_page => 30, :order => "created_at desc")
|
||||
else
|
||||
@log_entries = LogEntry.paginate(:page => params[:page], :per_page => 30, :order => "created_at desc")
|
||||
@log_entries = LogEntry.paginate(:page => params[:page], :per_page => 30,
|
||||
:conditions => [ "course_id not in (select id from courses where hidden = ?)", true],
|
||||
:order => "created_at desc")
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
@@ -29,7 +29,7 @@ class WikiController < ApplicationController
|
||||
|
||||
def index
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_url(@course) }
|
||||
format.html
|
||||
format.xml { render :xml => @wiki_pages }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user