Skip to content

Commit a822468

Browse files
committed
Merge branch 'master' into weighted-merge-master
Change-Id: I32521adf9540ba161896fe89e4515772f346ca90
2 parents daa985e + e1bf799 commit a822468

132 files changed

Lines changed: 2492 additions & 1162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gemfile.d/_before.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ def to_definition(lockfile, unlock)
4848
"https://github.com/#{repo_name}.git"
4949
end
5050

51-
gem 'syck', '1.0.4'
5251
gem 'iconv', '1.0.4'

Gemfile.d/app.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
gem 'highline', '1.7.8', require: false
5151
gem 'httparty', '0.14.0'
5252
gem 'i18n', '0.7.0'
53-
gem 'i18nema', '0.0.8'
5453
gem 'i18nliner', '0.0.12'
5554
gem 'icalendar', '1.5.4', require: false
5655
gem 'ims-lti', '2.1.0.beta.3', require: 'ims'

Gemfile.d/test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
gem 'rspec_around_all', '0.2.0'
2626
gem 'rspec-rails', '3.5.2'
2727
gem 'rspec-collection_matchers', '1.1.3'
28+
gem 'shoulda-matchers', '3.1.1'
2829

2930
gem 'rubocop-canvas', require: false, path: 'gems/rubocop-canvas'
3031
gem 'rubocop', '0.46.0', require: false

app/coffeescripts/bundles/common.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ require [
4343

4444
helpDialog.initTriggers()
4545

46-
$('#skip_navigation_link').on 'click', ->
46+
$('#skip_navigation_link').on 'click', (event) ->
47+
# preventDefault so we dont change the hash
48+
# this will make nested apps that use the hash happy
49+
event.preventDefault()
4750
$($(this).attr('href')).attr('tabindex', -1).focus()
4851

4952
# show and hide the courses vertical menu when the user clicks the hamburger button

app/coffeescripts/views/outcomes/OutcomeIconView.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define [
3131
@$el.attr 'data-id', @model.get 'id'
3232
@$el.html """
3333
<a href="#" class="ellipsis" title="#{h @model.get('title')}">
34-
<i class="icon-note-light"></i>
34+
<i class="icon-outcomes" aria-hidden="true"></i>
3535
<span>#{h @model.get('title')}</span>
3636
</a>
3737
"""

app/controllers/accounts_controller.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,12 @@ def update_api
427427
unless account_settings.empty?
428428
if @account.grants_right?(@current_user, session, :manage_account_settings)
429429
if account_settings[:settings]
430-
account_settings[:settings].slice!(:restrict_student_past_view, :restrict_student_future_view, :restrict_student_future_listing, :lock_all_announcements)
430+
account_settings[:settings].slice!(:restrict_student_past_view, :restrict_student_future_view, :restrict_student_future_listing, :lock_all_announcements, :sis_assignment_name_length_input)
431+
sis_name_length_setting = account_settings[:settings][:sis_assignment_name_length_input]
432+
if sis_name_length_setting
433+
value = sis_name_length_setting[:value]
434+
sis_name_length_setting[:value] = (value.to_i.to_s == value.to_s && value.to_i <= 255) ? value : 255
435+
end
431436
end
432437
@account.errors.add(:name, t(:account_name_required, 'The account name cannot be blank')) if account_params.has_key?(:name) && account_params[:name].blank?
433438
@account.errors.add(:default_time_zone, t(:unrecognized_time_zone, "'%{timezone}' is not a recognized time zone", :timezone => account_params[:default_time_zone])) if account_params.has_key?(:default_time_zone) && ActiveSupport::TimeZone.new(account_params[:default_time_zone]).nil?
@@ -594,6 +599,7 @@ def update
594599
:enable_alerts,
595600
:enable_eportfolios,
596601
:enable_profiles,
602+
:enable_turnitin,
597603
:show_scheduler,
598604
:global_includes,
599605
:gmail_domain

app/controllers/application_controller.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,15 +2071,6 @@ def user_has_google_drive
20712071
@user_has_google_drive ||= google_drive_connection.authorized?
20722072
end
20732073

2074-
def twitter_connection
2075-
if @current_user
2076-
service = @current_user.user_services.where(service: "twitter").first
2077-
return Twitter::Connection.new(service.token, service.secret)
2078-
else
2079-
return Twitter::Connection.new(session[:oauth_twitter_access_token_token], session[:oauth_twitter_access_token_secret])
2080-
end
2081-
end
2082-
20832074
def self.region
20842075
nil
20852076
end

app/controllers/context_modules_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ def index
8888
@modules.each{|m| m.evaluate_for(@current_user) }
8989
session[:module_progressions_initialized] = true
9090
end
91+
92+
if @context.allow_web_export_download?
93+
@last_web_export = @context.web_zip_exports.visible_to(@current_user).order('epub_exports.created_at').last
94+
end
9195
end
9296
end
9397

app/controllers/courses_controller.rb

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ class CoursesController < ApplicationController
300300
include CustomSidebarLinksHelper
301301
include SyllabusHelper
302302

303-
before_filter :require_user, :only => [:index, :activity_stream, :activity_stream_summary, :effective_due_dates, :offline_web_exports]
303+
before_filter :require_user, :only => [:index, :activity_stream, :activity_stream_summary, :effective_due_dates, :offline_web_exports, :start_offline_web_export]
304304
before_filter :require_user_or_observer, :only=>[:user_index]
305-
before_filter :require_context, :only => [:roster, :locks, :create_file, :ping, :effective_due_dates, :offline_web_exports]
305+
before_filter :require_context, :only => [:roster, :locks, :create_file, :ping, :effective_due_dates, :offline_web_exports, :start_offline_web_export]
306306
skip_after_filter :update_enrollment_last_activity_at, only: [:enrollment_invitation, :activity_stream_summary]
307307

308308
include Api::V1::Course
@@ -2463,6 +2463,27 @@ def effective_due_dates
24632463
])
24642464
end
24652465

2466+
# @API Permissions
2467+
# Returns permission information for provided course & current_user
2468+
#
2469+
# @argument permissions[] [String]
2470+
# List of permissions to check against authenticated user
2471+
#
2472+
# @example_request
2473+
# curl https://<canvas>/api/v1/courses/<course_id>/permissions \
2474+
# -H 'Authorization: Bearer <token>' \
2475+
# -d 'permissions[]=manage_grades'
2476+
# -d 'permissions[]=send_messages'
2477+
#
2478+
# @example_response
2479+
# {'manage_grades': 'false', 'send_messages': 'true'}
2480+
def permissions
2481+
get_context
2482+
return unless authorized_action(@context, @current_user, :read)
2483+
permissions = Array(params[:permissions]).map(&:to_sym)
2484+
render json: @context.rights_status(@current_user, session, *permissions)
2485+
end
2486+
24662487
def student_view
24672488
get_context
24682489
if authorized_action(@context, @current_user, :use_student_view)
@@ -2735,8 +2756,6 @@ def can_change_group_weighting_scheme?
27352756
def offline_web_exports
27362757
return render status: 404, template: 'shared/errors/404_message' unless @context.allow_web_export_download?
27372758
if authorized_action(WebZipExport.new(course: @context), @current_user, :create)
2738-
@service = EpubExports::CreateService.new(@context, @current_user, :web_zip_export)
2739-
@service.save
27402759
title = t('Course Content Downloads')
27412760
@page_title = title
27422761
add_crumb(title)
@@ -2745,6 +2764,16 @@ def offline_web_exports
27452764
render :text => '<div id="course-webzip-export-app"></div>'.html_safe, :layout => true
27462765
end
27472766
end
2767+
2768+
def start_offline_web_export
2769+
return render status: 404, template: 'shared/errors/404_message' unless @context.allow_web_export_download?
2770+
if authorized_action(WebZipExport.new(course: @context), @current_user, :create)
2771+
@service = EpubExports::CreateService.new(@context, @current_user, :web_zip_export)
2772+
@service.save
2773+
redirect_to context_url(@context, :context_offline_web_exports_url)
2774+
end
2775+
end
2776+
27482777
private
27492778

27502779
def effective_due_dates_params

app/controllers/gradebooks_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ def save_assignment_order
124124

125125
def light_weight_ags_json(assignment_groups, opts={})
126126
assignment_groups.map do |ag|
127-
visible_assignments = ag.visible_assignments(opts[:student] || @current_user)
128-
.reject(&:muted?)
127+
visible_assignments = ag.visible_assignments(opts[:student] || @current_user).to_a
129128

130129
if multiple_grading_periods? && @current_grading_period_id && !view_all_grading_periods?
131130
current_period = GradingPeriod.for(@context).find_by(id: @current_grading_period_id)
@@ -138,7 +137,8 @@ def light_weight_ags_json(assignment_groups, opts={})
138137
submission_types: a.submission_types_array,
139138
points_possible: a.points_possible,
140139
due_at: a.due_at,
141-
omit_from_final_grade: a.omit_from_final_grade?
140+
omit_from_final_grade: a.omit_from_final_grade?,
141+
muted: a.muted?
142142
}
143143
end
144144

0 commit comments

Comments
 (0)