remove all occurrences of use_new_styles? from ruby code
closes: CNVS-31371 test plan: * do an lti launch, it should work * check a couple pages in this list of changes, they should work Change-Id: I8005162dd7e45711cc74204f47a76f9133870a6d Reviewed-on: https://gerrit.instructure.com/89024 Tested-by: Jenkins Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Jeremy Putnam <jeremyp@instructure.com> Product-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
parent
b214583877
commit
9501380c34
|
@ -52,31 +52,24 @@ require [
|
|||
$('#skip_navigation_link').on 'click', ->
|
||||
$($(this).attr('href')).attr('tabindex', -1).focus()
|
||||
|
||||
# TODO: remove this code once people have had time to update their logo-related
|
||||
# custom css. see related code in app/stylesheets/base/_#header.sass.
|
||||
$logo = $('#header-logo')
|
||||
if $logo.length > 0 and $logo.css('background-image').match(/\/canvas\/header_canvas_logo\.png/)
|
||||
$logo.addClass('original')
|
||||
|
||||
# show and hide the courses vertical menu when the user clicks the hamburger button
|
||||
# This was in the courses bundle, but it sometimes needs to work in places that don't
|
||||
# load that bundle.
|
||||
if window.ENV.use_new_styles
|
||||
WIDE_BREAKPOINT = 1200
|
||||
WIDE_BREAKPOINT = 1200
|
||||
|
||||
resetMenuItemTabIndexes = ->
|
||||
# in testing this, it seems that $(document).width() returns 15px less than what it should.
|
||||
tabIndex = if ($('body').hasClass('course-menu-expanded') || $(document).width() >= WIDE_BREAKPOINT - 15)
|
||||
0
|
||||
else
|
||||
-1
|
||||
$('#section-tabs li a').attr('tabIndex', tabIndex)
|
||||
resetMenuItemTabIndexes = ->
|
||||
# in testing this, it seems that $(document).width() returns 15px less than what it should.
|
||||
tabIndex = if ($('body').hasClass('course-menu-expanded') || $(document).width() >= WIDE_BREAKPOINT - 15)
|
||||
0
|
||||
else
|
||||
-1
|
||||
$('#section-tabs li a').attr('tabIndex', tabIndex)
|
||||
|
||||
$(resetMenuItemTabIndexes)
|
||||
$(window).on('resize', _.debounce(resetMenuItemTabIndexes, 50))
|
||||
$('body').on 'click', '#courseMenuToggle', ->
|
||||
$('body').toggleClass("course-menu-expanded")
|
||||
resetMenuItemTabIndexes()
|
||||
$(resetMenuItemTabIndexes)
|
||||
$(window).on('resize', _.debounce(resetMenuItemTabIndexes, 50))
|
||||
$('body').on 'click', '#courseMenuToggle', ->
|
||||
$('body').toggleClass("course-menu-expanded")
|
||||
resetMenuItemTabIndexes()
|
||||
|
||||
|
||||
##
|
||||
|
|
|
@ -273,13 +273,7 @@ require [
|
|||
$(window).keydown(@onKeyDown)
|
||||
|
||||
onPageLoad: (e) ->
|
||||
if window.ENV.use_new_styles
|
||||
$('#main').css(display: 'block')
|
||||
else
|
||||
# we add the top style here instead of in the css because
|
||||
# we want to accomodate custom css that changes the height
|
||||
# of the header.
|
||||
$('#main').css(display: 'block', top: $('#header').height())
|
||||
$('#main').css(display: 'block')
|
||||
|
||||
onSubmit: (dfd) =>
|
||||
@_incrementSending(1)
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
</div>
|
||||
|
||||
<div class="pad-box bottom-only">
|
||||
{{#if ENV.use_new_styles}}
|
||||
<table class="ic-Table">
|
||||
{{else}}
|
||||
<table class="table">
|
||||
{{/if}}
|
||||
<table class="ic-Table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{#t 'points_possible'}}Points possible{{/t}}</th>
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
<tr>
|
||||
{{#if ENV.use_new_styles}}
|
||||
<th scope="row" class="ic-Table--header-row">
|
||||
{{ag.name}}
|
||||
</th>
|
||||
{{else}}
|
||||
<th scope="row">
|
||||
<strong>
|
||||
{{ag.name}}
|
||||
</strong>
|
||||
</th>
|
||||
{{/if}}
|
||||
<th scope="row" class="ic-Table--header-row">
|
||||
{{ag.name}}
|
||||
</th>
|
||||
|
||||
<td class="assignment-group-grade">
|
||||
<span class="grade">
|
||||
|
|
|
@ -39,11 +39,7 @@
|
|||
</div>
|
||||
|
||||
<div class="pad-box bottom-only">
|
||||
{{#if ENV.use_new_styles}}
|
||||
<table class="ic-Table">
|
||||
{{else}}
|
||||
<table class="table">
|
||||
{{/if}}
|
||||
<thead>
|
||||
<tr>
|
||||
{{#if outcomeDetails}}
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{{#if ENV.use_new_styles}}
|
||||
<table class="ic-Table">
|
||||
{{else}}
|
||||
<table class="table left-first">
|
||||
{{/if}}
|
||||
<table class="ic-Table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{{#t 'ag_group_name'}}Assignment Group{{/t}}</th>
|
||||
|
|
|
@ -57,7 +57,6 @@ define [
|
|||
instanceNumber: @msfInstance.instanceNumber
|
||||
previous: @msfInstance.previous
|
||||
next: @msfInstance.next
|
||||
new_styles: window.ENV.use_new_styles
|
||||
)
|
||||
@msfAnimation(options.animation) if options?.animation != undefined
|
||||
@show()
|
||||
|
|
|
@ -10,7 +10,7 @@ define [
|
|||
], (I18n, $, _, React, ReactDOM, BreadcrumbCollapsedContainerComponent, withReactElement, customPropTypes) ->
|
||||
|
||||
MAX_CRUMB_WIDTH = 500
|
||||
MIN_CRUMB_WIDTH = if window.ENV.use_new_styles then 80 else 40
|
||||
MIN_CRUMB_WIDTH = 80
|
||||
|
||||
BreadcrumbCollapsedContainer = BreadcrumbCollapsedContainerComponent
|
||||
|
||||
|
@ -48,10 +48,8 @@ define [
|
|||
$a = $oldCrumbs.find('li').eq(1).find('a')
|
||||
contextUrl = $a.attr('href')
|
||||
contextName = $a.text()
|
||||
if (ENV.use_new_styles)
|
||||
$('.ic-app-nav-toggle-and-crumbs').remove()
|
||||
else
|
||||
$oldCrumbs.remove()
|
||||
$('.ic-app-nav-toggle-and-crumbs').remove()
|
||||
|
||||
@setState({homeName, contextUrl, contextName, heightOfOneBreadcrumb})
|
||||
|
||||
handleResize: ->
|
||||
|
|
|
@ -196,7 +196,7 @@ class AccountsController < ApplicationController
|
|||
end
|
||||
|
||||
@permissions = {
|
||||
theme_editor: use_new_styles? && can_manage_account && @account.branding_allowed?,
|
||||
theme_editor: can_manage_account && @account.branding_allowed?,
|
||||
can_read_course_list: can_read_course_list,
|
||||
can_read_roster: can_read_roster,
|
||||
can_create_courses: @account.grants_right?(@current_user, session, :manage_courses),
|
||||
|
|
|
@ -115,7 +115,6 @@ class ApplicationController < ActionController::Base
|
|||
current_user_disabled_inbox: @current_user.try(:disabled_inbox?),
|
||||
files_domain: HostUrl.file_host(@domain_root_account || Account.default, request.host_with_port),
|
||||
DOMAIN_ROOT_ACCOUNT_ID: @domain_root_account.try(:global_id),
|
||||
use_new_styles: use_new_styles?,
|
||||
k12: k12?,
|
||||
help_link_name: help_link_name,
|
||||
help_link_icon: help_link_icon,
|
||||
|
@ -219,11 +218,6 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
helper_method :k12?
|
||||
|
||||
def use_new_styles?
|
||||
@domain_root_account && @domain_root_account.feature_enabled?(:use_new_styles) || k12?
|
||||
end
|
||||
helper_method :use_new_styles?
|
||||
|
||||
def multiple_grading_periods?
|
||||
account_and_grading_periods_allowed? ||
|
||||
context_grading_periods_enabled?
|
||||
|
|
|
@ -7,7 +7,6 @@ class BrandConfigsController < ApplicationController
|
|||
before_filter :require_user
|
||||
before_filter :require_account_management
|
||||
before_filter :require_account_branding, except: [:destroy]
|
||||
before_filter :require_new_ui
|
||||
before_filter { |c| c.active_tab = "brand_configs" }
|
||||
|
||||
def index
|
||||
|
@ -174,13 +173,6 @@ class BrandConfigsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def require_new_ui
|
||||
unless use_new_styles?
|
||||
flash[:error] = t "You need to enable the 'New UI' feature before editing themes."
|
||||
redirect_to account_path(@account)
|
||||
end
|
||||
end
|
||||
|
||||
def process_variables(variables)
|
||||
variables.each_with_object({}) do |(key, value), memo|
|
||||
next unless value.present? && (config = BrandableCSS.variables_map[key])
|
||||
|
|
|
@ -103,8 +103,7 @@ class DiscussionTopicsApiController < ApplicationController
|
|||
def view
|
||||
return unless authorized_action(@topic, @current_user, :read_replies)
|
||||
|
||||
mobile_brand_config = !in_app? && @context.account.root_account.feature_enabled?(:use_new_styles) &&
|
||||
@context.account.effective_brand_config
|
||||
mobile_brand_config = !in_app? && @context.account.effective_brand_config
|
||||
opts = {
|
||||
:include_new_entries => value_to_boolean(params[:include_new_entries]),
|
||||
:include_mobile_overrides => !!mobile_brand_config
|
||||
|
|
|
@ -289,13 +289,8 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def css_variant
|
||||
if use_new_styles?
|
||||
variant = 'new_styles'
|
||||
else
|
||||
variant = 'legacy'
|
||||
end
|
||||
use_high_contrast = @current_user && @current_user.prefers_high_contrast?
|
||||
variant + (use_high_contrast ? '_high_contrast' : '_normal_contrast')
|
||||
'new_styles' + (use_high_contrast ? '_high_contrast' : '_normal_contrast')
|
||||
end
|
||||
|
||||
def css_url_for(bundle_name, plugin=false)
|
||||
|
@ -699,7 +694,7 @@ module ApplicationHelper
|
|||
def active_brand_config(opts={})
|
||||
return active_brand_config_cache[opts] if active_brand_config_cache.key?(opts)
|
||||
|
||||
ignore_branding = !use_new_styles? || (@current_user.try(:prefers_high_contrast?) && !opts[:ignore_high_contrast_preference])
|
||||
ignore_branding = (@current_user.try(:prefers_high_contrast?) && !opts[:ignore_high_contrast_preference])
|
||||
active_brand_config_cache[opts] = if ignore_branding
|
||||
nil
|
||||
else
|
||||
|
@ -792,17 +787,13 @@ module ApplicationHelper
|
|||
|
||||
def include_account_js(options = {})
|
||||
return if params[:global_includes] == '0'
|
||||
includes = if use_new_styles?
|
||||
if @domain_root_account.allow_global_includes? && (abc = active_brand_config(ignore_high_contrast_preference: true))
|
||||
abc.css_and_js_overrides[:js_overrides]
|
||||
else
|
||||
Account.site_admin.brand_config.try(:css_and_js_overrides).try(:[], :js_overrides)
|
||||
end
|
||||
|
||||
includes = if @domain_root_account.allow_global_includes? && (abc = active_brand_config(ignore_high_contrast_preference: true))
|
||||
abc.css_and_js_overrides[:js_overrides]
|
||||
else
|
||||
get_global_includes.each_with_object([]) do |global_include, memo|
|
||||
memo << global_include[:js] if global_include[:js].present?
|
||||
end
|
||||
Account.site_admin.brand_config.try(:css_and_js_overrides).try(:[], :js_overrides)
|
||||
end
|
||||
|
||||
if includes.present?
|
||||
if options[:raw]
|
||||
includes = ["/optimized/vendor/jquery-1.7.2.js"] + includes
|
||||
|
@ -841,16 +832,10 @@ module ApplicationHelper
|
|||
def include_account_css
|
||||
return if disable_account_css?
|
||||
|
||||
includes = if use_new_styles?
|
||||
if @domain_root_account.allow_global_includes? && (abc = active_brand_config(ignore_high_contrast_preference: true))
|
||||
abc.css_and_js_overrides[:css_overrides]
|
||||
else
|
||||
Account.site_admin.brand_config.try(:css_and_js_overrides).try(:[], :css_overrides)
|
||||
end
|
||||
includes = if @domain_root_account.allow_global_includes? && (abc = active_brand_config(ignore_high_contrast_preference: true))
|
||||
abc.css_and_js_overrides[:css_overrides]
|
||||
else
|
||||
get_global_includes.each_with_object([]) do |global_include, css_includes|
|
||||
css_includes << global_include[:css] if global_include[:css].present?
|
||||
end
|
||||
Account.site_admin.brand_config.try(:css_and_js_overrides).try(:[], :css_overrides)
|
||||
end
|
||||
|
||||
if includes.present?
|
||||
|
|
|
@ -64,7 +64,7 @@ module SectionTabHelper
|
|||
def cache_key
|
||||
[ context, current_user, domain_root_account,
|
||||
Lti::NavigationCache.new(domain_root_account),
|
||||
"section_tabs_hash", I18n.locale, domain_root_account.feature_enabled?(:use_new_styles)
|
||||
"section_tabs_hash", I18n.locale
|
||||
].cache_key
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ define([
|
|||
], function(React, I18n, classnames, Breadcrumbs, filesEnv, BreadcrumbCollapsedContainer, splitAssetString) {
|
||||
|
||||
var MAX_CRUMB_WIDTH = 500
|
||||
var MIN_CRUMB_WIDTH = (window.ENV.use_new_styles) ? 80 : 40;
|
||||
var MIN_CRUMB_WIDTH = 80;
|
||||
|
||||
Breadcrumbs.renderSingleCrumb = function (folder, isLastCrumb, isRootCrumb) {
|
||||
const [contextType, contextId] = splitAssetString(this.props.contextAssetString, false);
|
||||
|
|
|
@ -76,36 +76,25 @@ define([
|
|||
{I18n.t('Files')}
|
||||
</h1>
|
||||
</header>
|
||||
{ENV.use_new_styles && (
|
||||
<div className='ic-app-nav-toggle-and-crumbs ic-app-nav-toggle-and-crumbs--files no-print'>
|
||||
<button
|
||||
className='Button Button--link Button--small ic-app-course-nav-toggle'
|
||||
type='button'
|
||||
id='courseMenuToggle'
|
||||
title={I18n.t("Show and hide courses menu")}
|
||||
aria-hidden={true}
|
||||
>
|
||||
<i className='icon-hamburger' />
|
||||
</button>
|
||||
<div className='ic-app-crumbs'>
|
||||
<Breadcrumbs
|
||||
rootTillCurrentFolder={this.state.rootTillCurrentFolder}
|
||||
showingSearchResults={this.state.showingSearchResults}
|
||||
query={this.props.query}
|
||||
contextAssetString={this.props.contextAssetString}
|
||||
/>
|
||||
</div>
|
||||
<div className='ic-app-nav-toggle-and-crumbs ic-app-nav-toggle-and-crumbs--files no-print'>
|
||||
<button
|
||||
className='Button Button--link Button--small ic-app-course-nav-toggle'
|
||||
type='button'
|
||||
id='courseMenuToggle'
|
||||
title={I18n.t("Show and hide courses menu")}
|
||||
aria-hidden={true}
|
||||
>
|
||||
<i className='icon-hamburger' />
|
||||
</button>
|
||||
<div className='ic-app-crumbs'>
|
||||
<Breadcrumbs
|
||||
rootTillCurrentFolder={this.state.rootTillCurrentFolder}
|
||||
showingSearchResults={this.state.showingSearchResults}
|
||||
query={this.props.query}
|
||||
contextAssetString={this.props.contextAssetString}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(!ENV.use_new_styles) && (
|
||||
<Breadcrumbs
|
||||
rootTillCurrentFolder={this.state.rootTillCurrentFolder}
|
||||
showingSearchResults={this.state.showingSearchResults}
|
||||
query={this.props.query}
|
||||
contextAssetString={this.props.contextAssetString}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<Toolbar
|
||||
currentFolder={this.state.currentFolder}
|
||||
query={this.props.query}
|
||||
|
|
|
@ -158,9 +158,7 @@ class Account < ActiveRecord::Base
|
|||
add_setting :sis_default_grade_export, :boolean => true, :default => false, :inheritable => true
|
||||
|
||||
add_setting :global_includes, :root_only => true, :boolean => true, :default => false
|
||||
add_setting :global_javascript, :condition => :allow_global_includes
|
||||
add_setting :global_stylesheet, :condition => :allow_global_includes
|
||||
add_setting :sub_account_includes, :condition => :use_new_styles_or_allow_global_includes, :boolean => true, :default => false
|
||||
add_setting :sub_account_includes, :boolean => true, :default => false
|
||||
add_setting :error_reporting, :hash => true, :values => [:action, :email, :url, :subject_param, :body_param], :root_only => true
|
||||
|
||||
# Help link settings
|
||||
|
@ -223,10 +221,6 @@ class Account < ActiveRecord::Base
|
|||
|
||||
add_setting :strict_sis_check, :boolean => true, :root_only => true, :default => false
|
||||
|
||||
def use_new_styles_or_allow_global_includes?
|
||||
feature_enabled?(:use_new_styles) || allow_global_includes?
|
||||
end
|
||||
|
||||
def settings=(hash)
|
||||
if hash.is_a?(Hash)
|
||||
hash.each do |key, val|
|
||||
|
@ -274,15 +268,6 @@ class Account < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def global_includes_hash
|
||||
includes = {}
|
||||
if allow_global_includes?
|
||||
includes = {}
|
||||
includes[:js] = settings[:global_javascript] if settings[:global_javascript].present?
|
||||
includes[:css] = settings[:global_stylesheet] if settings[:global_stylesheet].present?
|
||||
end
|
||||
includes.present? ? includes : nil
|
||||
end
|
||||
|
||||
def mfa_settings
|
||||
settings[:mfa_settings].try(:to_sym) || :disabled
|
||||
|
@ -1377,7 +1362,7 @@ class Account < ActiveRecord::Base
|
|||
tabs << { :id => TAB_AUTHENTICATION, :label => t('#account.tab_authentication', "Authentication"), :css_class => 'authentication', :href => :account_authentication_providers_path } if root_account? && manage_settings
|
||||
tabs << { :id => TAB_PLUGINS, :label => t("#account.tab_plugins", "Plugins"), :css_class => "plugins", :href => :plugins_path, :no_args => true } if root_account? && self.grants_right?(user, :manage_site_settings)
|
||||
tabs << { :id => TAB_JOBS, :label => t("#account.tab_jobs", "Jobs"), :css_class => "jobs", :href => :jobs_path, :no_args => true } if root_account? && self.grants_right?(user, :view_jobs)
|
||||
tabs << { :id => TAB_BRAND_CONFIGS, :label => t('#account.tab_brand_configs', "Themes"), :css_class => 'brand_configs', :href => :account_brand_configs_path } if manage_settings && (root_account.feature_enabled?(:use_new_styles) || root_account.feature_enabled?(:k12)) && branding_allowed?
|
||||
tabs << { :id => TAB_BRAND_CONFIGS, :label => t('#account.tab_brand_configs', "Themes"), :css_class => 'brand_configs', :href => :account_brand_configs_path } if manage_settings && branding_allowed?
|
||||
tabs << { :id => TAB_DEVELOPER_KEYS, :label => t("#account.tab_developer_keys", "Developer Keys"), :css_class => "developer_keys", :href => :developer_keys_path, :no_args => true } if root_account? && self.grants_right?(user, :manage_developer_keys)
|
||||
else
|
||||
tabs = []
|
||||
|
@ -1403,7 +1388,7 @@ class Account < ActiveRecord::Base
|
|||
tabs << { id: TAB_SIS_IMPORT, label: t('#account.tab_sis_import', "SIS Import"),
|
||||
css_class: 'sis_import', href: :account_sis_import_path }
|
||||
end
|
||||
tabs << { :id => TAB_BRAND_CONFIGS, :label => t('#account.tab_brand_configs', "Themes"), :css_class => 'brand_configs', :href => :account_brand_configs_path } if manage_settings && (root_account.feature_enabled?(:use_new_styles) || root_account.feature_enabled?(:k12)) && branding_allowed?
|
||||
tabs << { :id => TAB_BRAND_CONFIGS, :label => t('#account.tab_brand_configs', "Themes"), :css_class => 'brand_configs', :href => :account_brand_configs_path } if manage_settings && branding_allowed?
|
||||
tabs << { :id => TAB_DEVELOPER_KEYS, :label => t("#account.tab_developer_keys", "Developer Keys"), :css_class => "developer_keys", :href => :account_developer_keys_path, account_id: root_account.id } if root_account? && root_account.grants_right?(user, :manage_developer_keys)
|
||||
end
|
||||
tabs += external_tool_tabs(opts)
|
||||
|
@ -1440,7 +1425,7 @@ class Account < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
if settings[:new_custom_help_links] && (feature_enabled?(:use_new_styles) || feature_enabled?(:k12))
|
||||
if settings[:new_custom_help_links]
|
||||
links || Canvas::Help.default_links
|
||||
else
|
||||
Canvas::Help.default_links + (links || [])
|
||||
|
|
|
@ -338,18 +338,16 @@ TEXT
|
|||
<div id="global_includes_warning_message_wrapper">
|
||||
<%= settings.check_box :global_includes, :checked => @account.settings[:global_includes] %>
|
||||
<%= settings.label :global_includes, :en => "Custom CSS/JavaScript overrides" %>
|
||||
<% if use_new_styles? %>
|
||||
<div id="global_includes_warning_message" class="account_settings__help-text">
|
||||
<p>
|
||||
<%= t ("Custom CSS and Javascript may cause accessibility issues or conflicts with future Canvas updates!")%>
|
||||
</p>
|
||||
<p>
|
||||
<%= t do %>
|
||||
Before implementing custom CSS or Javascript, please refer to <a href="https://community.canvaslms.com/docs/DOC-3010" target="_blank"> our documentation</a>.
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %><%# end of use_new_styles? %>
|
||||
<div id="global_includes_warning_message" class="account_settings__help-text">
|
||||
<p>
|
||||
<%= t ("Custom CSS and Javascript may cause accessibility issues or conflicts with future Canvas updates!")%>
|
||||
</p>
|
||||
<p>
|
||||
<%= t do %>
|
||||
Before implementing custom CSS or Javascript, please refer to <a href="https://community.canvaslms.com/docs/DOC-3010" target="_blank"> our documentation</a>.
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="show_scheduler_checkbox">
|
||||
<%= settings.check_box :show_scheduler, :checked => @account.settings[:show_scheduler] %>
|
||||
|
@ -362,7 +360,7 @@ TEXT
|
|||
<% end %><%# end of :manage_site_settings %>
|
||||
<div>
|
||||
<%= settings.check_box :sub_account_includes, checked: @account.settings[:sub_account_includes] %>
|
||||
<%= settings.label :new_sub_account_includes, :en => "Let sub-accounts use the Theme Editor to customize their own branding" %>
|
||||
<%= settings.label :sub_account_includes, :en => "Let sub-accounts use the Theme Editor to customize their own branding" %>
|
||||
</div>
|
||||
<% if @account.canvas_authentication? %>
|
||||
<div>
|
||||
|
@ -421,29 +419,6 @@ TEXT
|
|||
<% end %>
|
||||
</fieldset>
|
||||
|
||||
<% unless use_new_styles? %>
|
||||
<fieldset id="account_settings_global_includes_settings" style="<%= hidden unless @account.allow_global_includes? %>">
|
||||
<legend><%= t(:global_js_and_css_includes_title, "Global JavaScript and CSS Includes") %></legend>
|
||||
<p style="font-size: 0.9em;"><%= t(:global_js_and_css_includes_description, "These files will be included on all page loads for your account") %></p>
|
||||
<%= f.fields_for :settings do |settings| %>
|
||||
<table class="formtable">
|
||||
<tr>
|
||||
<td><%= settings.blabel :global_javascript, :en => "Global JavaScript URL" %></td>
|
||||
<td><%= settings.text_field :global_javascript, :value => @account.settings[:global_javascript] %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= settings.blabel :global_stylesheet, :en => "Global CSS URL" %></td>
|
||||
<td><%= settings.text_field :global_stylesheet, :value => @account.settings[:global_stylesheet] %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div>
|
||||
<%= settings.check_box :sub_account_includes, :checked => @account.settings[:sub_account_includes] %>
|
||||
<%= settings.label :sub_account_includes, :en => "Let sub-accounts define additional includes" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% if !@account.site_admin? &&
|
||||
@account.root_account? &&
|
||||
@account.feature_allowed?(:post_grades) &&
|
||||
|
@ -502,71 +477,7 @@ TEXT
|
|||
|
||||
|
||||
<% if @account.root_account? && !@account.site_admin? && show_feedback_link? %>
|
||||
|
||||
<% if use_new_styles? %>
|
||||
<div id="custom_help_link_settings"></div>
|
||||
<% else %>
|
||||
<fieldset>
|
||||
<legend><%= t("Custom Links to include in the help dialog popup") %></legend>
|
||||
|
||||
<p style="font-size: 0.9em;">
|
||||
<%= t("If you would like to link to your own campus support website in the help dialog you can do that here.") %>
|
||||
</p>
|
||||
|
||||
<%= f.fields_for :custom_help_links do |custom_help_links, i| %>
|
||||
<div id="custom_help_links">
|
||||
<% ((@account.settings[:custom_help_links] || []) << {}).each_with_index do |help_link, i| %>
|
||||
<div class="custom_help_link <%= raw ' blank" style="display: none;' if help_link.empty? %>">
|
||||
<button type="button" class="Button Button--link delete">
|
||||
<i class="icon-end" aria-hidden="true"></i>
|
||||
<span class="screenreader-only"><%= t("Delete custom help link") %></span>
|
||||
</button>
|
||||
<input type="hidden" name="account[custom_help_links][<%= i %>][state]" value="<%= help_link[:state] || 'active' %>" id="custom_help_links_<%= i %>_state" class="custom_help_link_state"/>
|
||||
<table class="formtable">
|
||||
<tr>
|
||||
<td><label for="custom_help_links_<%= i %>_text"><%= before_label :help_link_text, "Text to display for link" %></label></td>
|
||||
<td><input type="text" name="account[custom_help_links][<%= i %>][text]" value="<%= help_link[:text] %>" id="custom_help_links_<%= i %>_text"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="custom_help_links_<%= i %>_subtext"><%= before_label :help_link_subtext, "Sub-text" %></label></td>
|
||||
<td><input type="text" name="account[custom_help_links][<%= i %>][subtext]" value="<%= help_link[:subtext] %>" id="custom_help_links_<%= i %>_subtext"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="custom_help_links_<%= i %>_text"><%= before_label :help_link_url, "URL" %></label></td>
|
||||
<td><input type="text" name="account[custom_help_links][<%= i %>][url]" value="<%= help_link[:url] %>" id="custom_help_links_<%= i %>_url"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label><%= before_label :help_link_available_to, "Available to" %></label></td>
|
||||
<td>
|
||||
<input type="checkbox" name="account[custom_help_links][<%= i %>][available_to][]" value="user" <%= 'checked' if help_link.empty? or help_link[:available_to].try :include?, 'user' %> id="custom_help_links_<%= i %>_available_to_user">
|
||||
<label for="custom_help_links_<%= i %>_available_to_user"><%= t :help_link_available_to_all_users, "Users" %></label>
|
||||
|
||||
<input type="checkbox" name="account[custom_help_links][<%= i %>][available_to][]" value="student" <%= 'checked' if help_link[:available_to].try :include?, 'student' %> id="custom_help_links_<%= i %>_available_to_student">
|
||||
<label for="custom_help_links_<%= i %>_available_to_student"><%= t :help_link_available_to_all_students, "Students" %></label>
|
||||
|
||||
<input type="checkbox" name="account[custom_help_links][<%= i %>][available_to][]" value="teacher" <%= 'checked' if help_link[:available_to].try :include?, 'teacher' %> id="custom_help_links_<%= i %>_available_to_teacher">
|
||||
<label for="custom_help_links_<%= i %>_available_to_teacher"><%= t :help_link_available_to_all_teachers, "Teachers" %></label>
|
||||
|
||||
<input type="checkbox" name="account[custom_help_links][<%= i %>][available_to][]" value="admin" <%= 'checked' if help_link[:available_to].try :include?, 'admin' %> id="custom_help_links_<%= i %>_available_to_admin">
|
||||
<label for="custom_help_links_<%= i %>_available_to_admin"><%= t :help_link_available_to_all_admins, "Admins" %></label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<button
|
||||
type="button"
|
||||
class="Button Button--link add_custom_help_link"
|
||||
title="<%= t('Add a custom help link') %>"
|
||||
aria-label="<%= t('Add a custom help link') %>"
|
||||
>
|
||||
<i class="icon-add" aria-hidden="true"></i>
|
||||
<%= t("Add a custom help link") %>
|
||||
</button>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<div id="custom_help_link_settings"></div>
|
||||
<% end %>
|
||||
|
||||
<% unless @account.site_admin? %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% course_home ||= false %>
|
||||
<div id="sidebar_content" class="rs-margin-lr <% unless use_new_styles? %><%= 'rs-margin-top' unless course_home %><% end %>">
|
||||
<div id="sidebar_content" class="rs-margin-lr">
|
||||
<% current = Time.zone.today
|
||||
first_day_of_month = Date.new(y=current.year, m=current.month, d=1)
|
||||
last_day_of_previous_month = first_day_of_month - 1
|
||||
|
@ -8,10 +8,6 @@
|
|||
first_day = last_day_of_previous_month - last_day_of_previous_month.wday
|
||||
%>
|
||||
<%= render :partial => 'calendars/mini_calendar', :locals => {:current => current, :first_day => first_day, :mini_css => 'static/mini_calendar_sidebar.css' } %>
|
||||
<% unless use_new_styles? %><hr /><% end %>
|
||||
<!--p>
|
||||
<a href="#" class="jump_to_today_link">Jump to Today</a>
|
||||
</p-->
|
||||
<%= render :partial => "courses/sidebar_weighting", :object => @groups %>
|
||||
</div>
|
||||
<%= render :partial => "shared/wiki_sidebar" %>
|
||||
|
|
|
@ -2,25 +2,19 @@
|
|||
css_bundle :login_confirm
|
||||
js_bundle :registration_confirmation
|
||||
@headers = false
|
||||
if use_new_styles?
|
||||
@body_classes << "full-width modal body--login-confirmation"
|
||||
else
|
||||
@body_classes << "modal body--login-confirmation"
|
||||
end
|
||||
@body_classes << "full-width modal body--login-confirmation"
|
||||
content_for :page_title, t(:page_title, "Register %{email}", :email => @communication_channel.path)
|
||||
%>
|
||||
|
||||
<div id="modal-box"<% if use_new_styles? %> class="ic-Login-confirmation"<% end %>>
|
||||
<% if use_new_styles? %>
|
||||
<div id="modal-box" class="ic-Login-confirmation">
|
||||
<header class="ic-Login-confirmation__header">
|
||||
<%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:"Canvas by Instructure") %>
|
||||
</header>
|
||||
<div class="ic-Login-confirmation__content">
|
||||
<% end %>
|
||||
<h2<% if use_new_styles? %> class="ic-Login-confirmation__headline"<% end %>><%= t 'titles.welcome_aboard', "Welcome Aboard!" %></h2>
|
||||
<h2 class="ic-Login-confirmation__headline"><%= t 'titles.welcome_aboard', "Welcome Aboard!" %></h2>
|
||||
<% if @current_user && @current_user != @user && @user.registered? && @enrollment %>
|
||||
<p><%= mt 'details.wrong_account', "The invitation for %{course} was sent to **%{invited_user}**, but you are currently logged in as **%{current_user}**", :course => @course.name, :invited_user => @user.name, :current_user => @current_user.name %></p>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<a href="<%= registration_confirmation_path(@nonce, :enrollment => @enrollment.uuid, :transfer_enrollment => 1) %>" class="btn" id='transfer'><%= t 'buttons.transfer_enrollment', "Transfer Enrollment" %></a>
|
||||
<a href="<%= login_url(:enrollment => @enrollment.uuid, :pseudonym_session => { :unique_id => @user.pseudonym.try(:unique_id) }, :expected_user_id => @user.id) %>" class="btn" id="login"><%= t 'buttons.login_as', "Log in as %{invited_user}", :invited_user => @user.name %></a>
|
||||
</div>
|
||||
|
@ -36,7 +30,7 @@
|
|||
**Are you %{name}?**", :email => @communication_channel.path, :name => friendly_name(@merge_opportunities.first.last.first, @merge_opportunities) %>
|
||||
<% end %></p>
|
||||
</div>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<% if @pseudonym %><a href="#" class="btn" id="register"><%= t 'buttons.no', 'No' %></a><% end %>
|
||||
<a href="<%= merge_or_login_link(@merge_opportunities.first.last.first) %>" class="btn not_external btn-primary" id="merge"><%= @user.registered? ? t('buttons.merge', "Combine") : t('buttons.yes', "Yes") %></a>
|
||||
</div>
|
||||
|
@ -54,7 +48,7 @@
|
|||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<a href="#" class="btn" id="back"><%= t 'buttons.back', "Back" %></a>
|
||||
<a href="#" class="btn btn-primary" id="merge_if_clicked"><%= t 'buttons.continue', 'Continue' %></a>
|
||||
</div>
|
||||
|
@ -67,7 +61,7 @@
|
|||
<%= mt 'details.logged_in_other_user', "**%{email}** is a new account, but you are currently logged in as **%{user}**.", :email => @communication_channel.path, :user => (@current_pseudonym && @current_pseudonym.user == @current_user ? @current_pseudonym : @current_user.pseudonym).unique_id %>
|
||||
<% end %></p>
|
||||
<p><strong><%= t 'details.add_email', "Would you like to add this email address to your current account?" %></strong></p>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<a href="#" class="btn" id="register"><%= t 'buttons.new_account', 'No' %></a>
|
||||
<a href="<%= registration_confirmation_path(@nonce, :enrollment => @enrollment.try(:uuid), :confirm => 1) %>" class="btn btn-primary" id='merge'><%= t 'buttons.add_email_address', "Yes, Add Email Address" %></a>
|
||||
</div>
|
||||
|
@ -112,7 +106,7 @@ Which is you?", :count => @merge_opportunities.length %>
|
|||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<a href="<%= merge_or_login_link(@merge_opportunities.first.last.first) %>" class="btn not_external" id="merge"><%= t 'buttons.continue', "Continue" %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -120,7 +114,7 @@ Which is you?", :count => @merge_opportunities.length %>
|
|||
<% elsif @enrollment && @pseudonym %>
|
||||
<div class="disambiguation_box"<%= ' style="display: none;"'.html_safe if params[:register] %>>
|
||||
<p><%= mt 'details.account_needed', "You've been invited to join **%{course}**. To accept this request you need a Canvas account. Click the link below to create a Canvas account.", :course => @course.name %></p>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<a href="<%= login_url(:host => HostUrl.context_host(@root_account, @request.try(:host_with_port)), :confirm => @communication_channel.confirmation_code, :enrollment => @enrollment.uuid) %>" class="btn not_external"><%= t 'buttons.have_account', "I Have a Canvas Account" %></a>
|
||||
<a href="#" class="btn" id="register"><%= t 'buttons.create_account', 'Create My Account' %></a>
|
||||
</div>
|
||||
|
@ -185,5 +179,5 @@ Which is you?", :count => @merge_opportunities.length %>
|
|||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if use_new_styles? %></div><% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,23 +1,17 @@
|
|||
<%
|
||||
css_bundle :login_confirm
|
||||
@headers = false
|
||||
if use_new_styles?
|
||||
@body_classes << "full-width modal body--login-confirmation"
|
||||
else
|
||||
@body_classes << "modal body--login-confirmation"
|
||||
end
|
||||
@body_classes << "full-width modal body--login-confirmation"
|
||||
|
||||
content_for :page_title, t(:page_title, "Registration Confirmation Failed")
|
||||
%>
|
||||
|
||||
<div id="modal-box"<% if use_new_styles? %> class="ic-Login-confirmation"<% end %>>
|
||||
<% if use_new_styles? %>
|
||||
<div id="modal-box" class="ic-Login-confirmation">
|
||||
<header class="ic-Login-confirmation__header">
|
||||
<%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:"Canvas by Instructure") %>
|
||||
</header>
|
||||
<div class="ic-Login-confirmation__content">
|
||||
<% end %>
|
||||
<h2<% if use_new_styles? %> class="ic-Login-confirmation__headline"<% end %>>
|
||||
<h2 class="ic-Login-confirmation__headline">
|
||||
<%= t 'titles.problems_with_registration', "Problem with Registration" %>
|
||||
</h2>
|
||||
<p><%= t :details, %{It looks like you may have already confirmed your registration. Try
|
||||
|
@ -32,5 +26,5 @@
|
|||
or to let us know what's going on.", :link => help_link_name %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% if use_new_styles? %></div><% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -7,25 +7,14 @@
|
|||
<h1 class="screenreader-only"><%= t(:conference_header, 'Conferences')%></h1>
|
||||
|
||||
<% if can_do(WebConference.new(:context => @context), @current_user, :create) %>
|
||||
<% if use_new_styles? %>
|
||||
<div class="ic-Action-header ic-Action-header--before-item-groups">
|
||||
<div class="ic-Action-header__Secondary">
|
||||
<button type="button" class="btn btn-primary new-conference-btn" title="<%= t(:new_conference, 'New Conference') %>" aria-label="<%= t(:new_conference, 'New Conference') %>">
|
||||
<i class="icon-plus"></i>
|
||||
<%= t(:conference, 'Conference') %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="ic-Action-header ic-Action-header--before-item-groups">
|
||||
<div class="ic-Action-header__Secondary">
|
||||
<button type="button" class="btn btn-primary new-conference-btn" title="<%= t(:new_conference, 'New Conference') %>" aria-label="<%= t(:new_conference, 'New Conference') %>">
|
||||
<i class="icon-plus"></i>
|
||||
<%= t(:conference, 'Conference') %>
|
||||
</button>
|
||||
</div>
|
||||
<% else %>
|
||||
<header class="row-fluid">
|
||||
<div class="span3 offset9 align-right padding-r">
|
||||
<button type="button" class="btn btn-primary new-conference-btn" title="<%= t(:new_conference, 'New Conference') %>" aria-label="<%= t(:new_conference, 'New Conference') %>">
|
||||
<i class="icon-plus"></i>
|
||||
<%= t(:conference, 'Conference') %>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="item-group-container item-box">
|
||||
|
|
|
@ -6,156 +6,156 @@
|
|||
|
||||
<div class="conversations">
|
||||
<header class="panel">
|
||||
<% if use_new_styles? %><div class="panel__primary"><% end %>
|
||||
<div class="filters">
|
||||
<span aria-hidden="true" class="screenreader-only" id="course-filter-description">
|
||||
<%= t(:filter_messages_by_course, "Filter messages by course") %>
|
||||
|
||||
<span class="current-selection-label"></span>
|
||||
</span>
|
||||
<select class="course-filter" id="course-filter" aria-haspopup="true" aria-labelledby="course-filter-description"></select>
|
||||
<span aria-hidden="true" class="screenreader-only" id="type-filter-description">
|
||||
<%= t(:filter_messages_by_type, "Filter messages by type") %>
|
||||
|
||||
<span class="current-selection-label"></span>
|
||||
</span>
|
||||
<select class="type-filter show-tick" id="type-filter" aria-haspopup="true" aria-labelledby="type-filter-description">
|
||||
<option value="inbox"><%= t(:inbox, "Inbox") %></option>
|
||||
<option value="unread"><%= t(:unread, "Unread") %></option>
|
||||
<option value="starred"><%= t(:starred, "Starred") %></option>
|
||||
<option value="sent"><%= t(:sent, "Sent") %></option>
|
||||
<option value="archived"><%= t(:archived, "Archived") %></option>
|
||||
<option value="submission_comments"><%= t(:submission_comments, "Submission Comments") %></option>
|
||||
</select>
|
||||
</div>
|
||||
<% if use_new_styles? %></div><% end %>
|
||||
<% if use_new_styles? %><div class="panel__secondary"><% end %>
|
||||
<div class="actions" id="submission-comment-actions" style="display: none;">
|
||||
<button class="btn"
|
||||
id="submission-reply-btn"
|
||||
title="<%= t(:reply, "Reply") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t(:reply, "Reply") %></span>
|
||||
<i class="icon-reply-2"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="actions" id="conversation-actions">
|
||||
<button class="btn"
|
||||
id="compose-btn"
|
||||
title="<%= t(:compose_new_message, "Compose a new message") %>"
|
||||
data-tooltip>
|
||||
<span class="screenreader-only"><%= t(:compose_new_message, "Compose a new message") %></span>
|
||||
<i class="icon-compose"></i>
|
||||
</button>
|
||||
|
||||
<div class="btn-group">
|
||||
<div class="panel__primary">
|
||||
<div class="filters">
|
||||
<span aria-hidden="true" class="screenreader-only" id="course-filter-description">
|
||||
<%= t(:filter_messages_by_course, "Filter messages by course") %>
|
||||
|
||||
<span class="current-selection-label"></span>
|
||||
</span>
|
||||
<select class="course-filter" id="course-filter" aria-haspopup="true" aria-labelledby="course-filter-description"></select>
|
||||
<span aria-hidden="true" class="screenreader-only" id="type-filter-description">
|
||||
<%= t(:filter_messages_by_type, "Filter messages by type") %>
|
||||
|
||||
<span class="current-selection-label"></span>
|
||||
</span>
|
||||
<select class="type-filter show-tick" id="type-filter" aria-haspopup="true" aria-labelledby="type-filter-description">
|
||||
<option value="inbox"><%= t(:inbox, "Inbox") %></option>
|
||||
<option value="unread"><%= t(:unread, "Unread") %></option>
|
||||
<option value="starred"><%= t(:starred, "Starred") %></option>
|
||||
<option value="sent"><%= t(:sent, "Sent") %></option>
|
||||
<option value="archived"><%= t(:archived, "Archived") %></option>
|
||||
<option value="submission_comments"><%= t(:submission_comments, "Submission Comments") %></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel__secondary">
|
||||
<div class="actions" id="submission-comment-actions" style="display: none;">
|
||||
<button class="btn"
|
||||
id="reply-btn"
|
||||
id="submission-reply-btn"
|
||||
title="<%= t(:reply, "Reply") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t(:reply, "Reply") %></span>
|
||||
<i class="icon-reply-2"></i>
|
||||
</button>
|
||||
<button class="btn"
|
||||
id="reply-all-btn"
|
||||
title="<%= t(:reply_all, "Reply all") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t(:reply_all, "Reply all") %></span>
|
||||
<i class="icon-reply-all-2"></i>
|
||||
</button>
|
||||
<button class="btn"
|
||||
id="archive-btn"
|
||||
title="<%= t(:archive, "Archive") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t("Archive Selected") %></span>
|
||||
<i class="icon-collection-save"></i>
|
||||
</button>
|
||||
<button class="btn"
|
||||
id="delete-btn"
|
||||
title="<%= t(:delete, "Delete") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t("Delete Selected") %></span>
|
||||
<i class="icon-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="inline-block">
|
||||
<button class="al-trigger btn"
|
||||
id="admin-btn"
|
||||
title="<%= t(:more_options, "More options") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t(:settings, "Settings") %></span>
|
||||
<i class="icon-settings"></i>
|
||||
<i class="icon-mini-arrow-down"></i>
|
||||
<div class="actions" id="conversation-actions">
|
||||
<button class="btn"
|
||||
id="compose-btn"
|
||||
title="<%= t(:compose_new_message, "Compose a new message") %>"
|
||||
data-tooltip>
|
||||
<span class="screenreader-only"><%= t(:compose_new_message, "Compose a new message") %></span>
|
||||
<i class="icon-compose"></i>
|
||||
</button>
|
||||
<ul class="al-options" id="admin-menu">
|
||||
<li><a href="#" id="mark-unread-btn"><%= t(:mark_as_unread, "Mark as unread") %></a></li>
|
||||
<li><a href="#" id="mark-read-btn"><%= t(:mark_as_read, "Mark as read") %></a></li>
|
||||
<li><a href="#" id="forward-btn"><%= t(:forward, "Forward") %></a></li>
|
||||
<li><a href="#" id="star-toggle-btn"><%# text set by view %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sending-message" class="badge badge-info" aria-live="polite">
|
||||
<span><%= t(:sending, "sending") %></span>
|
||||
<div id="sending-spinner"></div>
|
||||
</div>
|
||||
|
||||
<div role="search" class="search <% unless use_new_styles? %>pull-right<% end %> form-search">
|
||||
<div class="ac" id="search-autocomplete">
|
||||
<div class="ac-input-box">
|
||||
<ul class="ac-token-list"></ul>
|
||||
<input type="search"
|
||||
class="ac-input"
|
||||
id="compose-message-recipients"
|
||||
aria-expanded="false"
|
||||
aria-activedescendant=""
|
||||
aria-owns="ac-result-list-2"
|
||||
aria-label="<%= t("Search by user") %>"
|
||||
aria-autocomplete="list" />
|
||||
<span aria-live="polite" class="ac-results-status screenreader-only" id="ac-input-description"></span>
|
||||
<span aria-live="polite" class="ac-selected-name screenreader-only"></span>
|
||||
|
||||
<a href="#"
|
||||
class="ac-clear"
|
||||
title="<%= t(:clear_search, "Clear search results") %>">
|
||||
<i class="icon-x"></i>
|
||||
<span class="screenreader-only">
|
||||
<%= t(:clear_search, "Clear search results") %>
|
||||
</span>
|
||||
</a>
|
||||
<div class="btn-group">
|
||||
<button class="btn"
|
||||
id="reply-btn"
|
||||
title="<%= t(:reply, "Reply") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t(:reply, "Reply") %></span>
|
||||
<i class="icon-reply-2"></i>
|
||||
</button>
|
||||
<button class="btn"
|
||||
id="reply-all-btn"
|
||||
title="<%= t(:reply_all, "Reply all") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t(:reply_all, "Reply all") %></span>
|
||||
<i class="icon-reply-all-2"></i>
|
||||
</button>
|
||||
<button class="btn"
|
||||
id="archive-btn"
|
||||
title="<%= t(:archive, "Archive") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t("Archive Selected") %></span>
|
||||
<i class="icon-collection-save"></i>
|
||||
</button>
|
||||
<button class="btn"
|
||||
id="delete-btn"
|
||||
title="<%= t(:delete, "Delete") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t("Delete Selected") %></span>
|
||||
<i class="icon-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button class="btn ac-search-btn recipient-finder"
|
||||
id="search-btn"
|
||||
type="button"
|
||||
title="<%= t(:search_for_recipients, "Search for recipients") %>"
|
||||
data-tooltip>
|
||||
<i class="icon-address-book"></i>
|
||||
<span class="screenreader-only">
|
||||
<%= t(:search_names_groups_courses, "Search names, groups, and courses") %>
|
||||
</span>
|
||||
</button>
|
||||
<div class="inline-block">
|
||||
<button class="al-trigger btn"
|
||||
id="admin-btn"
|
||||
title="<%= t(:more_options, "More options") %>"
|
||||
data-tooltip
|
||||
disabled>
|
||||
<span class="screenreader-only"><%= t(:settings, "Settings") %></span>
|
||||
<i class="icon-settings"></i>
|
||||
<i class="icon-mini-arrow-down"></i>
|
||||
</button>
|
||||
<ul class="al-options" id="admin-menu">
|
||||
<li><a href="#" id="mark-unread-btn"><%= t(:mark_as_unread, "Mark as unread") %></a></li>
|
||||
<li><a href="#" id="mark-read-btn"><%= t(:mark_as_read, "Mark as read") %></a></li>
|
||||
<li><a href="#" id="forward-btn"><%= t(:forward, "Forward") %></a></li>
|
||||
<li><a href="#" id="star-toggle-btn"><%# text set by view %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ac-result-wrapper" id="ac-result-list-2" aria-hidden="true">
|
||||
<div class="ac-result-container">
|
||||
<div class="ac-result-contents">
|
||||
<ul class="ac-result-list collectionViewItems" role="menu"></ul>
|
||||
<div class="paginatedLoadingIndicator"></div>
|
||||
<div id="sending-message" class="badge badge-info" aria-live="polite">
|
||||
<span><%= t(:sending, "sending") %></span>
|
||||
<div id="sending-spinner"></div>
|
||||
</div>
|
||||
|
||||
<div role="search" class="search form-search">
|
||||
<div class="ac" id="search-autocomplete">
|
||||
<div class="ac-input-box">
|
||||
<ul class="ac-token-list"></ul>
|
||||
<input type="search"
|
||||
class="ac-input"
|
||||
id="compose-message-recipients"
|
||||
aria-expanded="false"
|
||||
aria-activedescendant=""
|
||||
aria-owns="ac-result-list-2"
|
||||
aria-label="<%= t("Search by user") %>"
|
||||
aria-autocomplete="list" />
|
||||
<span aria-live="polite" class="ac-results-status screenreader-only" id="ac-input-description"></span>
|
||||
<span aria-live="polite" class="ac-selected-name screenreader-only"></span>
|
||||
|
||||
<a href="#"
|
||||
class="ac-clear"
|
||||
title="<%= t(:clear_search, "Clear search results") %>">
|
||||
<i class="icon-x"></i>
|
||||
<span class="screenreader-only">
|
||||
<%= t(:clear_search, "Clear search results") %>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<button class="btn ac-search-btn recipient-finder"
|
||||
id="search-btn"
|
||||
type="button"
|
||||
title="<%= t(:search_for_recipients, "Search for recipients") %>"
|
||||
data-tooltip>
|
||||
<i class="icon-address-book"></i>
|
||||
<span class="screenreader-only">
|
||||
<%= t(:search_names_groups_courses, "Search names, groups, and courses") %>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<div class="ac-result-wrapper" id="ac-result-list-2" aria-hidden="true">
|
||||
<div class="ac-result-container">
|
||||
<div class="ac-result-contents">
|
||||
<ul class="ac-result-list collectionViewItems" role="menu"></ul>
|
||||
<div class="paginatedLoadingIndicator"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if use_new_styles? %></div><% end %>
|
||||
</header>
|
||||
|
||||
<div class="row-fluid messaging-wrapper">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="rs-margin-lr<% unless use_new_styles? %> rs-margin-top<% end %>">
|
||||
<div class="rs-margin-lr">
|
||||
<%= external_tools_menu_items(@course_settings_sub_navigation_tools, {link_class: "btn button-sidebar-wide course-settings-sub-navigation-lti", settings_key: :course_settings_sub_navigation}) %>
|
||||
<% if can_do(@context, @current_user, :use_student_view) %>
|
||||
<%= link_to course_student_view_path(@context), :method => :post, :class => 'btn button-sidebar-wide student_view_button' do %>
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
<% if @current_enrollments.empty? %>
|
||||
<%= t("You are not enrolled in any courses.") %>
|
||||
<% else %>
|
||||
<table id="my_courses_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered course-list-table"
|
||||
<% else %>class="table table-bordered course-list-table"<% end %> >
|
||||
<table id="my_courses_table" class="ic-Table ic-Table--bordered course-list-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="course-list-star-column"><span class="screenreader-only"><%= t ('Favorites') %></span></th>
|
||||
|
@ -60,8 +59,7 @@
|
|||
<div class="content--hasMarginTop">
|
||||
<h2><%= t('headings.past_enrollments', %{Past Enrollments}) %></h2>
|
||||
</div>
|
||||
<table id="past_enrollments_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered course-list-table"
|
||||
<% else %>class="table table-bordered course-list-table"<% end %> >
|
||||
<table id="past_enrollments_table" class="ic-Table ic-Table--bordered course-list-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="course-list-star-column"><span class="screenreader-only"><%= t ('Favorites') %></span></th>
|
||||
|
@ -84,8 +82,7 @@
|
|||
<div class="content--hasMarginTop">
|
||||
<h2><%= t('headings.future_enrollments', 'Future Enrollments') %></h2>
|
||||
</div>
|
||||
<table id="future_enrollments_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered course-list-table"
|
||||
<% else %>class="table table-bordered course-list-table"<% end %> >
|
||||
<table id="future_enrollments_table" class="ic-Table ic-Table--bordered course-list-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="course-list-star-column"><span class="screenreader-only"><%= t ('Favorites') %></span></th>
|
||||
|
@ -109,8 +106,7 @@
|
|||
<div class="content--hasMarginTop">
|
||||
<h2><%= t('headings.my_groups', %{My Groups}) %></h2>
|
||||
</div>
|
||||
<table id="my_groups_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered course-list-table"
|
||||
<% else %>class="table table-bordered course-list-table"<% end %> >
|
||||
<table id="my_groups_table" class="ic-Table ic-Table--bordered course-list-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="course-list-group-column"><%= t ('Group') %></th>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<% @can_manage = can_do(@context, @current_user, :manage) %>
|
||||
<% @can_create_announcements = @context.announcements.temp_record.grants_right?(@current_user, session, :create) %>
|
||||
<% if can_do(@context, @current_user, :change_course_state) && (@context.unpublished? || @context.unpublishable?) %>
|
||||
<div id="course_status" <% unless use_new_styles? %>class="text-center"<% end %>>
|
||||
<div id="course_status">
|
||||
<h3>
|
||||
<%= t('headers.course_status', %{Course Status}) %>
|
||||
</h3>
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<% if @domain_root_account.feature_enabled?(:lor_for_account) || (@current_user && @current_user.feature_enabled?(:lor_for_user)) %>
|
||||
<% visibility = ContextExternalTool.global_navigation_visibility_for_user(@domain_root_account, @current_user) %>
|
||||
|
||||
<% cache([ContextExternalTool.global_navigation_menu_cache_key(@domain_root_account, visibility), use_new_styles?]) do %>
|
||||
<% cache([ContextExternalTool.global_navigation_menu_cache_key(@domain_root_account, visibility)]) do %>
|
||||
<% tools = ContextExternalTool.global_navigation_tools(@domain_root_account, visibility) %>
|
||||
<% tools.each do |tool|
|
||||
tool_path = account_external_tool_path(@domain_root_account, tool, :launch_type => 'global_navigation')
|
||||
%>
|
||||
<li id="<%= tool.asset_string %>_menu_item" class="menu-item <% if use_new_styles? %>ic-app-header__menu-list-item<% end %><% if current_page?(tool_path)%> ic-app-header__menu-list-item--active<% end %>">
|
||||
<% if use_new_styles? %>
|
||||
<li id="<%= tool.asset_string %>_menu_item" class="menu-item ic-app-header__menu-list-item<% if current_page?(tool_path)%> ic-app-header__menu-list-item--active<% end %>">
|
||||
<a class='ic-app-header__menu-list-link' href="<%= tool_path %>">
|
||||
<% svg_path = tool.extension_setting(:global_navigation, :icon_svg_path_64) %>
|
||||
<% if svg_path %>
|
||||
|
@ -21,11 +20,6 @@
|
|||
<%= tool.label_for(:global_navigation) %>
|
||||
</div>
|
||||
</a>
|
||||
<% else %>
|
||||
<a class='menu-item-no-drop' href="<%= tool_path %>">
|
||||
<%= tool.label_for(:global_navigation, I18n.locale) %>
|
||||
</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<%
|
||||
content_for :page_title, "Gradebook - #{@context.name}"
|
||||
@body_classes << "gradebook2 full-width"
|
||||
@show_left_side = use_new_styles?
|
||||
@collapse_course_menu = true if @show_left_side
|
||||
@show_left_side = true
|
||||
@collapse_course_menu = true
|
||||
@show_embedded_chat = false
|
||||
css_bundle :slickgrid, :gradebook2
|
||||
js_bundle :gradebook2
|
||||
|
|
|
@ -33,13 +33,8 @@
|
|||
<br class="clear" />
|
||||
</div>
|
||||
<div id="assignment_<%= assignment.assignment_id %>"class="assignment_details" style="display:none;">
|
||||
<% if use_new_styles? %>
|
||||
<table class="ic-Table ic-Table--condensed ic-Table--hover-row ic-Table--striped">
|
||||
<thead>
|
||||
<% else %>
|
||||
<table class="table table-condensed table-bordered table-hover table-striped">
|
||||
<thead class="toolbar">
|
||||
<% end %>
|
||||
<table class="ic-Table ic-Table--condensed ic-Table--hover-row ic-Table--striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t('headers.student', "Student") %></th>
|
||||
<th> <%= t('headers.before', "Before") %> </th>
|
||||
|
@ -50,11 +45,7 @@
|
|||
<tbody>
|
||||
<% assignment.submissions.each_with_index do |submission, i| %>
|
||||
<tr data-assignment-id="<%= submission.assignment_id %>" data-user-id="<%= submission.user_id %>">
|
||||
<% if use_new_styles? %>
|
||||
<th scope="row" class="ic-Table--header-row"><%= submission.student_name %></th>
|
||||
<% else %>
|
||||
<th scope="row"><%= submission.student_name %></th>
|
||||
<% end %>
|
||||
<th scope="row" class="ic-Table--header-row"><%= submission.student_name %></th>
|
||||
<td>
|
||||
<a href="#" class="ui-corner-all revert-grade-link" >
|
||||
<span class="ui-icon ui-icon-arrowrefresh-1-w"></span>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<% if @current_groups.empty? %>
|
||||
<%= t(:no_groups, "No Groups") %>
|
||||
<% else %>
|
||||
<table id="my_groups_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered" <% else %>class="table table-bordered current_groups course-list-table"<% end %> >
|
||||
<table id="my_groups_table" class="ic-Table ic-Table--bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="course-list-group-column"><%= t ('Group') %></th>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<% if @previous_groups.empty? %>
|
||||
<%= t(:no_groups, "No Groups") %>
|
||||
<% else %>
|
||||
<table id="my_groups_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered" <% else %>class="table table-bordered previous_groups course-list-table"<% end %> >
|
||||
<table id="my_groups_table" class="ic-Table ic-Table--bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="course-list-group-column"><%= t ('Group') %></th>
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{{#if collection.length}}
|
||||
|
||||
{{#if ENV.use_new_styles}}
|
||||
<table class="roster ic-Table ic-Table--hover-row ic-Table--condensed ic-Table--striped">
|
||||
{{else}}
|
||||
<table class="roster table table-hover table-striped table-condensed table-vertically-center">
|
||||
{{/if}}
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{{#if collection.length}}
|
||||
|
||||
{{#if ENV.use_new_styles}}
|
||||
<table class="roster ic-Table ic-Table--hover-row ic-Table--condensed ic-Table--striped">
|
||||
{{else}}
|
||||
<table class="roster table table-hover table-striped table-condensed table-vertically-center">
|
||||
{{/if}}
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><span class="screenreader-only">Profile Picture</span></th>
|
||||
|
|
|
@ -5,11 +5,7 @@
|
|||
<a
|
||||
href="{{previous.url}}"
|
||||
role="button"
|
||||
{{#if new_styles}}
|
||||
class="Button module-sequence-footer-button--previous"
|
||||
{{else}}
|
||||
class="pull-left"
|
||||
{{/if}}
|
||||
class="Button module-sequence-footer-button--previous"
|
||||
data-tooltip="right"
|
||||
data-html-tooltip-title="{{previous.tooltip}}"
|
||||
aria-describedby="msf{{instanceNumber}}-previous-desc"
|
||||
|
@ -23,11 +19,7 @@
|
|||
<a
|
||||
href="{{next.url}}"
|
||||
role="button"
|
||||
{{#if new_styles}}
|
||||
class="Button module-sequence-footer-button--next"
|
||||
{{else}}
|
||||
class="pull-right bordered"
|
||||
{{/if}}
|
||||
class="Button module-sequence-footer-button--next"
|
||||
data-tooltip="left"
|
||||
data-html-tooltip-title="{{next.tooltip}}"
|
||||
aria-describedby="msf{{instanceNumber}}-next-desc"
|
||||
|
|
|
@ -1,30 +1,16 @@
|
|||
<h1 class="screenreader-only">{{#t "progression_header"}}Module Progression{{/t}}</h1>
|
||||
<div
|
||||
{{#if ENV.use_new_styles}}
|
||||
class="module-progress-view"
|
||||
{{else}}
|
||||
class="row-fluid"
|
||||
{{/if}}
|
||||
>
|
||||
<div class="module-progress-view">
|
||||
<div
|
||||
{{#if ENV.use_new_styles}}
|
||||
class="module-progress-view__modules"
|
||||
{{else}}
|
||||
class="span9"
|
||||
{{/if}}
|
||||
class="module-progress-view__modules"
|
||||
id="progression_modules"
|
||||
aria-busy="true"
|
||||
aria-live="polite"
|
||||
aria-relevant="additions"
|
||||
aria-relevant="additions"
|
||||
aria-atomic="false"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
{{#if ENV.use_new_styles}}
|
||||
class="module-progress-view__students"
|
||||
{{else}}
|
||||
class="span3"
|
||||
{{/if}}
|
||||
class="module-progress-view__students"
|
||||
id="progression_students"
|
||||
aria-busy="true"
|
||||
>
|
||||
|
|
|
@ -15,11 +15,7 @@
|
|||
|
||||
<div class="index-content-container">
|
||||
<div class="index-content">
|
||||
{{#if ENV.use_new_styles}}
|
||||
<table class="ic-Table ic-Table--condensed ic-Table--striped ic-Table--hover-row" role="grid">
|
||||
{{else}}
|
||||
<table class="table" role="grid">
|
||||
{{/if}}
|
||||
<thead>
|
||||
<tr class="header-row" role="row">
|
||||
<th width="{{#if CAN.MANAGE}}{{#if CAN.PUBLISH}}42%{{else}}46%{{/if}}{{else}}60%{{/if}}" role="columnheader">
|
||||
|
|
|
@ -16,10 +16,8 @@
|
|||
<%= yield :head %>
|
||||
<%= yield :meta_tags %>
|
||||
<%= include_custom_meta_tags %>
|
||||
<% if use_new_styles? %>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="<%= brand_variable('ic-brand-primary') %>">
|
||||
<% end %>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="<%= brand_variable('ic-brand-primary') %>">
|
||||
<%= include_css_bundles %>
|
||||
<%= yield :stylesheets %>
|
||||
<%= include_account_css %>
|
||||
|
|
|
@ -56,24 +56,8 @@
|
|||
<%# Flash messages must be outside of #application or they won't work in screenreaders with modals open. %>
|
||||
<%= render :partial => 'shared/static_notices' %>
|
||||
<%= render :partial => 'shared/flash_notices' %>
|
||||
<div id="application" <% if use_new_styles? %>class="ic-app"<% end %>>
|
||||
|
||||
<% if use_new_styles? %>
|
||||
<%= render(:partial => 'shared/new_nav_header') unless @headers == false %>
|
||||
<% else %>
|
||||
<%# Begin default Canvas header %>
|
||||
<div id="header" class="no-print <%= 'no-user' unless @current_user %>">
|
||||
<div id="header-inner">
|
||||
<a href="#content" id="skip_navigation_link"><%= t 'Skip To Content' %></a>
|
||||
<a id="header-logo" href="<%= dashboard_url %>"><%= t 'links.dashboard', "My Dashboard" %></a>
|
||||
<b id="header-logo-secondary"></b>
|
||||
<%= render(:partial => "shared/user_header_navigation") %>
|
||||
<%= render(:partial => "shared/keyboard_navigation_hint") if keyboard_navigation %>
|
||||
<%= render(:partial => "shared/primary_header_navigation") %>
|
||||
</div>
|
||||
</div>
|
||||
<%# End default Canvas header %>
|
||||
<% end %>
|
||||
<div id="application" class="ic-app">
|
||||
<%= render(:partial => 'shared/new_nav_header') unless @headers == false %>
|
||||
|
||||
<div id="instructure_ajax_error_box">
|
||||
<div style="text-align: right; background-color: #fff;"><a href="#" class="close_instructure_ajax_error_box_link"><%= t('links.close', 'Close') %></a></div>
|
||||
|
@ -82,10 +66,9 @@
|
|||
|
||||
<%= yield :leading_content %>
|
||||
|
||||
<div id="wrapper-container" <% if use_new_styles? %>class="ic-app-container"<% end %>>
|
||||
<div id="wrapper" <% if use_new_styles? %>class="ic-app-main-layout-vertical"<% end %>>
|
||||
<% #Start new styles div %>
|
||||
<% if crumbs.length > 1 && use_new_styles? %>
|
||||
<div id="wrapper-container" class="ic-app-container">
|
||||
<div id="wrapper" class="ic-app-main-layout-vertical">
|
||||
<% if crumbs.length > 1 %>
|
||||
<div class="ic-app-nav-toggle-and-crumbs no-print">
|
||||
<% if @show_left_side %>
|
||||
<button type="button" aria-hidden="true" id="courseMenuToggle" class="Button Button--link Button--small ic-app-course-nav-toggle" title="<%= t('Show and hide courses menu') %>"><i class="icon-hamburger"></i></button>
|
||||
|
@ -95,17 +78,12 @@
|
|||
<% if @show_left_side %></div><% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if use_new_styles? %><div class="ic-app-main-layout-horizontal"><% end %>
|
||||
<div class="ic-app-main-layout-horizontal">
|
||||
<% if @show_left_side %>
|
||||
<div id="left-side" class="<% if !@no_left_side_list_view %>list-view<% end %> <% if use_new_styles? %>ic-app-course-menu<% end %>">
|
||||
<div id="left-side" class="ic-app-course-menu <% if !@no_left_side_list_view %>list-view<% end %>">
|
||||
<% if left_side %>
|
||||
<%= left_side %>
|
||||
<% else %>
|
||||
<% if @context.try(:short_name) && !use_new_styles? %>
|
||||
<h1 id="section-tabs-header">
|
||||
<%= @context.short_name %>
|
||||
</h1>
|
||||
<% end %>
|
||||
<% if @context && @context.is_a?(Group) && can_do(@context, @current_user, :manage) && @context.group_category %>
|
||||
<a class="al-trigger" href="#" style="display:inline-block; float:right" data-popup-within="#wrapper">
|
||||
<i class="icon-mini-arrow-down"></i>
|
||||
|
@ -129,25 +107,23 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="main" <% if use_new_styles? %>class="ic-app-main-and-right-side"<% end %>>
|
||||
<div id="not_right_side" <% if use_new_styles? %>class="ic-app-main-content"<% end %>>
|
||||
<div id="content-wrapper" <% if use_new_styles? %>class="ic-app-main-content__primary"<% end %>>
|
||||
<% unless use_new_styles? %><%= render_crumbs %><% end %>
|
||||
<div id="main" class="ic-app-main-and-right-side">
|
||||
<div id="not_right_side" class="ic-app-main-content">
|
||||
<div id="content-wrapper" class="ic-app-main-content__primary">
|
||||
<%= render :partial => 'shared/content_notices' if @show_left_side && @context && @context.respond_to?(:content_notices) %>
|
||||
<div id="content" role="main" <% unless use_new_styles? %>class="container-fluid"<% end %>>
|
||||
<div id="content" role="main">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="right-side-wrapper" <% if use_new_styles? %>class="ic-app-main-content__secondary"<% end %>>
|
||||
<div id="right-side-wrapper" class="ic-app-main-content__secondary">
|
||||
<aside id="right-side" role="complementary">
|
||||
<%= right_side %>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% #End new styles div %>
|
||||
<% if use_new_styles? %></div><% end %>
|
||||
<% if (use_new_styles? && @show_footer) or !use_new_styles? %>
|
||||
</div>
|
||||
<% if @show_footer %>
|
||||
<%= render :partial => 'shared/canvas_footer' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
<%= include_css_bundles %>
|
||||
<%= include_account_css %>
|
||||
|
||||
<% if use_new_styles? %>
|
||||
<meta name="theme-color" content="<%= brand_variable('ic-brand-primary') %>">
|
||||
<% end %>
|
||||
<meta name="theme-color" content="<%= brand_variable('ic-brand-primary') %>">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
<% url = (params[:canvas_login] != '1' && @domain_root_account.try(:forgot_password_external_url)) || "#" %>
|
||||
<% if !use_new_styles? %><br /><% end %>
|
||||
<%= link_to t('dont_know_password', "Forgot Password?"), url, :class => (url != '#' ? "ic-Login__link not_external" : "ic-Login__link forgot_password_link"), :id => "login_forgot_password" %>
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
<% login_handle_name = @domain_root_account.login_handle_name_with_inference %>
|
||||
<div id="modal-box" class="login-box">
|
||||
<div id="modal-box-inner">
|
||||
<div class="clearfix">
|
||||
<h1 class="span4">Canvas</h1>
|
||||
<% if @domain_root_account.feature_enabled?(:course_catalog) %>
|
||||
<div class="ic-Login__header__courses-active">
|
||||
<a href="/search/all_courses" class="pull-right"><%= t('browse_courses', 'Browse courses') %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= form_for :pseudonym_session, :url => url_for({ action: :create }.merge(params.slice(:id))), :html => {:id => "login_form"} do |f| %>
|
||||
|
||||
<%= render "login/canvas/login_banner" %>
|
||||
|
||||
<h2 class="ui-helper-hidden-accessible"><%= t('log_in', 'Log In') %></h2>
|
||||
<% login_inner_dialog = yield :login_inner_dialog %>
|
||||
<%= login_inner_dialog if login_inner_dialog && !login_inner_dialog.strip.empty? %>
|
||||
<input type="hidden" name="redirect_to_ssl" value="1"/>
|
||||
<div>
|
||||
<span class="field-with-fancyplaceholder">
|
||||
<%= f.label :unique_id, login_handle_name, :class => (use_new_styles? ? "ic-Label" : "boo") %>
|
||||
<%= f.text_field :unique_id, :class => (use_new_styles? ? "ic-Input text" : "text"), :value => params[:pseudonym_session].try(:[], :unique_id) %>
|
||||
</span>
|
||||
<span class="field-with-fancyplaceholder">
|
||||
<%= f.label :password, :en => "Password", :class => (use_new_styles? ? "ic-Label" : nil) %>
|
||||
<%= f.password_field :password, :class => (use_new_styles? ? "ic-Input text" : "text") %>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="login-options">
|
||||
<% unless session_timeout_enabled? %>
|
||||
<%= f.check_box :remember_me, :checked => session[:used_remember_me_token] %>
|
||||
<%= f.label :remember_me, :en => "Stay signed in" %>
|
||||
<% end %>
|
||||
<!-- i didn't add this - this is the saddest hack ever -->
|
||||
<%= render "login/canvas/forgot_password_link" %>
|
||||
</div>
|
||||
<!-- crazy IE 8-9 workaround!, if you take this input type=submit out, you cannot just submit the form by hitting enter in ie8-9 -->
|
||||
<input type="submit" style="position: absolute; height: 0px; width: 0px; border: none; padding: 0px;" hidefocus="true" tabindex="-1" />
|
||||
<button type="submit" class="btn btn-primary"><%= t('log_in', 'Log In') %></button>
|
||||
</div> <!-- ic-Login__actions -->
|
||||
<% end %>
|
||||
<%= form_for :pseudonym_session, :url => forgot_password_path, :html => {:id => "forgot_password_form", :style => "display: none;"} do |f| %>
|
||||
<p id="forgot_password_instructions">
|
||||
<%= t('login_handle', "Enter your %{login_handle_name} and we'll send you a link to change your password.", :login_handle_name => login_handle_name) %>
|
||||
</p>
|
||||
<div>
|
||||
<span class=" field-with-fancyplaceholder">
|
||||
<label for="pseudonym_session_unique_id_forgot">
|
||||
<%= login_handle_name %>
|
||||
</label>
|
||||
<input aria-describedby="forgot_password_instructions" class="email_address text" type="text" name="pseudonym_session[unique_id_forgot]" value="<%= @unauthorized_user.email rescue '' %>" id="pseudonym_session_unique_id_forgot" />
|
||||
</span>
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<%= t('buttons.request_password', 'Request Password') %>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
← <%= link_to t('back_to_login', "Back to Login"), login_path, :class => "login_link" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render partial: "sso_buttons", locals: { aacs: @aacs_with_buttons } %>
|
||||
</div>
|
|
@ -6,7 +6,7 @@
|
|||
:PASSWORD_POLICY => @domain_root_account.password_policy %>
|
||||
<%= link_to '#',
|
||||
:id => 'coenrollment_link',
|
||||
:class => (use_new_styles? ? "ic-Login__link ic-Login__register-banner" : "register_banner"),
|
||||
:class => "ic-Login__link ic-Login__register-banner",
|
||||
data: reg_link_data(@domain_root_account.parent_auth_type) do %>
|
||||
<div class="ic-Login__banner-title">
|
||||
<%= t('Parent of a Canvas User?') %>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<% else %>
|
||||
<%= link_to Setting.get("registration_link", "/register_from_website"),
|
||||
:id => 'register_link',
|
||||
:class => (use_new_styles? ? "ic-Login__link ic-Login__register-banner" : "not_external register_banner") do %>
|
||||
:class => "ic-Login__link ic-Login__register-banner" do %>
|
||||
<div class="ic-Login__banner-title">
|
||||
<%= t('Need a Canvas Account?') %>
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<% if aacs.present? %>
|
||||
<div class="ic-Login__sso">
|
||||
<% unless use_new_styles? %>
|
||||
<h4 class="ic-Login__sso-divider" role="presentation">
|
||||
<%= t('OR') %>
|
||||
</h4>
|
||||
<% end %>
|
||||
<ul class="ic-Login__sso-list">
|
||||
<% aacs.each do |aac| %>
|
||||
<% only_one = aacs.size < 2 %>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<%
|
||||
css_bundle :login
|
||||
js_bundle :login
|
||||
|
@ -7,13 +6,8 @@
|
|||
|
||||
<% extend Api::V1::Account %>
|
||||
|
||||
<% if use_new_styles? %>
|
||||
<% @body_classes << "full-width ic-Login-Body" if @body_classes %>
|
||||
<%= render "login/canvas/new_login_content" %>
|
||||
<% else %>
|
||||
<% @body_classes << "modal" if @body_classes %>
|
||||
<%= render "login/canvas/legacy_login_content" %>
|
||||
<% end %>
|
||||
<% @body_classes << "full-width ic-Login-Body" if @body_classes %>
|
||||
<%= render "login/canvas/new_login_content" %>
|
||||
|
||||
<%= # for plugin use
|
||||
render "shared/login_trailer" %>
|
||||
|
|
|
@ -2,50 +2,32 @@
|
|||
css_bundle :login
|
||||
@headers = false
|
||||
content_for :page_title, t(:page_title, "Log Out")
|
||||
@body_classes << "full-width ic-Login-Body" if @body_classes
|
||||
%>
|
||||
<% if use_new_styles? %>
|
||||
<% @body_classes << "full-width ic-Login-Body" if @body_classes %>
|
||||
<div class="ic-Login">
|
||||
<div class="ic-Login__container">
|
||||
<div class="ic-Login__content">
|
||||
<div class="ic-Login__innerContent">
|
||||
<div class="ic-Login__header">
|
||||
<%= render :partial => 'login/shared/header_logo' %>
|
||||
</div>
|
||||
<div class="ic-Login__body">
|
||||
<h1 class="ic-Login__title">
|
||||
<%= t 'log_out', 'Log Out' %>
|
||||
</h1>
|
||||
<p class="ic-Login__text">
|
||||
<%= t 'details.log_out', 'Are you sure you want to log out of Canvas?' %>
|
||||
</p>
|
||||
<%= form_tag logout_path, method: :delete do %>
|
||||
<div class="ic-Login__actions">
|
||||
<%= link_to(t(:cancel, "Cancel"), '/', :class => (use_new_styles? ? "Button Button--link Button--logout-link" : "btn")) %>
|
||||
<div class="ic-Login__actions--right">
|
||||
<%= submit_tag(t("Log Out"), :class => "Button Button--primary Button--logout-confirm") %>
|
||||
</div>
|
||||
<div class="ic-Login">
|
||||
<div class="ic-Login__container">
|
||||
<div class="ic-Login__content">
|
||||
<div class="ic-Login__innerContent">
|
||||
<div class="ic-Login__header">
|
||||
<%= render :partial => 'login/shared/header_logo' %>
|
||||
</div>
|
||||
<div class="ic-Login__body">
|
||||
<h1 class="ic-Login__title">
|
||||
<%= t 'log_out', 'Log Out' %>
|
||||
</h1>
|
||||
<p class="ic-Login__text">
|
||||
<%= t 'details.log_out', 'Are you sure you want to log out of Canvas?' %>
|
||||
</p>
|
||||
<%= form_tag logout_path, method: :delete do %>
|
||||
<div class="ic-Login__actions">
|
||||
<%= link_to(t(:cancel, "Cancel"), '/', :class => "Button Button--link Button--logout-link") %>
|
||||
<div class="ic-Login__actions--right">
|
||||
<%= submit_tag(t("Log Out"), :class => "Button Button--primary Button--logout-confirm") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div> <!-- end ic-Login__body -->
|
||||
</div> <!-- end ic-Login__innerContent -->
|
||||
</div> <!-- end ic-Login__content -->
|
||||
</div>
|
||||
<% end %>
|
||||
</div> <!-- end ic-Login__body -->
|
||||
</div> <!-- end ic-Login__innerContent -->
|
||||
</div> <!-- end ic-Login__content -->
|
||||
</div> <!-- end ic-Login__container -->
|
||||
<% else %>
|
||||
<% @body_classes << "modal" if @body_classes %>
|
||||
<!-- Legacy UI for Logout -->
|
||||
<div id="modal-box">
|
||||
<h1><%= t 'log_out', 'Log Out' %></h1>
|
||||
<p>
|
||||
<%= t 'details.log_out', 'Are you sure you want to log out of Canvas?' %>
|
||||
</p>
|
||||
<%= form_tag logout_path, method: :delete do %>
|
||||
<div class="button_box">
|
||||
<%= link_to(t(:cancel, "Cancel"), '/', :class => "btn") %>
|
||||
<%= submit_tag(t("Log Out"), :class => "btn btn-primary") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div> <!-- end ic-Login__content -->
|
||||
</div> <!-- end ic-Login__container -->
|
||||
|
|
|
@ -2,12 +2,7 @@
|
|||
css_bundle :otp_login
|
||||
js_bundle :otp_login
|
||||
@headers = false
|
||||
if use_new_styles?
|
||||
@body_classes << "full-width modal body--login-confirmation"
|
||||
else
|
||||
@body_classes << "modal body--login-confirmation"
|
||||
end
|
||||
|
||||
@body_classes << "full-width modal body--login-confirmation"
|
||||
content_for :page_title, t(:page_title, "Multi-factor Authentication")
|
||||
%>
|
||||
|
||||
|
@ -15,14 +10,12 @@
|
|||
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=yes,width=device-width">
|
||||
<% end %>
|
||||
|
||||
<div id="modal-box"<% if use_new_styles? %> class="ic-Login-confirmation"<% end %>>
|
||||
<% if use_new_styles? %>
|
||||
<div id="modal-box" class="ic-Login-confirmation">
|
||||
<header class="ic-Login-confirmation__header">
|
||||
<%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:"Canvas by Instructure") %>
|
||||
</header>
|
||||
<div class="ic-Login-confirmation__content">
|
||||
<% end %>
|
||||
<h2<% if use_new_styles? %> class="ic-Login-confirmation__headline"<% end %>><%= t 'titles.mfa', "Multi-factor Authentication" %></h2>
|
||||
<h2 class="ic-Login-confirmation__headline"><%= t 'titles.mfa', "Multi-factor Authentication" %></h2>
|
||||
<% if configuring? %>
|
||||
<div>
|
||||
<% if @current_user.mfa_settings(pseudonym_hint: @current_pseudonym) == :required %>
|
||||
|
@ -94,5 +87,5 @@ secret key **%{secret_key}**.
|
|||
<%= f.check_box :remember_me %> <%= f.label :remember_me, :en => "Remember this computer" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if use_new_styles? %></div><% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<%
|
||||
if use_new_styles?
|
||||
@body_classes << 'ic-framed-lti-tool'
|
||||
end
|
||||
@body_classes << 'ic-framed-lti-tool'
|
||||
%>
|
||||
|
||||
<%= render 'lti/lti_message' %>
|
|
@ -1,10 +1,6 @@
|
|||
<%
|
||||
@show_left_side = false
|
||||
if use_new_styles?
|
||||
@body_classes << 'full-width ic-no-flex-layout ic-full-screen-lti-tool'
|
||||
else
|
||||
@body_classes << 'full-width'
|
||||
end
|
||||
@body_classes << 'full-width ic-no-flex-layout ic-full-screen-lti-tool'
|
||||
crumbs.clear
|
||||
%>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<h2<% if use_new_styles? %> class="ic-Login-confirmation__headline"<% end %>>
|
||||
<h2 class="ic-Login-confirmation__headline">
|
||||
<% if @provider.icon_url %>
|
||||
<%= image_tag @provider.icon_url, :alt => t("Provider icon"), :class => use_new_styles? ? 'ic-Login-confirmation__auth-icon' : 'icon_url' %>
|
||||
<%= image_tag @provider.icon_url, :alt => t("Provider icon"), :class => 'ic-Login-confirmation__auth-icon' %>
|
||||
<% end %>
|
||||
<%= @provider.app_name %>
|
||||
</h2>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<% end %>
|
||||
</p>
|
||||
<%= form_tag oauth2_auth_accept_path, id: "oauth2_accept_form" do %>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<%= link_to(t(:cancel, "Cancel"), oauth2_auth_deny_path, :class => "btn") %>
|
||||
<%= submit_tag(t("Authorize"), class: "btn btn-primary", disable_with: t('Please wait...')) %>
|
||||
</div>
|
||||
|
|
|
@ -6,17 +6,11 @@
|
|||
content_for :page_title, t(:page_title, "App Login")
|
||||
%>
|
||||
|
||||
<% if use_new_styles? %>
|
||||
<div id="modal-box" class="ic-Login-confirmation">
|
||||
<header class="ic-Login-confirmation__header">
|
||||
<%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:t("Canvas by Instructure")) %>
|
||||
<%= image_tag("login/canvas-logo@2x.png", :class => "ic-Login-confirmation__logo", :alt => t("Canvas by Instructure")) %>
|
||||
</header>
|
||||
<div class="ic-Login-confirmation__content">
|
||||
<%= render("confirm_form") %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="modal-box">
|
||||
<%= render("confirm_form") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -7,27 +7,21 @@
|
|||
if !@current_user && !@embedded_view
|
||||
css_bundle :login
|
||||
@headers = false
|
||||
if use_new_styles?
|
||||
@body_classes << "full-width body--login-confirmation"
|
||||
else
|
||||
@body_classes << "modal"
|
||||
end
|
||||
@body_classes << "full-width body--login-confirmation"
|
||||
end
|
||||
%>
|
||||
|
||||
<div
|
||||
id="modal-box"
|
||||
<% if use_new_styles? && !@current_user && !@embedded_view %>class="ic-Login-confirmation"<% end %>
|
||||
<% if !@current_user && !@embedded_view %>class="ic-Login-confirmation"<% end %>
|
||||
>
|
||||
<% if use_new_styles? && !@current_user && !@embedded_view %>
|
||||
<% if !@current_user && !@embedded_view %>
|
||||
<header class="ic-Login-confirmation__header">
|
||||
<%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:"Canvas by Instructure") %>
|
||||
</header>
|
||||
<div class="ic-Login-confirmation__content">
|
||||
<% end %>
|
||||
<h2
|
||||
<% if use_new_styles? %> class="ic-Login-confirmation__headline"<% end %>
|
||||
>
|
||||
<h2 class="ic-Login-confirmation__headline">
|
||||
<%= t('titles.course_enrollment', 'Enroll in %{course}', :course => @course.name) %>
|
||||
</h2>
|
||||
<% if !@course.self_enrollment_enabled? %>
|
||||
|
@ -49,6 +43,6 @@
|
|||
<%= render :partial => 'authenticate' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if use_new_styles? && !@current_user && !@embedded_view %></div><% end %>
|
||||
<% if !@current_user && !@embedded_view %></div><% end %>
|
||||
<% if @embedded_view %></div><% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
<footer role="contentinfo" id="footer" <% if use_new_styles? %>class="ic-app-footer"<% end %>>
|
||||
<a href="http://www.instructure.com" class="footer-logo <% if use_new_styles? %>ic-app-footer__logo-link<% end %>">
|
||||
<footer role="contentinfo" id="footer" class="ic-app-footer">
|
||||
<a href="http://www.instructure.com" class="footer-logo ic-app-footer__logo-link">
|
||||
<span class="screenreader-only">
|
||||
<%= t(:by_instructure, 'By Instructure') %>
|
||||
</span>
|
||||
</a>
|
||||
<% if use_new_styles? %><div
|
||||
<% else %><span
|
||||
<% end %>
|
||||
id="footer-links"
|
||||
<% if use_new_styles? %>class="ic-app-footer__links"<% end %>>
|
||||
<div id="footer-links" class="ic-app-footer__links">
|
||||
<% if Setting.get("show_opensource_linkback", "false") == "true" %>
|
||||
<a href="http://instructure.com"><%= t('open_source_learning_management_system', 'Open Source LMS') %></a>
|
||||
<% end %>
|
||||
<a target="_blank" href="http://eepurl.com/1LSkT"><%= t('User Research', 'User Research') %></a>
|
||||
<% unless use_new_styles? %>
|
||||
<%= help_link %>
|
||||
<% end %>
|
||||
<%= render :partial => 'shared/footer_links' %>
|
||||
<% if use_new_styles? %></div>
|
||||
<% else %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<td class="course-list-course-title-column
|
||||
<%= "course-list-no-left-border" if @show_star_column %>
|
||||
<%= "course-list-not-favoritable" unless @show_star_column %>">
|
||||
<% if use_new_styles? && course_color.present? %>
|
||||
<% if course_color.present? %>
|
||||
<span aria-hidden="true" class="course-color-block" style="<%= "color: #{course_color};" %>" ></span>
|
||||
<% end %>
|
||||
<% if show_link %><a href="<%= course_path(current_enrollment.course_id) %>" title="<%= current_enrollment.course.name %>"><% end %>
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
<% @current_user.set_menu_data(session[:enrollment_uuid]) %>
|
||||
<a href="<%= courses_path %>" class="menu-item-title">
|
||||
|
||||
<%= @current_user.menu_data[:group_memberships_count].zero? ? t('links.courses', "Courses") : t('links.courses_and_groups', "Courses & Groups") -%>
|
||||
<span class="menu-item-title-icon"></span> <i class="icon-mini-arrow-down"></i>
|
||||
</a>
|
||||
<div class="menu-item-drop">
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<%= render(:partial => "shared/menu_courses", :locals => menu_courses_locals) %>
|
||||
<%= render(:partial => "shared/menu_section", :locals => menu_groups_locals) %>
|
||||
<%= render(:partial => "shared/menu_section", :locals => menu_accounts_locals) %>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
|
@ -1,43 +0,0 @@
|
|||
<ul id="identity">
|
||||
<% if !@current_user %>
|
||||
<% if !@domain_root_account || @domain_root_account == Account.default %>
|
||||
<li><%= link_to t('links.sign_up_as_teacher', "Sign Up as a Teacher"), register_path %></li>
|
||||
<li><%= link_to "Log In", login_path %></li>
|
||||
<% else %>
|
||||
<li><%= link_to t('links.log_in', "Log In"), login_path %></li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @real_current_user && @real_current_user != @current_user %>
|
||||
<li class="user_name"><%= link_to t('masquerading.as', "As: *%{user_name}*", :user_name => @current_user.short_name, :wrapper => '<span class="emphasize-name">\1</span>'), user_profile_path(@current_user) %></li>
|
||||
<% else %>
|
||||
<li class="user_name"><%= link_to @current_user.short_name, user_profile_path(@current_user) %></li>
|
||||
<% end %>
|
||||
<% unless @current_user.fake_student? %>
|
||||
<li class="first inbox">
|
||||
<a href="<%= conversations_path %>">
|
||||
<span><%= t 'links.inbox', "Inbox" %></span>
|
||||
<% unless @current_user.disabled_inbox? %>
|
||||
<%- cache_if(!@real_current_user, [@current_user || 'nobody', 'identity-unread-messages-count-15m'], :expires_in => 15.minutes) do -%>
|
||||
<% unread = @current_user.unread_conversations_count %>
|
||||
<b class="unread-messages-count"<% if unread == 0 %> style="display: none;"<% end %>><%= unread %></b>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<li><%= link_to t('links.settings', "Settings"), settings_profile_path %></li>
|
||||
<% end %>
|
||||
<li class="user_id" style="display: none;"><%= @current_user.id %></li>
|
||||
<li class="course_id" style="display: none;"><%= @context.id if @context && @context.is_a?(Course) %></li>
|
||||
<li class="user_long_name" style="display: none;"><%= @current_user.name %></li>
|
||||
<li class="logout">
|
||||
<%= form_tag(logout_path, method: :delete, id: 'identity-logout-form') do %>
|
||||
<%= link_to(t('links.logout', "Logout"), logout_path, onclick: "document.getElementById('identity-logout-form').submit(); return false") %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if help_link %>
|
||||
<li id="identity-help-container">
|
||||
<%= help_link %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -1,3 +0,0 @@
|
|||
<div class="hidden-readable">
|
||||
<%= t :prompt, %{Press comma to hear a list of keyboard shortcuts for this page.} %>
|
||||
</div>
|
|
@ -1,8 +0,0 @@
|
|||
<li>
|
||||
<a href="<%= url_for(menu_account) %>">
|
||||
<span class="name ellipsis"><%= menu_account.name %></span>
|
||||
<% unless menu_account.root_account? %>
|
||||
<span class="subtitle ellipsis"><%= menu_account.root_account.name %></span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
|
@ -1,34 +0,0 @@
|
|||
<% key ||= nil %>
|
||||
<li>
|
||||
<% if key == :assignments_needing_grading %>
|
||||
<a href="<%= speed_grader_course_gradebook_path( menu_assignment.context_id, :assignment_id => menu_assignment.id) %>" data-track-category="assignment dropdown" data-track-label="needs grading">
|
||||
<% else %>
|
||||
<a href="<%= course_assignment_path( menu_assignment.context_id, menu_assignment.id ) %>" data-track-category="assignment dropdown" data-track-label="needs submitting">
|
||||
<% end %>
|
||||
<span class="name-right-wrapper">
|
||||
<span class="secondary-right">
|
||||
<% if key == :assignments_needing_submitting %>
|
||||
<%= before_label :due, "due" %> <%= datetime_string(menu_assignment.due_at, :due_date, nil, true) %>
|
||||
<% elsif key == :assignments_needing_grading %>
|
||||
<%= t :needs_grading_count, { one: "1 needs grading", other: "%{count} need grading"}, count: Assignments::NeedsGradingCountQuery.new(menu_assignment, @current_user).count %>
|
||||
<% elsif key == :assignments_recently_graded %>
|
||||
<% if menu_assignment.grading_type == 'points' %>
|
||||
<%= "#{menu_assignment.score}/#{round_if_whole(menu_assignment.points_possible)}" %>
|
||||
<% else %>
|
||||
<%= "#{menu_assignment.grade}" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="name ellipsis" <%= "title='#{menu_assignment.title}'" if menu_assignment.title && menu_assignment.title.length > 35 %>><%= menu_assignment.title %></span>
|
||||
</span>
|
||||
<%
|
||||
context_name = case menu_assignment
|
||||
when Assignment
|
||||
menu_assignment.context.name
|
||||
when Submission
|
||||
menu_assignment.context_name
|
||||
end
|
||||
%>
|
||||
<span class="subtitle"><%= context_name %></span>
|
||||
</a>
|
||||
</li>
|
|
@ -1,9 +0,0 @@
|
|||
<li class="customListItem" data-id="<%= menu_course[:id] %>">
|
||||
<a href="<%= menu_course[:href] %>">
|
||||
<span class="name ellipsis" title="<%= menu_course[:longName] %>"><%= menu_course[:shortName] %></span>
|
||||
<% if defined? menu_course[:term] %>
|
||||
<span class="subtitle ellipsis enrollment_term menu-item-drop-float-right"><%= menu_course[:term] %></span>
|
||||
<% end %>
|
||||
<span class="subtitle ellipsis"><%= menu_course[:subtitle] %></span>
|
||||
</a>
|
||||
</li>
|
|
@ -1,13 +0,0 @@
|
|||
<td class="menu-item-drop-column" id="menu_enrollments">
|
||||
<div class="menu-item-header-container">
|
||||
<span class="menu-item-heading">
|
||||
<%= title %>
|
||||
</span>
|
||||
<div class="menu-item-customize">
|
||||
<%= link_to "#{link_text} (#{collection_size})", more_link_for_over_max, {:class => "customListOpen"} %>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="menu-item-drop-column-list">
|
||||
<%= render :partial => 'shared/menu_course', :collection => collection %>
|
||||
</ul>
|
||||
</td>
|
|
@ -1,6 +0,0 @@
|
|||
<li>
|
||||
<a href="<%= group_path(menu_group_membership.group) %>">
|
||||
<span class="name ellipsis"><%= menu_group_membership.group.name %></span>
|
||||
<span class="subtitle ellipsis"><%= menu_group_membership.group.context.name %> </span>
|
||||
</a>
|
||||
</li>
|
|
@ -1,12 +0,0 @@
|
|||
<% max_to_show ||= nil; link_text ||= nil; custom ||= nil %>
|
||||
<% if collection && !collection.empty? %>
|
||||
<td class="menu-item-drop-column">
|
||||
<span class="menu-item-heading"><%= title %></span>
|
||||
<ul class="menu-item-drop-column-list">
|
||||
<%= render :partial => partial, :collection => max_to_show ? collection.first(max_to_show) : collection, :locals => {:title => title } %>
|
||||
<% if link_text %>
|
||||
<li class="menu-item-view-all"><%= link_to("#{link_text} (#{(collection_size || collection.size)})", more_link_for_over_max, 'data-track-category' => 'assignment dropdown', 'data-track-label' => 'navigated') %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</td>
|
||||
<% end %>
|
|
@ -1,21 +0,0 @@
|
|||
<% if @current_user %>
|
||||
<ul role="navigation" id="menu" aria-label="<%= t('navigation.main', 'Main Navigation') %>">
|
||||
<%- cache([@current_user, 'home-menu-15m'], :expires_in => 15.minutes) do -%>
|
||||
|
||||
<li id="courses_menu_item" class="menu-item">
|
||||
<%= render(:partial => 'shared/home_menu') %>
|
||||
</li>
|
||||
<%- end -%>
|
||||
<li id="grades_menu_item" class="menu-item">
|
||||
<a href="<%= grades_path %>" class="menu-item-no-drop">
|
||||
<%= t('menu.grades', 'Grades') %>
|
||||
</a>
|
||||
</li>
|
||||
<li id="calendar_menu_item" class="menu-item">
|
||||
<a href="<%= calendar_path %>" class="menu-item-no-drop">
|
||||
<%= t('menu.calendar', 'Calendar') %>
|
||||
</a>
|
||||
</li>
|
||||
<%= render(:partial => 'external_tools/global_nav_menu_items') %>
|
||||
</ul>
|
||||
<% end %>
|
|
@ -1,7 +0,0 @@
|
|||
<div id="topbar" role="navigation" aria-label="<%= t('navigation.user_menu', 'User Menu') %>">
|
||||
<% if (identity = (yield :identity).presence) %>
|
||||
<%= identity %>
|
||||
<% else %>
|
||||
<%= render(:partial => 'shared/identity') %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -8,39 +8,32 @@
|
|||
@headers = false
|
||||
@body_classes ||= []
|
||||
@body_classes << "modal body--login-confirmation"
|
||||
if use_new_styles?
|
||||
modal_classes = "reaccept_terms ic-Login-confirmation"
|
||||
else
|
||||
modal_classes = "reaccept_terms clearfix"
|
||||
end
|
||||
%>
|
||||
|
||||
<%= form_tag("/api/v1/users/self", method: "put", class: modal_classes, id: "modal-box") do %>
|
||||
<% if use_new_styles? %>
|
||||
<%= form_tag("/api/v1/users/self", method: "put", class: "reaccept_terms ic-Login-confirmation", id: "modal-box") do %>
|
||||
<header class="ic-Login-confirmation__header">
|
||||
<%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:"Canvas by Instructure") %>
|
||||
</header>
|
||||
<div class="ic-Login-confirmation__content">
|
||||
<% end %>
|
||||
<h2<% if use_new_styles? %> class="ic-Login-confirmation__headline"<% end %>><%= t 'updated_terms_of_use', 'Updated Terms of Use' %></h2>
|
||||
<p>
|
||||
<%= t "Either you're a new user or the *terms of use* have changed since you last agreed to them. Please agree to the *terms of use* and **privacy policy** before you continue.",
|
||||
wrapper: {
|
||||
'*' => link_to('\1', terms_of_use_url, target: '_blank'),
|
||||
'**' => link_to('\1', privacy_policy_url, target: '_blank')
|
||||
}
|
||||
%>
|
||||
</p>
|
||||
<p>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="user[terms_of_use]" value="1">
|
||||
<%= agree_to_terms %>
|
||||
</label>
|
||||
<input type="hidden" name="redirect_to_previous" value="true" />
|
||||
</p>
|
||||
<div class="button_box<% if use_new_styles? %> ic-Login-confirmation__actions<% end %>">
|
||||
<button type="submit" class="btn btn-primary"><%= t "#buttons.submit", "Submit" %></button>
|
||||
<%= link_to(t("#buttons.cancel", "Cancel"), logout_path, :method => :delete, :class => "btn logout") %>
|
||||
<h2 class="ic-Login-confirmation__headline"><%= t 'updated_terms_of_use', 'Updated Terms of Use' %></h2>
|
||||
<p>
|
||||
<%= t "Either you're a new user or the *terms of use* have changed since you last agreed to them. Please agree to the *terms of use* and **privacy policy** before you continue.",
|
||||
wrapper: {
|
||||
'*' => link_to('\1', terms_of_use_url, target: '_blank'),
|
||||
'**' => link_to('\1', privacy_policy_url, target: '_blank')
|
||||
}
|
||||
%>
|
||||
</p>
|
||||
<p>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="user[terms_of_use]" value="1">
|
||||
<%= agree_to_terms %>
|
||||
</label>
|
||||
<input type="hidden" name="redirect_to_previous" value="true" />
|
||||
</p>
|
||||
<div class="button_box ic-Login-confirmation__actions">
|
||||
<button type="submit" class="btn btn-primary"><%= t "#buttons.submit", "Submit" %></button>
|
||||
<%= link_to(t("#buttons.cancel", "Cancel"), logout_path, :method => :delete, :class => "btn logout") %>
|
||||
</div>
|
||||
</div>
|
||||
<% if use_new_styles? %></div><% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%# Customer-brandable dashboard right-sidebar logo %>
|
||||
<% if use_new_styles? && brand_variable("ic-brand-right-sidebar-logo") != "" %>
|
||||
<% if brand_variable("ic-brand-right-sidebar-logo") != "" %>
|
||||
<div class="ic-sidebar-logo">
|
||||
<%= image_tag(brand_variable("ic-brand-right-sidebar-logo"), :class => "ic-sidebar-logo__image", :alt => "Canvas by Instructure") %>
|
||||
</div>
|
||||
|
@ -26,9 +26,7 @@
|
|||
<%= render :partial => 'shared/new_course_form' %>
|
||||
<% end %>
|
||||
|
||||
<% if use_new_styles? %>
|
||||
<a href="<%= grades_path %>" class="Button button-sidebar-wide">
|
||||
<%= t('View Grades') %>
|
||||
</a>
|
||||
<% end %>
|
||||
<a href="<%= grades_path %>" class="Button button-sidebar-wide">
|
||||
<%= t('View Grades') %>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -12,33 +12,22 @@
|
|||
<div class="placeholder"></div>
|
||||
<% end %>
|
||||
|
||||
<% unless use_new_styles? -%>
|
||||
<% content_for :leading_content do %>
|
||||
<h1 class='screenreader-only'> <%= t('user_dashboard', 'User Dashboard') %> </h1>
|
||||
<% end %>
|
||||
<% end -%>
|
||||
|
||||
<div id="dashboard">
|
||||
<%= render :partial => 'shared/dashboard_invitation', :collection => @pending_invitations %>
|
||||
<%= render :partial => 'shared/dashboard_messages' %>
|
||||
|
||||
<% if use_new_styles? %>
|
||||
<div class="ic-Dashboard-header">
|
||||
<div class="grid-row bottom-xs">
|
||||
<div class="col-xs-9">
|
||||
<h1 class="ic-Dashboard-header_title"><%= t :dashboard, "Dashboard" %></h1>
|
||||
</div>
|
||||
<div id="RecentActivityToggle_Container"
|
||||
class="col-xs-3 ic-Dashboard-content--align-right">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ic-Dashboard-header">
|
||||
<div class="grid-row bottom-xs">
|
||||
<div class="col-xs-9">
|
||||
<h1 class="ic-Dashboard-header_title"><%= t :dashboard, "Dashboard" %></h1>
|
||||
</div>
|
||||
<div id="dashboard-activity" class="ic-Dashboard-Activity" style="display: <%= show_recent_activity? ? 'block' : 'none' %>">
|
||||
<%= render :partial => 'shared/recent_activity' %>
|
||||
<div id="RecentActivityToggle_Container"
|
||||
class="col-xs-3 ic-Dashboard-content--align-right">
|
||||
</div>
|
||||
<%= render :partial => 'shared/dashboard_card' %>
|
||||
|
||||
<% else %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dashboard-activity" class="ic-Dashboard-Activity" style="display: <%= show_recent_activity? ? 'block' : 'none' %>">
|
||||
<%= render :partial => 'shared/recent_activity' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render :partial => 'shared/dashboard_card' %>
|
||||
</div>
|
||||
|
|
|
@ -150,7 +150,7 @@ define([
|
|||
});
|
||||
});
|
||||
|
||||
$("#turnitin, #account_settings_global_includes, #enable_equella").change(function() {
|
||||
$("#turnitin, #enable_equella").change(function() {
|
||||
var $myFieldset = $('#'+ $(this).attr('id') + '_settings'),
|
||||
iAmChecked = $(this).attr('checked');
|
||||
$myFieldset.showIf(iAmChecked);
|
||||
|
|
|
@ -61,9 +61,6 @@ switch($toolForm.data('tool-launch-type')){
|
|||
} catch(e){}
|
||||
|
||||
$("#tool_content").bind("load", function(){
|
||||
if (!ENV.use_new_styles) {
|
||||
$("#content").addClass('padless');
|
||||
}
|
||||
if(document.location.protocol !== "https:" || $("#tool_form")[0].action.indexOf("https:") > -1) {
|
||||
$('#insecure_content_msg').hide();
|
||||
$toolForm.hide();
|
||||
|
@ -97,31 +94,14 @@ var resize_tool_content_wrapper = function(height) {
|
|||
tool_content_wrapper().height(tool_height > height ? tool_height : height);
|
||||
}
|
||||
|
||||
//moduleSequenceFooter visibility handler
|
||||
function module_sequence_footer(){
|
||||
if (ENV.use_new_styles) {
|
||||
return $('.module-sequence-footer');
|
||||
}
|
||||
else {
|
||||
return $('#sequence_footer');
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var $window = $(window);
|
||||
$tool_content_wrapper = $('.tool_content_wrapper');
|
||||
|
||||
// for new UI, full-screen LTI iframe will always be 100%,
|
||||
// so no need to calculate it
|
||||
if (ENV.use_new_styles) {
|
||||
if ( !$('body').hasClass('ic-full-screen-lti-tool') ) {
|
||||
canvas_chrome_height = $tool_content_wrapper.offset().top + $('#footer').outerHeight(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
min_tool_height = $('#main').height();
|
||||
canvas_chrome_height = $tool_content_wrapper.offset().top + $('#wrapper').height() - $('#main').height();
|
||||
if ( !$('body').hasClass('ic-full-screen-lti-tool') ) {
|
||||
canvas_chrome_height = $tool_content_wrapper.offset().top + $('#footer').outerHeight(true);
|
||||
}
|
||||
|
||||
// Only calculate height on resize if body does not have
|
||||
// .ic-full-screen-lti-tool class
|
||||
if ( $tool_content_wrapper.length && !$('body').hasClass('ic-full-screen-lti-tool') ) {
|
||||
|
@ -156,7 +136,7 @@ window.addEventListener('message', function(e) {
|
|||
|
||||
case 'lti.showModuleNavigation':
|
||||
if(message.show === true || message.show === false){
|
||||
module_sequence_footer().toggle(message.show);
|
||||
$('.module-sequence-footer').toggle(message.show);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -2281,7 +2281,6 @@ describe DiscussionTopicsController, type: :request do
|
|||
end
|
||||
|
||||
account = @course.root_account
|
||||
account.enable_feature!(:use_new_styles)
|
||||
bc = BrandConfig.create(mobile_css_overrides: 'somewhere.css')
|
||||
account.brand_config_md5 = bc.md5
|
||||
account.save!
|
||||
|
|
|
@ -9,7 +9,6 @@ describe BrandConfigsApiController do
|
|||
end
|
||||
|
||||
it "should redirect to the one for @domain_root_account's brand config if set" do
|
||||
Account.default.enable_feature!(:use_new_styles)
|
||||
brand_config = Account.default.create_brand_config!(variables: {"ic-brand-primary" => "#321"})
|
||||
get :show
|
||||
expect(response).to redirect_to("#{Canvas::Cdn.config.host}/#{brand_config.public_json_path}")
|
||||
|
|
|
@ -205,538 +205,204 @@ describe ApplicationHelper do
|
|||
end
|
||||
|
||||
describe "custom css/js includes" do
|
||||
context "without use_new_styles" do
|
||||
before do
|
||||
helper.stubs(:use_new_styles?).returns(false)
|
||||
|
||||
def set_up_subaccounts
|
||||
@domain_root_account.settings[:global_includes] = true
|
||||
@domain_root_account.settings[:sub_account_includes] = true
|
||||
@domain_root_account.create_brand_config!({
|
||||
css_overrides: 'https://example.com/root/account.css',
|
||||
js_overrides: 'https://example.com/root/account.js'
|
||||
})
|
||||
@domain_root_account.save!
|
||||
|
||||
@child_account = account_model(root_account: @domain_root_account, name: 'child account')
|
||||
bc = @child_account.build_brand_config({
|
||||
css_overrides: 'https://example.com/child/account.css',
|
||||
js_overrides: 'https://example.com/child/account.js'
|
||||
})
|
||||
bc.parent = @domain_root_account.brand_config
|
||||
bc.save!
|
||||
@child_account.save!
|
||||
|
||||
@grandchild_account = @child_account.sub_accounts.create!(name: 'grandchild account')
|
||||
bc = @grandchild_account.build_brand_config({
|
||||
css_overrides: 'https://example.com/grandchild/account.css',
|
||||
js_overrides: 'https://example.com/grandchild/account.js'
|
||||
})
|
||||
bc.parent = @child_account.brand_config
|
||||
bc.save!
|
||||
@grandchild_account.save!
|
||||
end
|
||||
|
||||
describe "include_account_css" do
|
||||
|
||||
before :once do
|
||||
@site_admin = Account.site_admin
|
||||
@domain_root_account = Account.default
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.save!
|
||||
end
|
||||
|
||||
describe "include_account_css" do
|
||||
|
||||
before :once do
|
||||
@site_admin = Account.site_admin
|
||||
@domain_root_account = Account.default
|
||||
end
|
||||
|
||||
context "with no custom css" do
|
||||
it "should be empty" do
|
||||
expect(helper.include_account_css).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "with custom css" do
|
||||
it "should include account css" do
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_stylesheet: '/path/to/css')
|
||||
@domain_root_account.save!
|
||||
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output).to match %r{/path/to/css}
|
||||
end
|
||||
|
||||
it "should include site admin css" do
|
||||
@site_admin.settings = @site_admin.settings.merge(global_includes: true)
|
||||
@site_admin.settings = @site_admin.settings.merge(global_stylesheet: '/path/to/css')
|
||||
@site_admin.save!
|
||||
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output).to match %r{/path/to/css}
|
||||
end
|
||||
|
||||
it "should include site admin css once" do
|
||||
@site_admin.settings = @site_admin.settings.merge(global_includes: true)
|
||||
@site_admin.settings = @site_admin.settings.merge(global_stylesheet: '/path/to/css')
|
||||
@site_admin.save!
|
||||
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/css}).length).to eql 1
|
||||
end
|
||||
|
||||
it "should include site admin css first" do
|
||||
@site_admin.settings = @site_admin.settings.merge(global_includes: true)
|
||||
@site_admin.settings = @site_admin.settings.merge(global_stylesheet: '/path/to/admin/css')
|
||||
@site_admin.save!
|
||||
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_stylesheet: '/path/to/root/css')
|
||||
@domain_root_account.save!
|
||||
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(root/|admin/)?css})).to eql [['admin/'], ['root/']]
|
||||
end
|
||||
|
||||
it "should not include anything if param is set to 0" do
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_stylesheet: '/path/to/css')
|
||||
@domain_root_account.save!
|
||||
|
||||
params[:global_includes] = '0'
|
||||
output = helper.include_account_css
|
||||
expect(output).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "sub-accounts" do
|
||||
before :once do
|
||||
@site_admin.settings = @site_admin.settings.merge(global_includes: true)
|
||||
@site_admin.settings = @site_admin.settings.merge(global_stylesheet: '/path/to/admin/css')
|
||||
@site_admin.save!
|
||||
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(sub_account_includes: true)
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_stylesheet: '/path/to/root/css')
|
||||
@domain_root_account.save!
|
||||
|
||||
@sub_account1 = account_model(root_account: @domain_root_account)
|
||||
@sub_account1.settings = @sub_account1.settings.merge(global_stylesheet: '/path/to/sub1/css')
|
||||
@sub_account1.settings = @sub_account1.settings.merge(sub_account_includes: true)
|
||||
@sub_account1.save!
|
||||
|
||||
@sub_account2 = account_model(root_account: @domain_root_account)
|
||||
@sub_account2.settings = @sub_account2.settings.merge(global_stylesheet: '/path/to/sub2/css')
|
||||
@sub_account2.save!
|
||||
end
|
||||
|
||||
it "should include sub-account css" do
|
||||
@context = @sub_account1
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/'], ['sub1/']]
|
||||
end
|
||||
|
||||
it "should not include sub-account css when root account is context" do
|
||||
@context = @domain_root_account
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/']]
|
||||
end
|
||||
|
||||
it "should include sub-account css for course context" do
|
||||
@context = @sub_account1.courses.create!
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/'], ['sub1/']]
|
||||
end
|
||||
|
||||
it "should include sub-account css for group context" do
|
||||
@course = @sub_account1.courses.create!
|
||||
@context = @course.groups.create!
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/'], ['sub1/']]
|
||||
end
|
||||
|
||||
it "should use include sub-account css, if sub-account is lowest common account context" do
|
||||
@course = @sub_account1.courses.create!
|
||||
@course.offer!
|
||||
student_in_course(active_all: true)
|
||||
@context = @user
|
||||
@current_user = @user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/'], ['sub1/']]
|
||||
end
|
||||
|
||||
it "should not use include sub-account css, if sub-account is not lowest common account context" do
|
||||
@course1 = @sub_account1.courses.create!
|
||||
@course1.offer!
|
||||
@course2 = @sub_account2.courses.create!
|
||||
@course2.offer!
|
||||
student_in_course(active_all: true, course: @course1)
|
||||
student_in_course(active_all: true, course: @course2, user: @user)
|
||||
@context = @user
|
||||
@current_user = @user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/']]
|
||||
end
|
||||
|
||||
it "should include multiple levesl of sub-account css in the right order for course page" do
|
||||
@sub_sub_account1 = account_model(parent_account: @sub_account1, root_account: @domain_root_account)
|
||||
@sub_sub_account1.settings = @sub_sub_account1.settings.merge(global_stylesheet: '/path/to/subsub1/css')
|
||||
@sub_sub_account1.save!
|
||||
|
||||
@context = @sub_sub_account1.courses.create!
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(subsub1/|sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/'], ['sub1/'], ['subsub1/']]
|
||||
end
|
||||
|
||||
it "should include multiple levesl of sub-account css in the right order" do
|
||||
@sub_sub_account1 = account_model(parent_account: @sub_account1, root_account: @domain_root_account)
|
||||
@sub_sub_account1.settings = @sub_sub_account1.settings.merge(global_stylesheet: '/path/to/subsub1/css')
|
||||
@sub_sub_account1.save!
|
||||
|
||||
@course = @sub_sub_account1.courses.create!
|
||||
@course.offer!
|
||||
student_in_course(active_all: true)
|
||||
@context = @user
|
||||
@current_user = @user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{/path/to/(subsub1/|sub1/|sub2/|root/|admin/)?css})).to eql [['admin/'], ['root/'], ['sub1/'], ['subsub1/']]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "include_account_js" do
|
||||
before :once do
|
||||
@site_admin = Account.site_admin
|
||||
@domain_root_account = Account.default
|
||||
end
|
||||
|
||||
context "with no custom js" do
|
||||
it "should be empty" do
|
||||
expect(helper.include_account_js).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "with custom js" do
|
||||
it "should include account javascript" do
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(
|
||||
global_includes: true,
|
||||
global_javascript: '/path/to/js'
|
||||
)
|
||||
@domain_root_account.save!
|
||||
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expect(output).to match %r{\\?/path\\?/to\\?/js}
|
||||
end
|
||||
|
||||
it "should include site admin javascript" do
|
||||
@site_admin.settings = @site_admin.settings.merge(
|
||||
global_includes: true,
|
||||
global_javascript: '/path/to/js'
|
||||
)
|
||||
@site_admin.save!
|
||||
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expect(output).to match %r{\\?/path\\?/to\\?/js}
|
||||
end
|
||||
|
||||
it "should include both site admin and root account javascript, site admin first" do
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(
|
||||
global_includes: true,
|
||||
global_javascript: '/path/to/root/js'
|
||||
)
|
||||
@domain_root_account.save!
|
||||
|
||||
@site_admin.settings = @site_admin.settings.merge(
|
||||
global_includes: true,
|
||||
global_javascript: '/path/to/admin/js'
|
||||
)
|
||||
@site_admin.save!
|
||||
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expect(output.scan(%r{\\?/path\\?/to\\?/(admin|root)?\\?/?js})).to eql [['admin'], ['root']]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "global_includes" do
|
||||
it "should only compute includes once, with includes" do
|
||||
@site_admin = Account.site_admin
|
||||
@site_admin.expects(:global_includes_hash).once.returns({css: "/path/to/css", js: "/path/to/js"})
|
||||
expect(helper.include_account_css).to match %r{/path/to/css}
|
||||
expect(helper.include_account_js).to match %r{\\?/path\\?/to\\?/js}
|
||||
end
|
||||
|
||||
it "should only compute includes once, with includes" do
|
||||
@site_admin = Account.site_admin
|
||||
@site_admin.expects(:global_includes_hash).once.returns(nil)
|
||||
context "with no custom css" do
|
||||
it "should be empty" do
|
||||
helper.stubs(:active_brand_config).returns(nil)
|
||||
expect(helper.include_account_css).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "with custom css" do
|
||||
it "should include account css" do
|
||||
helper.stubs(:active_brand_config).returns BrandConfig.create!(css_overrides: 'https://example.com/path/to/overrides.css')
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output).to match %r{https://example.com/path/to/overrides.css}
|
||||
end
|
||||
|
||||
it "should include site_admin css even if there is no active brand" do
|
||||
helper.stubs(:active_brand_config).returns nil
|
||||
Account.site_admin.create_brand_config!({
|
||||
css_overrides: 'https://example.com/site_admin/account.css',
|
||||
js_overrides: 'https://example.com/site_admin/account.js'
|
||||
})
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output).to match %r{https://example.com/site_admin/account.css}
|
||||
end
|
||||
|
||||
|
||||
it "should not include anything if param is set to 0" do
|
||||
helper.stubs(:active_brand_config).returns BrandConfig.create!(css_overrides: 'https://example.com/path/to/overrides.css')
|
||||
params[:global_includes] = '0'
|
||||
|
||||
output = helper.include_account_css
|
||||
expect(output).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "sub-accounts" do
|
||||
before { set_up_subaccounts }
|
||||
|
||||
it "should include sub-account css when viewing the subaccount or any course or group in it" do
|
||||
course = @grandchild_account.courses.create!
|
||||
group = course.groups.create!
|
||||
[@grandchild_account, course, group].each do |context|
|
||||
@context = context
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root'], ['child'], ['grandchild']]
|
||||
end
|
||||
end
|
||||
|
||||
it "should not include sub-account css when root account is context" do
|
||||
@context = @domain_root_account
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root']]
|
||||
end
|
||||
|
||||
it "should use include sub-account css, if sub-account is lowest common account context" do
|
||||
@course = @grandchild_account.courses.create!
|
||||
@course.offer!
|
||||
student_in_course(active_all: true)
|
||||
@context = @user
|
||||
@current_user = @user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root'], ['child'], ['grandchild']]
|
||||
end
|
||||
|
||||
it "should work using common_account_chain starting from lowest common account context with enrollments" do
|
||||
course1 = @child_account.courses.create!
|
||||
course1.offer!
|
||||
course2 = @grandchild_account.courses.create!
|
||||
course2.offer!
|
||||
student_in_course(active_all: true, course: course1, user: @user)
|
||||
student_in_course(active_all: true, course: course2, user: @user)
|
||||
@context = @user
|
||||
@current_user = @user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root'], ['child']]
|
||||
end
|
||||
|
||||
it "should fall-back to @domain_root_account's branding if I'm logged in but not enrolled in anything" do
|
||||
@current_user = user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root']]
|
||||
end
|
||||
|
||||
it "should load custom css even for high contrast users" do
|
||||
@current_user = user
|
||||
user.enable_feature!(:high_contrast)
|
||||
@context = @grandchild_account
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [["root"], ["child"], ["grandchild"]]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
describe "include_account_js" do
|
||||
before :once do
|
||||
@site_admin = Account.site_admin
|
||||
@domain_root_account = Account.default
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.save!
|
||||
end
|
||||
|
||||
context "with no custom js" do
|
||||
it "should be empty" do
|
||||
helper.stubs(:active_brand_config).returns(nil)
|
||||
expect(helper.include_account_js).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe "get_global_includes" do
|
||||
before :once do
|
||||
@domain_root_account = Account.default
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(
|
||||
global_includes: true,
|
||||
global_javascript: '/path/to/js'
|
||||
)
|
||||
@domain_root_account.save!
|
||||
context "with custom js" do
|
||||
it "should include account javascript" do
|
||||
helper.stubs(:active_brand_config).returns BrandConfig.create!(js_overrides: 'https://example.com/path/to/overrides.js')
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script', text: %r{https:\\/\\/example.com\\/path\\/to\\/overrides.js}
|
||||
end
|
||||
|
||||
it "should return default account includes" do
|
||||
includes = helper.get_global_includes
|
||||
expect(includes).to eq [{js: '/path/to/js'}]
|
||||
end
|
||||
it "should include site_admin javascript even if there is no active brand" do
|
||||
helper.stubs(:active_brand_config).returns nil
|
||||
Account.site_admin.create_brand_config!({
|
||||
css_overrides: 'https://example.com/site_admin/account.css',
|
||||
js_overrides: 'https://example.com/site_admin/account.js'
|
||||
})
|
||||
|
||||
it "should return sub-account includes if enabled" do
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(
|
||||
sub_account_includes: true
|
||||
)
|
||||
@domain_root_account.save!
|
||||
@sub_account = account_model(root_account: @domain_root_account)
|
||||
@sub_account.settings = @sub_account.settings.merge(
|
||||
global_javascript: '/path/to/sub/js'
|
||||
)
|
||||
@sub_account.save!
|
||||
@context = @sub_account
|
||||
|
||||
includes = helper.get_global_includes
|
||||
expect(includes).to eq [{js: '/path/to/js'}, {js: '/path/to/sub/js'}]
|
||||
end
|
||||
|
||||
it "should not include sub-account includes if disabled" do
|
||||
@sub_account = account_model(root_account: @domain_root_account)
|
||||
@sub_account.settings = @sub_account.settings.merge(
|
||||
global_javascript: '/path/to/sub/js'
|
||||
)
|
||||
@sub_account.save!
|
||||
@context = @sub_account
|
||||
|
||||
includes = helper.get_global_includes
|
||||
expect(includes).to eq [{js: '/path/to/js'}]
|
||||
end
|
||||
|
||||
it "should not include stale values when updated" do
|
||||
enable_cache do
|
||||
now = Time.now.utc
|
||||
Timecop.freeze(now) do
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(
|
||||
sub_account_includes: true
|
||||
)
|
||||
@domain_root_account.save!
|
||||
@context = @domain_root_account
|
||||
|
||||
includes = helper.get_global_includes
|
||||
expect(includes).to eq [{js: '/path/to/js'}]
|
||||
end
|
||||
|
||||
# a little time passes, so updated_at changes
|
||||
Timecop.freeze(now + 5.seconds) do
|
||||
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(
|
||||
global_javascript: '/path/to/new/js'
|
||||
)
|
||||
@domain_root_account.save!
|
||||
|
||||
# simulate the next request
|
||||
helper.remove_instance_variable(:@global_includes)
|
||||
|
||||
includes = helper.get_global_includes
|
||||
|
||||
# we still get the old javascript because it's cached, the real
|
||||
# test here is that we don't get BOTH.
|
||||
expect(includes).to eq [{js: '/path/to/js'}]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with use_new_styles turned on" do
|
||||
before do
|
||||
helper.stubs(:use_new_styles?).returns(true)
|
||||
end
|
||||
|
||||
def set_up_subaccounts
|
||||
@domain_root_account.settings[:global_includes] = true
|
||||
@domain_root_account.settings[:sub_account_includes] = true
|
||||
@domain_root_account.create_brand_config!({
|
||||
css_overrides: 'https://example.com/root/account.css',
|
||||
js_overrides: 'https://example.com/root/account.js'
|
||||
})
|
||||
@domain_root_account.save!
|
||||
|
||||
@child_account = account_model(root_account: @domain_root_account, name: 'child account')
|
||||
bc = @child_account.build_brand_config({
|
||||
css_overrides: 'https://example.com/child/account.css',
|
||||
js_overrides: 'https://example.com/child/account.js'
|
||||
})
|
||||
bc.parent = @domain_root_account.brand_config
|
||||
bc.save!
|
||||
@child_account.save!
|
||||
|
||||
@grandchild_account = @child_account.sub_accounts.create!(name: 'grandchild account')
|
||||
bc = @grandchild_account.build_brand_config({
|
||||
css_overrides: 'https://example.com/grandchild/account.css',
|
||||
js_overrides: 'https://example.com/grandchild/account.js'
|
||||
})
|
||||
bc.parent = @child_account.brand_config
|
||||
bc.save!
|
||||
@grandchild_account.save!
|
||||
end
|
||||
|
||||
describe "include_account_css" do
|
||||
|
||||
before :once do
|
||||
@site_admin = Account.site_admin
|
||||
@domain_root_account = Account.default
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.save!
|
||||
end
|
||||
|
||||
context "with no custom css" do
|
||||
it "should be empty" do
|
||||
helper.stubs(:active_brand_config).returns(nil)
|
||||
expect(helper.include_account_css).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "with custom css" do
|
||||
it "should include account css" do
|
||||
helper.stubs(:active_brand_config).returns BrandConfig.create!(css_overrides: 'https://example.com/path/to/overrides.css')
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output).to match %r{https://example.com/path/to/overrides.css}
|
||||
end
|
||||
|
||||
it "should include site_admin css even if there is no active brand" do
|
||||
helper.stubs(:active_brand_config).returns nil
|
||||
Account.site_admin.create_brand_config!({
|
||||
css_overrides: 'https://example.com/site_admin/account.css',
|
||||
js_overrides: 'https://example.com/site_admin/account.js'
|
||||
})
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output).to match %r{https://example.com/site_admin/account.css}
|
||||
end
|
||||
|
||||
|
||||
it "should not include anything if param is set to 0" do
|
||||
helper.stubs(:active_brand_config).returns BrandConfig.create!(css_overrides: 'https://example.com/path/to/overrides.css')
|
||||
params[:global_includes] = '0'
|
||||
|
||||
output = helper.include_account_css
|
||||
expect(output).to be_nil
|
||||
end
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script', text: %r{https:\\/\\/example.com\\/site_admin\\/account.js}
|
||||
end
|
||||
|
||||
context "sub-accounts" do
|
||||
before { set_up_subaccounts }
|
||||
|
||||
it "should include sub-account css when viewing the subaccount or any course or group in it" do
|
||||
it "should just include domain root account's when there is no context or @current_user" do
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expect(output).to match(/#{Regexp.quote('["https:\/\/example.com\/root\/account.js"].forEach')}/)
|
||||
end
|
||||
|
||||
it "should load custom js even for high contrast users" do
|
||||
@current_user = user
|
||||
user.enable_feature!(:high_contrast)
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expect(output).to match(/#{Regexp.quote('["https:\/\/example.com\/root\/account.js"].forEach')}/)
|
||||
end
|
||||
|
||||
it "should include granchild, child, and root when viewing the grandchild or any course or group in it" do
|
||||
course = @grandchild_account.courses.create!
|
||||
group = course.groups.create!
|
||||
[@grandchild_account, course, group].each do |context|
|
||||
@context = context
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root'], ['child'], ['grandchild']]
|
||||
end
|
||||
end
|
||||
|
||||
it "should not include sub-account css when root account is context" do
|
||||
@context = @domain_root_account
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root']]
|
||||
end
|
||||
|
||||
it "should use include sub-account css, if sub-account is lowest common account context" do
|
||||
@course = @grandchild_account.courses.create!
|
||||
@course.offer!
|
||||
student_in_course(active_all: true)
|
||||
@context = @user
|
||||
@current_user = @user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root'], ['child'], ['grandchild']]
|
||||
end
|
||||
|
||||
it "should work using common_account_chain starting from lowest common account context with enrollments" do
|
||||
course1 = @child_account.courses.create!
|
||||
course1.offer!
|
||||
course2 = @grandchild_account.courses.create!
|
||||
course2.offer!
|
||||
student_in_course(active_all: true, course: course1, user: @user)
|
||||
student_in_course(active_all: true, course: course2, user: @user)
|
||||
@context = @user
|
||||
@current_user = @user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root'], ['child']]
|
||||
end
|
||||
|
||||
it "should fall-back to @domain_root_account's branding if I'm logged in but not enrolled in anything" do
|
||||
@current_user = user
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [['root']]
|
||||
end
|
||||
|
||||
it "should load custom css even for high contrast users" do
|
||||
@current_user = user
|
||||
user.enable_feature!(:high_contrast)
|
||||
@context = @grandchild_account
|
||||
output = helper.include_account_css
|
||||
expect(output).to have_tag 'link'
|
||||
expect(output.scan(%r{https://example.com/(root|child|grandchild)?/account.css})).to eql [["root"], ["child"], ["grandchild"]]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
describe "include_account_js" do
|
||||
before :once do
|
||||
@site_admin = Account.site_admin
|
||||
@domain_root_account = Account.default
|
||||
@domain_root_account.settings = @domain_root_account.settings.merge(global_includes: true)
|
||||
@domain_root_account.save!
|
||||
end
|
||||
|
||||
context "with no custom js" do
|
||||
it "should be empty" do
|
||||
helper.stubs(:active_brand_config).returns(nil)
|
||||
expect(helper.include_account_js).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "with custom js" do
|
||||
it "should include account javascript" do
|
||||
helper.stubs(:active_brand_config).returns BrandConfig.create!(js_overrides: 'https://example.com/path/to/overrides.js')
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script', text: %r{https:\\/\\/example.com\\/path\\/to\\/overrides.js}
|
||||
end
|
||||
|
||||
it "should include site_admin javascript even if there is no active brand" do
|
||||
helper.stubs(:active_brand_config).returns nil
|
||||
Account.site_admin.create_brand_config!({
|
||||
css_overrides: 'https://example.com/site_admin/account.css',
|
||||
js_overrides: 'https://example.com/site_admin/account.js'
|
||||
})
|
||||
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script', text: %r{https:\\/\\/example.com\\/site_admin\\/account.js}
|
||||
end
|
||||
|
||||
context "sub-accounts" do
|
||||
before { set_up_subaccounts }
|
||||
|
||||
it "should just include domain root account's when there is no context or @current_user" do
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expect(output).to match(/#{Regexp.quote('["https:\/\/example.com\/root\/account.js"].forEach')}/)
|
||||
end
|
||||
|
||||
it "should load custom js even for high contrast users" do
|
||||
@current_user = user
|
||||
user.enable_feature!(:high_contrast)
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expect(output).to match(/#{Regexp.quote('["https:\/\/example.com\/root\/account.js"].forEach')}/)
|
||||
end
|
||||
|
||||
it "should include granchild, child, and root when viewing the grandchild or any course or group in it" do
|
||||
course = @grandchild_account.courses.create!
|
||||
group = course.groups.create!
|
||||
[@grandchild_account, course, group].each do |context|
|
||||
@context = context
|
||||
output = helper.include_account_js
|
||||
expect(output).to have_tag 'script'
|
||||
expected = '["https:\/\/example.com\/root\/account.js","https:\/\/example.com\/child\/account.js","https:\/\/example.com\/grandchild\/account.js"].forEach'
|
||||
expect(output).to match(/#{Regexp.quote(expected)}/)
|
||||
end
|
||||
expect(output).to have_tag 'script'
|
||||
expected = '["https:\/\/example.com\/root\/account.js","https:\/\/example.com\/child\/account.js","https:\/\/example.com\/grandchild\/account.js"].forEach'
|
||||
expect(output).to match(/#{Regexp.quote(expected)}/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -994,27 +660,20 @@ describe ApplicationHelper do
|
|||
end
|
||||
|
||||
describe "active_brand_config" do
|
||||
it "returns nil if new styles are turned off" do
|
||||
helper.stubs(:use_new_styles?).returns(false)
|
||||
expect(helper.send(:active_brand_config)).to be_nil
|
||||
end
|
||||
|
||||
it "returns nil if user prefers high contrast" do
|
||||
helper.stubs(:use_new_styles?).returns(true)
|
||||
@current_user = user
|
||||
@current_user.enable_feature!(:high_contrast)
|
||||
expect(helper.send(:active_brand_config)).to be_nil
|
||||
end
|
||||
|
||||
it "returns 'K12 Theme' by default for a k12 school" do
|
||||
helper.stubs(:use_new_styles?).returns(true)
|
||||
helper.stubs(:k12?).returns(true)
|
||||
BrandConfig.stubs(:k12_config)
|
||||
expect(helper.send(:active_brand_config)).to eq BrandConfig.k12_config
|
||||
end
|
||||
|
||||
it "returns 'K12 Theme' if a k12 school has chosen 'canvas default' in Theme Editor" do
|
||||
helper.stubs(:use_new_styles?).returns(true)
|
||||
helper.stubs(:k12?).returns(true)
|
||||
BrandConfig.stubs(:k12_config)
|
||||
|
||||
|
|
|
@ -106,7 +106,6 @@ module Api
|
|||
})
|
||||
|
||||
child_account = Account.default.sub_accounts.create!(name: 'child account')
|
||||
child_account.root_account.enable_feature! :use_new_styles
|
||||
child_account.root_account.settings[:sub_account_includes] = true
|
||||
|
||||
bc = child_account.build_brand_config({
|
||||
|
@ -135,7 +134,6 @@ module Api
|
|||
|
||||
child_account = Account.default.sub_accounts.create!(name: 'child account')
|
||||
child_account.save!
|
||||
child_account.root_account.enable_feature! :use_new_styles
|
||||
|
||||
html = Content.new(string, child_account, include_mobile: true).add_css_and_js_overrides
|
||||
expect(html.to_s).to eq '<link rel="stylesheet" href="https://example.com/site_admin/account.css">' \
|
||||
|
|
|
@ -663,7 +663,6 @@ describe Api do
|
|||
before(:each) do
|
||||
student_in_course
|
||||
account = @course.root_account
|
||||
account.enable_feature!(:use_new_styles)
|
||||
bc = BrandConfig.create(mobile_css_overrides: 'somewhere.css')
|
||||
account.brand_config_md5 = bc.md5
|
||||
account.save!
|
||||
|
|
|
@ -23,7 +23,6 @@ require 'delayed/testing'
|
|||
describe BrandConfigHelpers do
|
||||
def setup_account_family_with_configs
|
||||
@parent_account = Account.default
|
||||
@parent_account.enable_feature!(:use_new_styles)
|
||||
@parent_config = BrandConfig.for(
|
||||
variables: {"ic-brand-primary" => "red"},
|
||||
js_overrides: nil,
|
||||
|
@ -81,7 +80,6 @@ describe BrandConfigHelpers do
|
|||
end
|
||||
|
||||
it "should work with site_admin" do
|
||||
Account.site_admin.enable_feature!(:use_new_styles)
|
||||
site_admin_config = BrandConfig.for(variables: {"ic-brand-primary" => "orange"})
|
||||
site_admin_config.save!
|
||||
regenerator = BrandConfigRegenerator.new(Account.site_admin, user, site_admin_config)
|
||||
|
|
|
@ -5,7 +5,6 @@ describe BrandConfigRegenerator do
|
|||
let(:new_brand_config) { BrandConfig.for(variables: {"ic-brand-primary" => "green"}) }
|
||||
def setup_account_family_with_configs
|
||||
@parent_account = Account.default
|
||||
@parent_account.enable_feature!(:use_new_styles)
|
||||
@parent_account.brand_config = @parent_config = BrandConfig.for(variables: {"ic-brand-primary" => "red"})
|
||||
@parent_config.save!
|
||||
@parent_account.save!
|
||||
|
@ -112,7 +111,6 @@ describe BrandConfigRegenerator do
|
|||
|
||||
it "handles site_admin correctly" do
|
||||
setup_account_family_with_configs
|
||||
Account.site_admin.enable_feature!(:use_new_styles)
|
||||
site_admin_config = BrandConfig.for(variables: {"ic-brand-primary" => "orange"})
|
||||
site_admin_config.save!
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ describe BrandableCSS do
|
|||
describe "when called with a brand config" do
|
||||
before :once do
|
||||
parent_account = Account.default
|
||||
parent_account.enable_feature!(:use_new_styles)
|
||||
parent_config = BrandConfig.create(variables: {"ic-brand-primary" => "#321"})
|
||||
|
||||
subaccount_bc = BrandConfig.for(
|
||||
|
|
|
@ -324,18 +324,6 @@ describe Account do
|
|||
context "settings=" do
|
||||
it "should filter disabled settings" do
|
||||
a = Account.new
|
||||
a.root_account_id = 1
|
||||
a.settings = {'global_javascript' => 'something'}.with_indifferent_access
|
||||
expect(a.settings[:global_javascript]).to eql(nil)
|
||||
|
||||
a.root_account_id = nil
|
||||
a.settings = {'global_javascript' => 'something'}.with_indifferent_access
|
||||
expect(a.settings[:global_javascript]).to eql(nil)
|
||||
|
||||
a.settings[:global_includes] = true
|
||||
a.settings = {'global_javascript' => 'something'}.with_indifferent_access
|
||||
expect(a.settings[:global_javascript]).to eql('something')
|
||||
|
||||
a.settings = {'error_reporting' => 'string'}.with_indifferent_access
|
||||
expect(a.settings[:error_reporting]).to eql(nil)
|
||||
|
||||
|
@ -917,20 +905,6 @@ describe Account do
|
|||
end
|
||||
end
|
||||
|
||||
context "settings" do
|
||||
describe ":condition" do
|
||||
it "should not allow setting things where condition is false" do
|
||||
account = Account.default
|
||||
account.stubs(:global_includes?).returns(false)
|
||||
account.settings = { :global_javascript => 'bob' }
|
||||
expect(account.settings[:global_javascript]).to be_nil
|
||||
account.stubs(:global_includes?).returns(true)
|
||||
account.settings = { :global_javascript => 'bob' }
|
||||
expect(account.settings[:global_javascript]).to eq 'bob'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "sharding" do
|
||||
specs_require_sharding
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ describe BrandConfig do
|
|||
|
||||
def setup_subaccount_with_config
|
||||
@parent_account = Account.default
|
||||
@parent_account.enable_feature!(:use_new_styles)
|
||||
@parent_config = BrandConfig.create(variables: {"ic-brand-primary" => "#321"})
|
||||
|
||||
@subaccount = Account.create!(:parent_account => @parent_account)
|
||||
|
|
|
@ -332,58 +332,7 @@ describe "admin settings tab" do
|
|||
checkbox.click if is_checked(selector) != checked
|
||||
end
|
||||
|
||||
it 'should add and delete custom help links' do
|
||||
skip('this tests old ui') if ENV['CANVAS_FORCE_USE_NEW_STYLES']
|
||||
|
||||
Account.default.disable_feature! :use_new_styles
|
||||
|
||||
Setting.set('show_feedback_link', 'true')
|
||||
get "/accounts/#{Account.default.id}/settings"
|
||||
|
||||
f('.add_custom_help_link').click
|
||||
f('.add_custom_help_link').click
|
||||
f('.add_custom_help_link').click
|
||||
|
||||
inputs = ff('.custom_help_link:nth-child(1) .formtable input')
|
||||
inputs.find{|e| e['id'].ends_with?('_text')}.send_keys('text')
|
||||
inputs.find{|e| e['id'].ends_with?('_subtext')}.send_keys('subtext')
|
||||
inputs.find{|e| e['id'].ends_with?('_url')}.send_keys('http://www.example.com/example')
|
||||
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_user')}, true)
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_student')}, true)
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_teacher')}, true)
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_admin')}, false)
|
||||
|
||||
f('.custom_help_link:nth-child(2) .delete').click
|
||||
expect(f('.custom_help_link:nth-child(2)')).not_to be_displayed
|
||||
|
||||
inputs = ff('.custom_help_link:nth-child(3) .formtable input')
|
||||
inputs.find{|e| e['id'].ends_with?('_text')}.send_keys('text2')
|
||||
inputs.find{|e| e['id'].ends_with?('_subtext')}.send_keys('subtext2')
|
||||
inputs.find{|e| e['id'].ends_with?('_url')}.send_keys('http://www.example.com/example2')
|
||||
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_user')}, false)
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_student')}, true)
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_teacher')}, false)
|
||||
set_checkbox(inputs.find{|e| e['id'].ends_with?('_available_to_admin')}, true)
|
||||
|
||||
click_submit
|
||||
expect(Account.default.settings[:custom_help_links]).to eq [
|
||||
{"text"=>"text", "subtext"=>"subtext", "url"=>"http://www.example.com/example", "available_to"=>["user", "student", "teacher"]},
|
||||
{"text"=>"text2", "subtext"=>"subtext2", "url"=>"http://www.example.com/example2", "available_to"=>["student", "admin"]}
|
||||
]
|
||||
|
||||
f('.custom_help_link:nth-child(1) .delete').click
|
||||
expect(f('.custom_help_link:nth-child(1)')).not_to be_displayed
|
||||
|
||||
click_submit
|
||||
expect(Account.default.settings[:custom_help_links]).to eq [
|
||||
{"text"=>"text2", "subtext"=>"subtext2", "url"=>"http://www.example.com/example2", "available_to"=>["student", "admin"]}
|
||||
]
|
||||
end
|
||||
|
||||
it "should set custom help link text and icon" do
|
||||
Account.default.enable_feature! :use_new_styles
|
||||
Setting.set('show_feedback_link', 'true')
|
||||
|
||||
link_name = 'Links'
|
||||
|
@ -423,7 +372,6 @@ describe "admin settings tab" do
|
|||
end
|
||||
|
||||
it "should preserve the default help links if the account hasn't been configured with the new ui yet" do
|
||||
Account.default.enable_feature!(:use_new_styles)
|
||||
help_link = {:text => "text", :subtext => "subtext", :url => "http://www.example.com/example", :available_to => ["user", "student", "teacher"]}
|
||||
Account.default.settings[:custom_help_links] = [help_link]
|
||||
Account.default.save!
|
||||
|
|
|
@ -24,7 +24,6 @@ describe "brandableCss JS integration specs" do
|
|||
end
|
||||
|
||||
it "loads css from handlebars with variables correctly" do
|
||||
Account.default.enable_feature!(:use_new_styles)
|
||||
course_with_teacher_logged_in
|
||||
get '/calendar'
|
||||
data = BrandableCSS.cache_for('jst/calendar/calendarApp', 'new_styles_normal_contrast')
|
||||
|
|
|
@ -14,7 +14,6 @@ describe 'dashcards' do
|
|||
before do
|
||||
@course = course(active_all: true)
|
||||
course_with_student_logged_in(active_all: true)
|
||||
Account.default.enable_feature! :use_new_styles
|
||||
end
|
||||
|
||||
it 'should show the toggle button for dashcard in new UI', priority: "1", test_id: 222506 do
|
||||
|
@ -280,7 +279,6 @@ describe 'dashcards' do
|
|||
before :each do
|
||||
@course = course(active_all: true)
|
||||
course_with_teacher_logged_in(active_all: true)
|
||||
Account.default.enable_feature! :use_new_styles
|
||||
@student = user_with_pseudonym(username: 'student@example.com', active_all: 1)
|
||||
enrollment = student_in_course(course: @course, user: @student)
|
||||
enrollment.accept!
|
||||
|
|
|
@ -3,10 +3,6 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
|
|||
describe "help dialog" do
|
||||
include_context "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
Account.default.enable_feature! :use_new_styles
|
||||
end
|
||||
|
||||
context "no user logged in" do
|
||||
it "should work with no logged in user" do
|
||||
Setting.set('show_feedback_link', 'true')
|
||||
|
|
|
@ -9,38 +9,6 @@ describe "layout" do
|
|||
get "/"
|
||||
end
|
||||
|
||||
it "should auto-scroll the sidebar when $.scrollSidebar is called" do
|
||||
skip if Account.default.feature_enabled?(:use_new_styles)
|
||||
exec_cs <<-CS
|
||||
$("#content").height(10000)
|
||||
$("#right-side").height(5000)
|
||||
$.scrollSidebar()
|
||||
CS
|
||||
|
||||
rs_wrapper = f('#right-side-wrapper')
|
||||
expect(rs_wrapper).not_to have_class 'with-scrolling-right-side'
|
||||
expect(rs_wrapper).not_to have_class 'with-sidebar-pinned-to-bottom'
|
||||
|
||||
f('#footer').location_once_scrolled_into_view
|
||||
# We sleep here because the window scroll triggers a call to scrollSidebar that might
|
||||
# be slightly throttled. We don't want to actually call scrollSidebar() ourselves
|
||||
# because that's subverting part of the test. The throttle shouldn't be more than 50ms,
|
||||
# so sleeping 100ms should be sufficient for it to fire.
|
||||
sleep 0.1
|
||||
expect(rs_wrapper).not_to have_class 'with-scrolling-right-side'
|
||||
expect(rs_wrapper).to have_class 'with-sidebar-pinned-to-bottom'
|
||||
|
||||
f('#dashboard').location_once_scrolled_into_view
|
||||
sleep 0.1
|
||||
expect(rs_wrapper).to have_class 'with-scrolling-right-side'
|
||||
expect(rs_wrapper).not_to have_class 'with-sidebar-pinned-to-bottom'
|
||||
|
||||
f('#header').location_once_scrolled_into_view
|
||||
sleep 0.1
|
||||
expect(rs_wrapper).not_to have_class 'with-scrolling-right-side'
|
||||
expect(rs_wrapper).not_to have_class 'with-sidebar-pinned-to-bottom'
|
||||
end
|
||||
|
||||
it "should have ENV available to the JavaScript from js_env" do
|
||||
expect(driver.execute_script("return ENV.current_user_id")).to eq @user.id.to_s
|
||||
end
|
||||
|
|
|
@ -6,7 +6,6 @@ describe 'Global Navigation' do
|
|||
context 'As a Teacher' do
|
||||
before do
|
||||
course_with_teacher_logged_in
|
||||
Account.default.enable_feature! :use_new_styles
|
||||
end
|
||||
|
||||
describe 'Profile Link' do
|
||||
|
|
|
@ -5,10 +5,6 @@ describe 'new ui' do
|
|||
include_context "in-process server selenium tests"
|
||||
include FilesCommon
|
||||
|
||||
before(:each) do
|
||||
Account.default.enable_feature!(:use_new_styles)
|
||||
end
|
||||
|
||||
context 'as teacher' do
|
||||
|
||||
before(:each) do
|
||||
|
|
|
@ -8,7 +8,6 @@ describe 'Theme Editor' do
|
|||
include ThemeEditorCommon
|
||||
|
||||
before(:each) do
|
||||
Account.default.enable_feature!(:use_new_styles)
|
||||
course_with_admin_logged_in
|
||||
end
|
||||
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2011 Instructure, Inc.
|
||||
#
|
||||
# This file is part of Canvas.
|
||||
#
|
||||
# Canvas is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Affero General Public License as published by the Free
|
||||
# Software Foundation, version 3 of the License.
|
||||
#
|
||||
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../views_helper')
|
||||
|
||||
describe "/shared/_identity" do
|
||||
it "should render" do
|
||||
Setting.set('show_feedback_link', 'true')
|
||||
course_with_student
|
||||
view_context
|
||||
render :partial => "shared/identity"
|
||||
expect(@controller.response).to be_success
|
||||
end
|
||||
|
||||
it "should render without a current user" do
|
||||
Setting.set('show_feedback_link', 'true')
|
||||
course_with_student
|
||||
view_context
|
||||
assigns.delete(:current_user)
|
||||
render :partial => "shared/identity"
|
||||
expect(@controller.response).to be_success
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue