Commit b97d0631 by Chris Rodriguez

AC-524 - label - test_lms_instructor_dashboard.py

parent 390b74e2
......@@ -17,7 +17,7 @@ def go_to_updates(_step):
@step(u'I add a new update with the text "([^"]*)"$')
def add_update(_step, text):
update_css = 'a.new-update-button'
update_css = '.new-update-button'
world.css_click(update_css)
world.wait_for_visible('.CodeMirror')
change_text(text)
......
......@@ -748,8 +748,8 @@ class MembershipPageAutoEnrollSection(PageObject):
"""
url = None
auto_enroll_browse_button_selector = '.auto_enroll_csv .file-browse input.file_field#browseBtn-auto_enroll_csv'
auto_enroll_upload_button_selector = '.auto_enroll_csv #submitBtn-auto_enroll_csv'
auto_enroll_browse_button_selector = '.auto_enroll_csv .file-browse input.file_field#browseBtn-auto-enroll'
auto_enroll_upload_button_selector = '.auto_enroll_csv button[name="enrollment_signup_button"]'
batch_enrollment_selector = '.batch-enrollment'
NOTIFICATION_ERROR = 'error'
NOTIFICATION_WARNING = 'warning'
......
......@@ -1051,8 +1051,7 @@ class CertificatesTest(BaseInstructorDashboardTest):
self.certificates_section.a11y_audit.config.set_rules({
"ignore": [
'checkboxgroup', # TODO: AC-491
'duplicate-id', # TODO: AC-523
'label', # TODO: AC-524
'duplicate-id', # TODO: AC-491
'radiogroup', # TODO: AC-491
]
})
......@@ -1269,7 +1268,6 @@ class CertificateInvalidationTest(BaseInstructorDashboardTest):
"ignore": [
'checkboxgroup', # TODO: AC-491
'duplicate-id', # TODO: AC-491
'label', # TODO: AC-491
'radiogroup', # TODO: AC-491
]
})
......
......@@ -7,14 +7,14 @@
<form id="student-auto-enroll-form">
<div class="customBrowseBtn">
<input disabled="disabled" id="browseFile" placeholder="choose file"/>
<div class="file-browse btn btn-primary">
<label for="browseBtn-auto_enroll_csv" class="browse">Browse</label>
<input class="file_field" id="browseBtn-auto_enroll_csv" name="students_list" type="file" accept=".csv"/>
<label for="browseBtn-auto-enroll">Upload a CSV for bulk enrollment</label>
<span id="browseFile" class="enhanced-input-file"></span>
<div class="file-browse btn btn-primary" aria-hidden="true">
<span class="browse">Browse</span>
<input class="file_field" id="browseBtn-auto-enroll" name="students_list" type="file" accept=".csv"/>
</div>
</div>
<button type="submit" id="submitBtn-auto_enroll_csv" name="enrollment_signup_button">Upload CSV</button>
<button type="submit" class="btn-blue" id="submitBtn-auto_enroll_csv" name="enrollment_signup_button">Upload CSV</button>
</form>
<div class="results"></div>
</div>
......@@ -186,7 +186,7 @@ class @AutoEnrollmentViaCsv
@$students_list_file = @$container.find("input[name='students_list']")
@$csrf_token = @$container.find("input[name='csrfmiddlewaretoken']")
@$results = @$container.find("div.results")
@$browse_button = @$container.find("#browseBtn-auto_enroll_csv")
@$browse_button = @$container.find("#browseBtn-auto-enroll")
@$browse_file = @$container.find("#browseFile")
@processing = false
......
......@@ -31,9 +31,9 @@
return Backbone.View.extend({
el: DOM_SELECTORS.bulk_exception,
events: {
'change #browseBtn': 'chooseFile',
'change #browseBtn-bulk-csv': 'chooseFile',
'click .upload-csv-button': 'uploadCSV',
'click a.arrow': 'toggleMessageDetails'
'click .arrow': 'toggleMessageDetails'
},
initialize: function(options){
......@@ -138,7 +138,7 @@
$('<div/>', {
class: 'message ' + group
}).appendTo('.bulk-exception-results').prepend(
"<a id= '" + group + "' href='javascript:void(0);' class='arrow'> + </a>" + heading
"<button type='button' id= '" + group + "' class='arrow'> + </button>" + heading
).append($('<ul/>', {
class: group
}));
......@@ -206,7 +206,7 @@
chooseFile: function(event) {
if (event && event.preventDefault) { event.preventDefault(); }
if (event.currentTarget.files.length === 1) {
this.$el.find(DOM_SELECTORS.upload_csv_button).attr('disabled', 'false');
this.$el.find(DOM_SELECTORS.upload_csv_button).removeAttr('disabled');
this.$el.find(DOM_SELECTORS.browse_file).val(
event.currentTarget.value.substring(event.currentTarget.value.lastIndexOf("\\") + 1));
}
......
......@@ -136,7 +136,7 @@ define([
this.view.$el.find(SELECTORS.bulk_white_list_exception_form).submit(submitCallback);
this.view.$el.find(SELECTORS.upload_csv_button).click();
expect(this.view.$el.find("div.message > .successfully-added")).toBeHidden();
this.view.$el.find("a.arrow#successfully-added").trigger( "click" );
this.view.$el.find(".arrow#successfully-added").trigger( "click" );
expect(this.view.$el.find("div.message > .successfully-added")).toBeVisible();
});
......
......@@ -134,6 +134,70 @@
}
}
}
.btn-blue {
@extend %btn-primary-blue;
margin-bottom: 0;
padding: ($baseline/2.5) ($baseline/2);
text-shadow: none;
}
// Custom File upload
.customBrowseBtn {
display: inline-block;
position: relative;
margin: ($baseline/2) 0 0;
width: 350px;
overflow: hidden;
vertical-align: bottom;
.enhanced-input-file {
@include border-radius(4px 0 0 4px);
@include padding(23px 6px 5px);
position: relative;
display: inline-block;
width: 250px;
vertical-align: middle;
border: 1px solid $lightGrey1;
background: $white;
cursor: not-allowed;
z-index: 2;
}
.file-browse {
@include margin-left(-4px);
display: inline-block;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
overflow: hidden;
.browse {
@include button(simple, $uxpl-blue-base);
@include margin-left(268px);
border-radius: 0 3px 3px 0;
padding: 6px ($baseline/2);
font-size: 12px;
}
.file_field {
@include left(-27%);
position: absolute;
z-index: 3;
height: 24px; // To match bull browse button
width: 124%;
margin: 0;
padding: 4px 0 0 0;
cursor: pointer;
// for visual sync, need to make button similar to firefox
&::-webkit-file-upload-button {
width: 100px;
}
}
}
}
}
// instructor dashboard 2
......@@ -2167,13 +2231,6 @@ input[name="subject"] {
// --------------------
.instructor-dashboard-wrapper-2 section.idash-section#certificates {
.btn-blue {
@extend %btn-primary-blue;
padding: ($baseline/2.5) ($baseline/2);
text-shadow: none;
margin-bottom: 10px;
}
%exception-message {
margin-top: 15px;
background-color: $gray-l4;
......@@ -2344,46 +2401,13 @@ input[name="subject"] {
}
.arrow {
@include margin-right($baseline/2);
border: none;
background: transparent;
box-shadow: none;
color: $uxpl-blue-base;
font-weight: bold;
}
}
}
}
// Custom File upload
.customBrowseBtn {
margin: ($baseline/2) 0;
display: inline-block;
.file-browse {
position: relative;
overflow: hidden;
display: inline;
@include margin-left(-5px);
span.browse {
@include button(simple, $uxpl-blue-base);
@include margin-right($baseline);
padding: 6px ($baseline/2);
font-size: 12px;
border-radius: 0 3px 3px 0;
}
input.file_field {
@extend %cont-text-sr;
position: absolute;
@include right(0);
top: 0;
margin: 0;
padding: 0;
cursor: pointer;
}
}
& > span, & input[disabled] {
vertical-align: middle;
}
input[disabled] {
@include border-radius(4px 0 0 4px);
@include padding(6px 6px 5px);
border: 1px solid $lightGrey1;
cursor: not-allowed;
}
}
......@@ -5,13 +5,14 @@
</p>
<form id="bulk-white-list-exception-form" enctype="multipart/form-data">
<div class="customBrowseBtn">
<input disabled="disabled" class="browse-file" placeholder="<%- gettext("Choose File") %>" />
<div class="file-browse btn btn-primary">
<label for="browseBtn-bulk-exc-students" class="browse"><%- gettext("Browse") %></label>
<input class="file_field" id="browseBtn-bulk-exc-students" name="students_list" type="file" accept=".csv"/>
<label for="browseBtn-bulk-csv"><%- gettext("Upload a CSV file") %></label>
<span class="browse-file enhanced-input-file" id="bulk-exception-upload"></span>
<div class="file-browse btn btn-primary" aria-hidden="true">
<span class="browse"><%- gettext("Browse") %></span>
<input class="file_field" id="browseBtn-bulk-csv" name="students_list" type="file" accept=".csv"/>
</div>
</div>
<div><button class="btn-blue upload-csv-button" type="submit"><%- gettext('Add to Exception List') %></button></div>
<button type="submit" class="btn-blue upload-csv-button"><%- gettext("Add to Exception List") %></button>
</form>
<div class="bulk-exception-results hidden"></div>
</div>
......@@ -3,9 +3,16 @@
</p>
<div class="add-certificate-invalidation">
<input class='student-username-or-email' id="certificate-invalidation-user" type="text" placeholder="<%- gettext('Username or email address') %>">
<textarea class='notes-field' id="certificate-invalidation-notes" rows="10" placeholder="<%- gettext('Add notes about this learner') %>"></textarea>
<div>
<label for="certificate-invalidation-user"><%- gettext('Username or email address') %></label>
<input class="student-username-or-email" id="certificate-invalidation-user" type="text">
</div>
<div>
<label for="certificate-invalidation-notes"><%- gettext('Add notes about this learner') %></label>
<textarea class="notes-field" id="certificate-invalidation-notes" rows="10"></textarea>
</div>
<br/>
<button type="button" class="btn-blue" id="invalidate-certificate"><%- gettext('Invalidate Certificate') %></button>
</div>
......
......@@ -2,11 +2,14 @@
<p class="under-heading"> <%- gettext("Enter the username or email address of each learner that you want to add as an exception.") %></p>
<div class='certificate-exception-inputs'>
<div class="">
<input class='student-username-or-email' id="certificate-exception" type="text" placeholder="Student email or username">
<textarea class='notes-field' id="notes" rows="10" placeholder="Free text notes"></textarea>
<label for="certificate-exception" class="sr"><%- gettext("Student email or username") %></label>
<input class="student-username-or-email" id="certificate-exception" type="text" placeholder="<%- gettext('Student email or username') %>">
<label for="notes" class="sr"><%- gettext('Free text notes') %></label>
<textarea class="notes-field" id="notes" rows="10" placeholder="<%- gettext('Free text notes') %>"></textarea>
</div>
<div>
<button type="button" class="btn-blue" id="add-exception" ><%- gettext("Add to Exception List") %> </button>
<button type="button" class="btn-blue" id="add-exception"><%- gettext("Add to Exception List") %></button>
</div>
<div class='message hidden'></div>
</div>
......@@ -135,6 +135,7 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_str
<input type="button" class="btn-blue" id="btn-start-regenerating-certificates" value="${_('Regenerate Certificates')}" data-endpoint="${section_data['urls']['start_certificate_regeneration']}"/>
</form>
<div class="certificate-regeneration-status"></div>
</div>
<hr>
<div class="certificate-generation-history">
......
......@@ -92,15 +92,14 @@ from openedx.core.djangoapps.course_groups.partition_scheme import get_cohorted_
<p>${_("To register and enroll a list of users in this course, choose a CSV file that contains the following columns in this exact order: email, username, name, and country. Please include one student per row and do not include any headers, footers, or blank lines.")}</p>
<form id="student-auto-enroll-form" method="post" action="${ section_data['upload_student_csv_button_url'] }" enctype="multipart/form-data">
<div class="customBrowseBtn">
<label for="browseFile" class="sr">${_("Upload a CSV for bulk enrollment")}</label>
<input disabled="disabled" id="browseFile" placeholder="choose file" />
<div class="file-browse btn btn-primary">
<span class="browse"> Browse </span>
<label for="browseBtn-auto_enroll_csv" class="sr">${_("Upload a CSV for bulk enrollment")}</label>
<input class="file_field" id="browseBtn-auto_enroll_csv" name="students_list" type="file" accept=".csv"/>
<label for="browseBtn-auto-enroll">${_("Upload a CSV for bulk enrollment")}</label>
<span id="browseFile" class="enhanced-input-file"></span>
<div class="file-browse btn btn-primary" aria-hidden="true">
<span class="browse">${('Browse')}</span>
<input class="file_field" id="browseBtn-auto-enroll" name="students_list" type="file" accept=".csv"/>
</div>
</div>
<button type="submit" id="submitBtn-auto_enroll_csv" name="enrollment_signup_button">${_("Upload CSV")}</button>
<button type="submit" class="btn-blue" id="submitBtn-auto_enroll_csv" name="enrollment_signup_button">${_("Upload CSV")}</button>
<input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
</form>
<div class="results"></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment