Skip to content

Commit

Permalink
Add unique title to course pages
Browse files Browse the repository at this point in the history
issue #5158
  • Loading branch information
nikolas committed Dec 19, 2023
1 parent 5db4074 commit 72ad540
Show file tree
Hide file tree
Showing 52 changed files with 74 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Assignment Feature: Instructor Creation', () => {
.contains('Add Assignment').click();

cy.log('Go through the wizard');
cy.title().should('eq', 'Mediathread Create Assignment');
cy.title().should('eq', 'Create Assignment | Mediathread');
cy.wait(500);
cy.get('a.nav-link.active').contains('Assignments');
cy.get('.breadcrumb-item').contains('Back to all assignments');
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('Assignment Feature: Instructor Creation', () => {
cy.get('#id_publish_1').click();
cy.get('#save-assignment').click();

cy.title().should('eq', 'Mediathread Assignment: Scenario 1');
cy.title().should('eq', 'Assignment: Scenario 1 | Mediathread');
cy.get('.btn-edit-assignment').should('exist');
cy.get('#student-response-dropdown')
.contains('0 of 3 Students Responded').should('be.visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Assignment Feature: Student Response', () => {
it('creates a response as a Student', () => {
cy.log('respond as a student');
cy.get('#cu-privacy-notice-button').click();
cy.title().should('eq', 'Mediathread Sample Assignment');
cy.title().should('eq', 'Sample Assignment | Mediathread');
cy.get('.page-title').should('contain', 'Sample Assignment');
cy.get('[data-cy="assignment-visibility"]').should('not.exist');
cy.get('.project-revisionbutton').should('not.exist');
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/6.discussions/discussion.feat.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Discussion View: Create Discussion', () => {
.contains('Add Assignment').click();

cy.log('create discussion wizard');
cy.title().should('eq', 'Mediathread Create Assignment');
cy.title().should('eq', 'Create Assignment | Mediathread');
cy.wait(500);
cy.get('a.nav-link.active').contains('Assignments');
cy.get('.breadcrumb-item').contains('Back to all assignments');
Expand Down Expand Up @@ -51,7 +51,7 @@ describe('Discussion View: Create Discussion', () => {
cy.get('#save-assignment').click();

cy.log('View discussion as an instructor');
cy.title().should('eq', 'Mediathread Discussion: Scenario 1');
cy.title().should('eq', 'Discussion: Scenario 1 | Mediathread');
cy.get('.btn-edit-assignment').should('exist');
cy.get('.project-visibility-description')
.contains('Shared with Class');
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('Discussion View: Create Discussion', () => {
cy.get('a').contains('Add Comments').click();

cy.log('View discussion as a student');
cy.title().should('eq', 'Mediathread Discussion: Scenario 1');
cy.title().should('eq', 'Discussion: Scenario 1 | Mediathread');
cy.get('.btn-edit-assignment').should('not.exist');
cy.get('.project-visibility-description').should('not.exist');
cy.contains('Due').should('be.visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Selection Assignment Feat: Instructor Creation', () => {
cy.visit('/course/1/project/create/sa/');
cy.get('#cu-privacy-notice-button').click();
//TODO: test selection creation from homepage
cy.title().should('eq', 'Mediathread Create Assignment');
cy.title().should('eq', 'Create Assignment | Mediathread');
cy.contains('Next').click();
cy.contains('Choose an item from the course collection')
.should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Sequence Assignment Feat: Instructor Creation', () => {
cy.contains('Add an assignment').click({force: true});
cy.get('#addSequenceAssignment').click({force: true});
cy.contains('Next').click();
cy.title().should('eq', 'Mediathread Create Sequence Assignment');
cy.title().should('eq', 'Create Sequence Assignment | Mediathread');
cy.contains('Next').click({force: true});
cy.contains('Write title & instructions').should('exist');
cy.contains('Next').click({force: true});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/99.sequenceproject/sequence.feat.1.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Sequence Project Feat: Student Creation', () => {
cy.get('#cu-privacy-notice-button').click();
cy.get('#projects-list').click();
cy.get('#add-sequence-button').click({force: true});
cy.title().should('contain', 'Mediathread — Untitled');
cy.title().should('contain', 'Untitled | Mediathread');
cy.get('.btn-edit-assignment').should('not.exist');
cy.get('button.btn-show-submit').should('not.exist');
cy.contains('Place secondary elements').should('be.visible');
Expand Down
18 changes: 9 additions & 9 deletions media/js/bundle.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions media/js/src/CollectionTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,18 @@ export default class CollectionTab extends React.Component {
enterAssetDetailView(e, asset) {
followLink(e);

if (asset && asset.title) {
jQuery('title').text(asset.title + ' | Mediathread');
}

jQuery('.collection-header')
.removeClass('d-flex')
.addClass('d-none');

jQuery('.collectionAdd')
.removeClass('show');


// Need to fetch the asset to get all the selections. The
// collection view's selections are filtered by AssetFilter.
const me = this;
Expand All @@ -167,6 +172,11 @@ export default class CollectionTab extends React.Component {

followLink(e);

if (window.MediaThread && window.MediaThread.current_course_title) {
jQuery('title').text(
window.MediaThread.current_course_title + ' | Mediathread');
}

// If the collection's assets haven't been fetched yet (if the
// user navigated directly to the item detail page), we need
// to make sure to fetch the assets.
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Mediathread &mdash; 500 Server Error</title>
<title>500 Server Error | Mediathread</title>
<link rel="stylesheet" href="{% static 'css/mediathread.css' %}" media="screen" />
</head>

Expand Down
3 changes: 2 additions & 1 deletion mediathread/templates/base_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Mediathread {% block title %}{% endblock %}</title>
<title>{% block title %}{% endblock %} Mediathread</title>

<meta id="csrf-token" name="csrf-token" content="{{csrf_token}}">

Expand Down Expand Up @@ -178,6 +178,7 @@ <h6 id="course-title" class="course-title">

{% if request.course %}
this.current_course = {{ request.course.pk }};
this.current_course_title = '{{ request.course.title }}';
this.current_course_has_vocab = {% if request.course.vocabulary_set.count > 0 %}true{% else %}false{% endif %};
this.allow_item_download = {% if allow_item_download %}true{% else %}false{% endif %};
{% endif %}
Expand Down
4 changes: 3 additions & 1 deletion mediathread/templates/courseaffils/course_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{% load static %}

{% block title %}
Home
{% if object %}
{{ object.title }} |
{% endif %}
{% endblock %}

{% block masthead %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/courseaffils/course_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load coursetags %}
{% load static %}

{% block title %}&mdash; My Courses{% endblock %}
{% block title %}My Courses |{% endblock %}

{% block coursetitle %}
My Courses
Expand Down
2 changes: 0 additions & 2 deletions mediathread/templates/courseaffils/course_update_form.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends 'dashboard/base_course_dashboard.html' %}
{% load bootstrap4 %}

{% block title %}{{block.super}}&mdash; Manage Course{% endblock %}

{% block dashboard_content %}
{{ form.media }}
<form action="" method="post">{% csrf_token %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/dashboard/base_course_dashboard.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base_new.html' %}

{% block title %}&mdash; Manage Course {% endblock %}
{% block title %}Manage Course |{% endblock %}

{% block messages %}
{% if messages %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/dashboard/class_manage_sources.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'dashboard/base_course_dashboard.html' %}
{% load assetlinks %}
{% block title %}{{block.super}}&mdash; Manage Sources{% endblock %}
{% block title %}{{block.super}} | Manage Sources |{% endblock %}

{% block dashboard_content %}

Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/dashboard/class_migrate.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'dashboard/base_course_dashboard.html' %}
{% load coursetags %}

{% block title %}{{block.super}}&mdash; Migrate Course Materials{% endblock %}
{% block title %}{{block.super}} | Migrate Course Materials |{% endblock %}

{% block uncompressable_css %}
<script type="text/javascript" src="{{STATIC_URL}}js/underscore/underscore-min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'dashboard/base_course_dashboard.html' %}

{% block title %}{{block.super}}&mdash; Panopto Ingest Log{% endblock %}
{% block title %}{{block.super}} | Panopto Ingest Log{% endblock %}

{% block dashboard_content %}
<div class="col-12 col-md">
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/dashboard/class_panopto_source.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'dashboard/base_course_dashboard.html' %}
{% load assetlinks %}
{% block title %}Panopto Source Folder{% endblock %}
{% block title %}Panopto Source Folder |{% endblock %}

{% block switchcourse %}{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/dashboard/class_roster.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'dashboard/base_course_dashboard.html' %}
{% load coursetags %}
{% load static %}
{% block title %}{{block.super}}&mdash; Course Roster{% endblock %}
{% block title %}{{block.super}} | Course Roster |{% endblock %}

{% block css %}
<link rel="stylesheet" href="{% static 'js/lib/tablesorter/theme.default.min.css' %}">
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/discussions/discussion.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base_new.html" %}

{% block title %}
{% if discussion.title %}{{discussion.title}}{% else %}New Discussion{% endif %}
{% if discussion.title %}{{discussion.title}} |{% else %}New Discussion |{% endif %}
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/main/course_activate.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load bootstrap3 %}
{% load methtags %}

{% block title %}&mdash; Activate Course{% endblock %}
{% block title %}Activate Course |{% endblock %}

{% block css %}
<link rel="stylesheet" href="{% static 'css/bootstrap-datepicker3.min.css' %}" />
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/main/deprecated_homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load tagging_tags user_projects helpful_tags coursetags comments static %}

{% block title %}
Home
Home |
{% endblock %}

{% block uncompressable_js %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/main/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block title %}
Splash Page
Splash Page |
{% endblock %}

{% block extra_body_class %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/assignment_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load coursetags static comments %}

{% block title %}
Assignments
Assignments |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/composition.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load static %}

{% block title %}
{% if project.title %}{{project.title}}{% else %}New Composition{% endif %}
{% if project.title %}{{project.title}}{% else %}New Composition{% endif %} |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/composition_assignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load user_projects coursetags static %}

{% block title %}
{% if the_response %}{{the_response.title}}{% else %}{{assignment.title}}{% endif %}
{% if the_response %}{{the_response.title}}{% else %}{{assignment.title}}{% endif %} |
{% endblock %}

{% block css %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base_new.html" %}

{% block title %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Assignment{% endif %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Assignment{% endif %} |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/composition_readonly.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base_new.html" %}

{% block title %}
{{project.title}}
{{project.title}} |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/discussion_assignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load user_projects coursetags static %}

{% block title %}
{{assignment.title}}
{{assignment.title}} |
{% endblock %}

{% block css %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base_new.html" %}

{% block title %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Assignment{% endif %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Assignment{% endif %} |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load coursetags %}

{% block title %}
{% if project.title %}{{project.title}}{% else %}Print View{% endif %}
{% if project.title %}{{project.title}}{% else %}Print View{% endif %} |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/project_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load static %}

{% block title %}
Projects
Projects |
{% endblock %}

{% block css %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base_new.html" %}

{% block title %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Assignment{% endif %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Assignment{% endif %} |
{% endblock %}

{% block uncompressable_css %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load user_projects coursetags static %}

{% block title %}
{% if assignment.title %}{{assignment.title}}{% else %}New Assignment{% endif %}
{% if assignment.title %}{{assignment.title}}{% else %}New Assignment{% endif %} |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/sequence.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load static %}

{% block title %}
{% if project.title %}&mdash; {{project.title}}{% else %}&mdash; Sequence{% endif %}
{% if project.title %}{{project.title}}{% else %}Sequence{% endif %} |
{% endblock %}

{% block css %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base_new.html" %}

{% block title %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Sequence Assignment{% endif %}
{% if form.instance %}{{form.instance.title}}{% else %}Create Sequence Assignment{% endif %} |
{% endblock %}

{% block css %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load static %}

{% block title %}
{% if assignment.title %}{{assignment.title}}{% else %}New Assignment{% endif %}
{% if assignment.title %}{{assignment.title}}{% else %}New Assignment{% endif %} |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/projects/version_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load static %}

{% block title %}
Projects
Projects |
{% endblock %}

{% block css %}
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/registration/activate.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base_new.html" %}
{% load i18n %}
{% block title %}&mdash; {% if account %}Activation complete{% else %}Activation problem{% endif %}{% endblock %}
{% block title %}{% if account %}Activation complete{% else %}Activation problem{% endif %} |{% endblock %}

{% block registration_content %}
<h2 class="pagetitle signuptitle">Account Activation</h2>
Expand Down
Loading

0 comments on commit 72ad540

Please sign in to comment.