Commit 6c540351 by Andy Armstrong Committed by Brian Jacobel

Add a content header to the discussion board

parent 89f93df4
/* global $$course_id, Content, Discussion, DiscussionRouter, DiscussionCourseSettings,
DiscussionUser, DiscussionUserProfileView, DiscussionUtil */
(function() {
'use strict';
var DiscussionApp, DiscussionProfileApp;
if (typeof Backbone !== 'undefined' && Backbone !== null) {
DiscussionApp = {
start: function(elem) {
var content_info, course_settings, discussion, element, sort_preference, thread_pages, threads,
user, user_info;
DiscussionUtil.loadRolesFromContainer();
element = $(elem);
window.$$course_id = element.data('course-id');
window.courseName = element.data('course-name');
user_info = element.data('user-info');
sort_preference = element.data('sort-preference');
threads = element.data('threads');
thread_pages = element.data('thread-pages');
content_info = element.data('content-info');
user = new DiscussionUser(user_info);
DiscussionUtil.setUser(user);
window.user = user;
Content.loadContentInfos(content_info);
discussion = new Discussion(threads, {
pages: thread_pages,
sort: sort_preference
});
course_settings = new DiscussionCourseSettings(element.data('course-settings'));
new DiscussionRouter({ // eslint-disable-line no-new
discussion: discussion,
course_settings: course_settings
});
if (!Backbone.History.started) {
Backbone.history.start({pushState: true, root: '/courses/' + $$course_id + '/discussion/forum/'});
} else {
Backbone.history.loadUrl(window.location.pathname);
}
}
};
DiscussionProfileApp = {
start: function(elem) {
var element, numPages, page, threads, user_info;
DiscussionUtil.loadRoles({
'Moderator': [],
'Administrator': [],
'Community TA': []
});
element = $(elem);
window.$$course_id = element.data('course-id');
threads = element.data('threads');
user_info = element.data('user-info');
window.user = new DiscussionUser(user_info);
page = element.data('page');
numPages = element.data('num-pages');
return new DiscussionUserProfileView({
el: element,
collection: threads,
page: page,
numPages: numPages
});
}
};
$(function() {
$('section.discussion').each(function(index, elem) {
return DiscussionApp.start(elem);
});
return $('section.discussion-user-threads').each(function(index, elem) {
return DiscussionProfileApp.start(elem);
});
});
}
}).call(window);
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
this.roleIds = roles; this.roleIds = roles;
}; };
DiscussionUtil.loadRolesFromContainer = function() {
return this.loadRoles($('#discussion-container').data('roles'));
};
DiscussionUtil.isStaff = function(userId) { DiscussionUtil.isStaff = function(userId) {
var staff; var staff;
if (_.isUndefined(userId)) { if (_.isUndefined(userId)) {
......
...@@ -577,11 +577,11 @@ class DiscussionUserProfilePage(CoursePage): ...@@ -577,11 +577,11 @@ class DiscussionUserProfilePage(CoursePage):
def is_browser_on_page(self): def is_browser_on_page(self):
return ( return (
self.q(css='section.discussion-user-threads[data-course-id="{}"]'.format(self.course_id)).present self.q(css='.discussion-user-threads[data-course-id="{}"]'.format(self.course_id)).present
and and
self.q(css='section.user-profile a.learner-profile-link').present self.q(css='.user-profile .learner-profile-link').present
and and
self.q(css='section.user-profile a.learner-profile-link').text[0] == self.username self.q(css='.user-profile .learner-profile-link').text[0] == self.username
) )
@wait_for_js @wait_for_js
...@@ -721,7 +721,7 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin): ...@@ -721,7 +721,7 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
""" """
Returns the new post button. Returns the new post button.
""" """
elements = self.q(css="ol.course-tabs .new-post-btn") elements = self.q(css=".new-post-btn")
return elements.first if elements.visible and len(elements) == 1 else None return elements.first if elements.visible and len(elements) == 1 else None
@property @property
......
;(function(define) { (function(define) {
'use strict'; 'use strict';
define(['jquery', 'backbone'], define(
function($, Backbone) { [
'jquery',
'backbone',
'discussion/js/discussion_router',
'common/js/discussion/views/new_post_view'
],
function($, Backbone, DiscussionRouter, NewPostView) {
return function(options) { return function(options) {
var element = options.el, var userInfo = options.user_info,
userInfo = element.data('user-info'), sortPreference = options.sort_preference,
sortPreference = element.data('sort-preference'), threads = options.threads,
threads = element.data('threads'), threadPages = options.thread_pages,
threadPages = element.data('thread-pages'), contentInfo = options.content_info,
contentInfo = element.data('content-info'),
user = new window.DiscussionUser(userInfo), user = new window.DiscussionUser(userInfo),
discussion, discussion,
courseSettings; courseSettings,
newPostView,
router;
// TODO: Perhaps eliminate usage of global variables when possible // TODO: Perhaps eliminate usage of global variables when possible
window.DiscussionUtil.loadRolesFromContainer(); window.DiscussionUtil.loadRoles(options.roles);
window.$$course_id = options.courseId; window.$$course_id = options.courseId;
window.courseName = element.data('course-name'); window.courseName = options.course_name;
window.DiscussionUtil.setUser(user); window.DiscussionUtil.setUser(user);
window.user = user; window.user = user;
window.Content.loadContentInfos(contentInfo); window.Content.loadContentInfos(contentInfo);
discussion = new window.Discussion(threads, {pages: threadPages, sort: sortPreference}); discussion = new window.Discussion(threads, {pages: threadPages, sort: sortPreference});
courseSettings = new window.DiscussionCourseSettings(element.data('course-settings')); courseSettings = new window.DiscussionCourseSettings(options.course_settings);
// jshint nonew:false
new window.DiscussionRouter({ // Create the new post view
discussion: discussion, newPostView = new NewPostView({
course_settings: courseSettings el: $('.new-post-article'),
collection: discussion,
course_settings: courseSettings,
mode: 'tab'
}); });
Backbone.history.start({ newPostView.render();
pushState: true,
root: '/courses/' + options.courseId + '/discussion/forum/' // Set up the router to manage the page's history
router = new DiscussionRouter({
courseId: options.courseId,
discussion: discussion,
courseSettings: courseSettings,
newPostView: newPostView
}); });
router.start();
}; };
}); });
}).call(this, define || RequireJS.define); }).call(this, define || RequireJS.define);
;(function(define) { (function(define) {
'use strict'; 'use strict';
define(['jquery', 'DiscussionUserProfileView'], define(['jquery', 'discussion/js/views/discussion_user_profile_view'],
function($, DiscussionUserProfileView) { function($, DiscussionUserProfileView) {
return function(options) { return function(options) {
var element = options.el, var $element = options.$el,
threads = element.data('threads'), threads = options.threads,
userInfo = element.data('user-info'), userInfo = options.userInfo,
page = element.data('page'), page = options.page,
numPages = element.data('num-pages'); numPages = options.numPages;
// Roles are not included in user profile page, but they are not used for anything // Roles are not included in user profile page, but they are not used for anything
window.DiscussionUtil.loadRoles({ window.DiscussionUtil.loadRoles({
'Moderator': [], 'Moderator': [],
'Administrator': [], 'Administrator': [],
'Community TA': [] 'Community TA': []
}); });
window.$$course_id = element.data('course-id'); window.$$course_id = options.courseId;
window.user = new window.DiscussionUser(userInfo); window.user = new window.DiscussionUser(userInfo);
// jshint nonew:false // jshint nonew:false
new DiscussionUserProfileView({ new DiscussionUserProfileView({
el: element, el: $element,
collection: threads, collection: threads,
page: page, page: page,
numPages: numPages numPages: numPages
......
define(
[
'jquery',
'backbone',
'common/js/spec_helpers/page_helpers',
'common/js/spec_helpers/discussion_spec_helper',
'discussion/js/discussion_board_factory'
],
function($, Backbone, PageHelpers, DiscussionSpecHelper, DiscussionBoardFactory) {
'use strict';
// TODO: re-enable when this doesn't interact badly with other history tests
xdescribe('Discussion Board Factory', function() {
var initializeDiscussionBoardFactory = function() {
DiscussionBoardFactory({
el: $('.discussion-board'),
courseId: 'test_course_id',
course_name: 'Test Course',
user_info: DiscussionSpecHelper.getTestUserInfo(),
roles: DiscussionSpecHelper.getTestRoleInfo(),
sort_preference: null,
threads: [],
thread_pages: [],
content_info: null,
course_settings: {
is_cohorted: false,
allow_anonymous: false,
allow_anonymous_to_peers: false,
cohorts: [],
category_map: {}
}
});
};
beforeEach(function() {
PageHelpers.preventBackboneChangingUrl();
// Install the fixtures
setFixtures(
'<div class="discussion-board">' +
' <div class="forum-nav"></div>' +
'</div>'
);
DiscussionSpecHelper.setUnderscoreFixtures();
});
afterEach(function() {
Backbone.history.stop();
});
it('can render itself', function() {
initializeDiscussionBoardFactory();
expect($('.discussion-board').text()).toContain('All Discussions');
});
});
}
);
define(
[
'underscore',
'jquery',
'backbone',
'common/js/spec_helpers/discussion_spec_helper',
'discussion/js/discussion_profile_page_factory'
],
function(_, $, Backbone, DiscussionSpecHelper, DiscussionProfilePageFactory) {
'use strict';
describe('Discussion Profile Page Factory', function() {
var testCourseId = 'test_course',
initializeDiscussionProfilePageFactory = function(options) {
DiscussionProfilePageFactory(_.extend(
{
courseId: testCourseId,
$el: $('.discussion-user-threads'),
user_info: DiscussionSpecHelper.getTestUserInfo(),
roles: DiscussionSpecHelper.getTestRoleInfo(),
sort_preference: null,
threads: [],
page: 1,
numPages: 5
},
options
));
};
beforeEach(function() {
setFixtures('<div class="discussion-user-threads"></div>');
DiscussionSpecHelper.setUnderscoreFixtures();
});
it('can render itself', function() {
initializeDiscussionProfilePageFactory();
expect($('.discussion-user-threads').text()).toContain('Active Threads');
});
});
}
);
/* globals Discussion, DiscussionThreadProfileView, DiscussionUtil, URI */ (function(define) {
(function() {
'use strict'; 'use strict';
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) {
for (var key in parent) {
if (__hasProp.call(parent, key)) {
child[key] = parent[key];
}
}
function ctor() {
this.constructor = child;
}
ctor.prototype = parent.prototype;
child.prototype = new ctor();
child.__super__ = parent.prototype;
return child;
};
if (typeof Backbone !== 'undefined' && Backbone !== null) {
this.DiscussionUserProfileView = (function(_super) {
__extends(DiscussionUserProfileView, _super);
function DiscussionUserProfileView() {
var self = this;
this.render = function() {
return DiscussionUserProfileView.prototype.render.apply(self, arguments);
};
return DiscussionUserProfileView.__super__.constructor.apply(this, arguments);
}
DiscussionUserProfileView.prototype.events = { define([
'click .discussion-paginator a': 'changePage' 'underscore',
}; 'jquery',
'backbone',
'gettext',
'URI',
'edx-ui-toolkit/js/utils/html-utils',
'common/js/components/utils/view_utils',
'common/js/discussion/discussion',
'common/js/discussion/utils',
'common/js/discussion/views/discussion_thread_profile_view',
'text!discussion/templates/user-profile.underscore',
'text!common/templates/discussion/pagination.underscore'
],
function(_, $, Backbone, gettext, URI, HtmlUtils, ViewUtils, Discussion, DiscussionUtil,
DiscussionThreadProfileView, userProfileTemplate, paginationTemplate) {
var DiscussionUserProfileView = Backbone.View.extend({
events: {
'click .discussion-paginator a': 'changePage'
},
DiscussionUserProfileView.prototype.initialize = function(options) { initialize: function(options) {
DiscussionUserProfileView.__super__.initialize.call(this); Backbone.View.prototype.initialize.call(this);
this.page = options.page; this.page = options.page;
this.numPages = options.numPages; this.numPages = options.numPages;
this.discussion = new Discussion(); this.discussion = new Discussion();
this.discussion.on('reset', this.render); this.discussion.on('reset', _.bind(this.render, this));
return this.discussion.reset(this.collection, { this.discussion.reset(this.collection, {silent: false});
silent: false },
});
};
DiscussionUserProfileView.prototype.render = function() { render: function() {
var baseUri, pageUrlFunc, paginationParams, var self = this,
self = this; baseUri = URI(window.location).removeSearch('page'),
this.$el.html(_.template($('#user-profile-template').html())({ pageUrlFunc,
threads: this.discussion.models paginationParams;
})); HtmlUtils.setHtml(this.$el, HtmlUtils.template(userProfileTemplate)({
this.discussion.map(function(thread) { threads: self.discussion.models
return new DiscussionThreadProfileView({ }));
el: self.$('article#thread_' + thread.id), this.discussion.map(function(thread) {
model: thread var view = new DiscussionThreadProfileView({
}).render(); el: self.$('article#thread_' + thread.id),
}); model: thread
baseUri = URI(window.location).removeSearch('page');
pageUrlFunc = function(page) {
return baseUri.clone().addSearch('page', page);
};
paginationParams = DiscussionUtil.getPaginationParams(this.page, this.numPages, pageUrlFunc);
this.$el.find('.discussion-pagination')
.html(_.template($('#pagination-template').html())(paginationParams));
};
DiscussionUserProfileView.prototype.changePage = function(event) {
var url,
self = this;
event.preventDefault();
url = $(event.target).attr('href');
return DiscussionUtil.safeAjax({
$elem: this.$el,
$loading: $(event.target),
takeFocus: true,
url: url,
type: 'GET',
dataType: 'json',
success: function(response) {
self.page = response.page;
self.numPages = response.num_pages;
self.discussion.reset(response.discussion_data, {
silent: false
});
history.pushState({}, '', url);
return $('html, body').animate({
scrollTop: 0
}); });
}, view.render();
error: function() { return view;
return DiscussionUtil.discussionAlert( });
gettext('Sorry'), pageUrlFunc = function(page) {
gettext('We had some trouble loading the page you requested. Please try again.') return baseUri.clone().addSearch('page', page).toString();
); };
} paginationParams = DiscussionUtil.getPaginationParams(this.page, this.numPages, pageUrlFunc);
}); HtmlUtils.setHtml(
}; this.$el.find('.discussion-pagination'),
HtmlUtils.template(paginationTemplate)(paginationParams)
);
return this;
},
changePage: function(event) {
var self = this,
url;
event.preventDefault();
url = $(event.target).attr('href');
DiscussionUtil.safeAjax({
$elem: this.$el,
$loading: $(event.target),
takeFocus: true,
url: url,
type: 'GET',
dataType: 'json',
success: function(response) {
self.page = response.page;
self.numPages = response.num_pages;
self.discussion.reset(response.discussion_data, {silent: false});
history.pushState({}, '', url);
ViewUtils.setScrollTop(0);
},
error: function() {
DiscussionUtil.discussionAlert(
gettext('Sorry'),
gettext('We had some trouble loading the page you requested. Please try again.')
);
}
});
}
});
return DiscussionUserProfileView; return DiscussionUserProfileView;
})(Backbone.View); });
} }).call(this, define || RequireJS.define);
}).call(window);
<h2><%- gettext("Active Threads") %></h2> <h2><%- gettext("Active Threads") %></h2>
<section class="discussion"> <section class="discussion">
<% _.each(threads, function(thread) { %> <% _.each(threads, function(thread) { %>
<article class="discussion-thread" id="thread_<%= thread.id %>"/> <article class="discussion-thread" id="thread_<%- thread.id %>"/>
<% }); %> <% }); %>
</section> </section>
<section class="discussion-pagination"/> <section class="discussion-pagination"/>
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs from django.template.defaultfilters import escapejs
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string from django_comment_client.permissions import has_permission
) from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
%> %>
<%block name="bodyclass">discussion</%block> <%block name="bodyclass">discussion</%block>
...@@ -21,44 +21,58 @@ from openedx.core.djangolib.js_utils import ( ...@@ -21,44 +21,58 @@ from openedx.core.djangolib.js_utils import (
<%include file="../discussion/_js_head_dependencies.html" /> <%include file="../discussion/_js_head_dependencies.html" />
</%block> </%block>
<%block name="js_extra"> <%block name="base_js_dependencies">
## Enable fast preview to fix discussion MathJax rendering bug when page first loads. ## Enable fast preview to fix discussion MathJax rendering bug when page first loads.
<%include file="/discussion/_js_body_dependencies.html" args="disable_fast_preview=False"/> <%include file="/discussion/_js_body_dependencies.html" args="disable_fast_preview=False"/>
<%static:js group='discussion'/> </%block>
<script type="text/javascript">
RequireJS.define('DiscussionBoardFactory', [], function() {return window['DiscussionBoardFactory'];});
</script>
<%block name="js_extra">
<%static:require_module module_name="discussion/js/discussion_board_factory" class_name="DiscussionBoardFactory"> <%static:require_module module_name="discussion/js/discussion_board_factory" class_name="DiscussionBoardFactory">
DiscussionBoardFactory({ DiscussionBoardFactory({
courseId: '${unicode(course.id) | n, js_escaped_string}', courseId: '${unicode(course.id) | n, js_escaped_string}',
el: $(".discussion-board") $el: $(".discussion-board"),
}); user_info: ${user_info | n, dump_js_escaped_json},
roles: ${roles | n, dump_js_escaped_json},
sort_preference: '${sort_preference | n, js_escaped_string}',
threads: ${threads | n, dump_js_escaped_json},
thread_pages: '${thread_pages | n, js_escaped_string}',
content_info: ${annotated_content_info | n, dump_js_escaped_json},
course_name: '${course.display_name_with_default | n, js_escaped_string}',
course_settings: ${course_settings | n, dump_js_escaped_json}
});
</%static:require_module> </%static:require_module>
</%block> </%block>
<%include file="/discussion/_discussion_course_navigation.html" args="active_page='discussion'" /> <%include file="../courseware/course_navigation.html" args="active_page='discussion'" />
<%block name="content"> <%block name="content">
<section class="discussion discussion-board container" id="discussion-container" <section class="discussion discussion-board container" id="discussion-container"
data-roles="${roles}"
data-course-id="${course_id}" data-course-id="${course_id}"
data-course-name="${course.display_name_with_default}"
data-user-info="${user_info}"
data-user-create-comment="${can_create_comment}" data-user-create-comment="${can_create_comment}"
data-user-create-subcomment="${can_create_subcomment}" data-user-create-subcomment="${can_create_subcomment}"
data-read-only="false" data-read-only="false"
data-threads="${threads}"
data-thread-pages="${thread_pages}"
data-content-info="${annotated_content_info}"
data-sort-preference="${sort_preference}" data-sort-preference="${sort_preference}"
data-flag-moderator="${flag_moderator}" data-flag-moderator="${flag_moderator}"
data-user-cohort-id="${user_cohort}" data-user-cohort-id="${user_cohort}">
data-course-settings="${course_settings}"> <header class="page-header has-secondary">
<div class="discussion-body"> <div class="page-header-main">
<div class="forum-nav" role="complementary" aria-label="${_("Discussion thread list")}"></div> <div class="sr-is-focusable" tabindex="-1"></div>
<div class="discussion-column" id="discussion-column"> <h2 class="hd hd-2 page-title">${_("Discussion")}</h2>
<main id="main" aria-label="Content" tabindex="-1"> </div>
<div class="page-header-secondary">
% if has_permission(user, 'create_thread', course.id):
<div class="form-actions">
<button class="btn btn-small new-post-btn">${_("Add a Post")}</button>
</div>
% endif
</div>
</header>
<div class="page-content">
<div class="discussion-body layout layout-1t2t">
<aside class="forum-nav layout-col layout-col-a" role="complementary" aria-label="${_("Discussion thread list")}">
</aside>
<main id="main" aria-label="Content" tabindex="-1" class="discussion-column layout-col layout-col-b">
<article class="new-post-article" style="display: none" tabindex="-1" aria-label="${_("New topic form")}"></article> <article class="new-post-article" style="display: none" tabindex="-1" aria-label="${_("New topic form")}"></article>
<div class="forum-content"></div> <div class="forum-content"></div>
</main> </main>
......
<%inherit file="../main.html" /> ## mako
<%! main_css = "style-discussion-main" %>
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%inherit file="../main.html" />
<%namespace name='static' file='../static_content.html'/> <%namespace name='static' file='../static_content.html'/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs from django.template.defaultfilters import escapejs
from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string
)
%> %>
<%block name="bodyclass">discussion</%block> <%block name="bodyclass">discussion-user-profile</%block>
<%block name="pagetitle">${_("Discussion - {course_number}").format(course_number=course.display_number_with_default)}</%block> <%block name="pagetitle">${_("Discussion - {course_number}").format(course_number=course.display_number_with_default)}</%block>
<%block name="headextra"> <%block name="headextra">
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
<%include file="_js_head_dependencies.html" /> <%include file="_js_head_dependencies.html" />
</%block> </%block>
<%block name="js_extra"> <%block name="js_extra">
<%include file="_js_body_dependencies.html" /> <%include file="_js_body_dependencies.html" />
<%static:js group='discussion'/>
<%static:require_module module_name="discussion/js/discussion_profile_page_factory" class_name="DiscussionProfilePageFactory">
<%
profile_page_context = {
'courseId': unicode(course.id),
'courseName': course.display_name_with_default,
'userInfo': user_info,
'threads': threads,
'page': page,
'numPages': num_pages,
}
%>
DiscussionProfilePageFactory(_.extend(
{
$el: $('.discussion-user-threads')
},
${profile_page_context | n, dump_js_escaped_json}
));
</%static:require_module>
</%block> </%block>
<%include file="../courseware/course_navigation.html" args="active_page='discussion'" /> <%include file="../courseware/course_navigation.html" args="active_page='discussion'" />
<section class="container"> <section class="container">
<div class="course-wrapper"> <header class="page-header">
<section class="user-profile"> <div class="page-header-main">
<nav aria-label="${_('User Profile')}"> <div class="sr-is-focusable" tabindex="-1"></div>
<h2 class="hd hd-2 page-title">${_("Discussion")}</h2>
<article class="sidebar-module discussion-sidebar"> </div>
<%include file="_user_profile.html" /> </header>
</article> <div class="page-content">
<div class="layout layout-1t2t">
</nav> <aside class="forum-nav layout-col layout-col-a" role="complementary" aria-label="${_("Discussion thread list")}">
</section> <nav class="user-profile" aria-label="${_('User Profile')}">
<section class="course-content container discussion-user-threads" data-course-id="${course.id}" data-course-name="${course.display_name_with_default}" data-threads="${threads}" data-user-info="${user_info}" data-page="${page}" data-num-pages="${num_pages}"/>
</div> <article class="sidebar-module discussion-sidebar">
<%include file="_user_profile.html" />
</article>
</nav>
</aside>
<main id="main" aria-label="Content" tabindex="-1" class="discussion-column layout-col layout-col-b">
<div class="course-content discussion-user-threads" data-course-id="${course.id}"
data-course-name="${course.display_name_with_default}"
data-threads="${threads}" data-user-info="${user_info}"
data-page="${page}" data-num-pages="${num_pages}">
</div>
</main>
</div>
</div>
</section> </section>
<%include file="_underscore_templates.html" /> <%include file="_underscore_templates.html" />
## mako
<%! main_css = "style-discussion-main" %>
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%page expression_filter="h"/>
<%inherit file="../main.html" /> <%inherit file="../main.html" />
<h1>${_("We're sorry")}</h1>
<p>${_("The forums are currently undergoing maintenance. We'll have them back up shortly!")}</p> <%block name="bodyclass">discussion</%block>
<%block name="headextra">
<%include file="../discussion/_js_head_dependencies.html" />
</%block>
<%block name="content">
<h2>${_("Discussion unavailable")}</h2>
<div class="alert alert-error" role="alert" aria-labelledby="alert-title-error" tabindex="-1">
<span class="icon alert-icon fa fa-exclamation-triangle" aria-hidden="true"></span>
<div class="alert-message-with-action">
<p class="alert-copy">
${_("The discussions are currently undergoing maintenance. We'll have them back up shortly!")}
</p>
</div>
</div>
</%block>
## mako
<%! main_css = "style-discussion-main" %>
<%page expression_filter="h"/>
<%inherit file="../main.html" />
<%namespace name='static' file='../static_content.html'/>
<%!
from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs
from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string
)
%>
<%block name="bodyclass">discussion-user-profile</%block>
<%block name="pagetitle">${_("Discussion - {course_number}").format(course_number=course.display_number_with_default)}</%block>
<%block name="headextra">
<%include file="_js_head_dependencies.html" />
</%block>
<%block name="js_extra">
<%include file="_js_body_dependencies.html" />
<%static:js group='discussion'/>
<script type="text/javascript">
RequireJS.define('DiscussionUserProfileView', [], function() {return window['DiscussionUserProfileView'];});
</script>
<%static:require_module module_name="discussion/js/discussion_profile_page_factory" class_name="DiscussionProfilePageFactory">
DiscussionProfilePageFactory({
courseId: '${unicode(course.id) | n, js_escaped_string}',
el: $(".discussion-user-threads")
});
</%static:require_module>
</%block>
<%include file="../courseware/course_navigation.html" args="active_page='discussion'" />
<section class="container">
<div class="forum-nav">
<section class="user-profile">
<nav aria-label="${_('User Profile')}">
<article class="sidebar-module discussion-sidebar">
<%include file="_user_profile.html" />
</article>
</nav>
</section>
</div>
<div class="discussion-column" id="discussion-column">
<main id="main" aria-label="Content" tabindex="-1">
<section class="course-content container discussion-user-threads" data-course-id="${course.id}"
data-course-name="${course.display_name_with_default}"
data-threads="${threads}" data-user-info="${user_info}"
data-page="${page}" data-num-pages="${num_pages}"/>
</main>
</div>
</section>
<%include file="_underscore_templates.html" />
...@@ -459,7 +459,7 @@ class SingleCohortedThreadTestCase(CohortedTestCase): ...@@ -459,7 +459,7 @@ class SingleCohortedThreadTestCase(CohortedTestCase):
html = response.content html = response.content
# Verify that the group name is correctly included in the HTML # Verify that the group name is correctly included in the HTML
self.assertRegexpMatches(html, r'&#34;group_name&#34;: &#34;student_cohort&#34;') self.assertRegexpMatches(html, r'"group_name": "student_cohort"')
@patch('lms.lib.comment_client.utils.requests.request', autospec=True) @patch('lms.lib.comment_client.utils.requests.request', autospec=True)
...@@ -812,7 +812,7 @@ class ForumFormDiscussionGroupIdTestCase(CohortedTestCase, CohortedTopicGroupIdT ...@@ -812,7 +812,7 @@ class ForumFormDiscussionGroupIdTestCase(CohortedTestCase, CohortedTopicGroupIdT
self.client.login(username=user.username, password='test') self.client.login(username=user.username, password='test')
return self.client.get( return self.client.get(
reverse(views.forum_form_discussion, args=[unicode(self.course.id)]), reverse("discussion.views.forum_form_discussion", args=[unicode(self.course.id)]),
data=request_data, data=request_data,
**headers **headers
) )
...@@ -1147,10 +1147,10 @@ class UserProfileTestCase(UrlResetMixin, ModuleStoreTestCase): ...@@ -1147,10 +1147,10 @@ class UserProfileTestCase(UrlResetMixin, ModuleStoreTestCase):
self.assertRegexpMatches(html, r'data-num-pages="1"') self.assertRegexpMatches(html, r'data-num-pages="1"')
self.assertRegexpMatches(html, r'<span>1</span> discussion started') self.assertRegexpMatches(html, r'<span>1</span> discussion started')
self.assertRegexpMatches(html, r'<span>2</span> comments') self.assertRegexpMatches(html, r'<span>2</span> comments')
self.assertRegexpMatches(html, r'&#34;id&#34;: &#34;{}&#34;'.format(self.TEST_THREAD_ID)) self.assertRegexpMatches(html, r'&#39;id&#39;: &#39;{}&#39;'.format(self.TEST_THREAD_ID))
self.assertRegexpMatches(html, r'&#34;title&#34;: &#34;{}&#34;'.format(self.TEST_THREAD_TEXT)) self.assertRegexpMatches(html, r'&#39;title&#39;: &#39;{}&#39;'.format(self.TEST_THREAD_TEXT))
self.assertRegexpMatches(html, r'&#34;body&#34;: &#34;{}&#34;'.format(self.TEST_THREAD_TEXT)) self.assertRegexpMatches(html, r'&#39;body&#39;: &#39;{}&#39;'.format(self.TEST_THREAD_TEXT))
self.assertRegexpMatches(html, r'&#34;username&#34;: &#34;{}&#34;'.format(self.student.username)) self.assertRegexpMatches(html, r'&#39;username&#39;: u&#39;{}&#39;'.format(self.student.username))
def check_ajax(self, mock_request, **params): def check_ajax(self, mock_request, **params):
response = self.get_response(mock_request, params, HTTP_X_REQUESTED_WITH="XMLHttpRequest") response = self.get_response(mock_request, params, HTTP_X_REQUESTED_WITH="XMLHttpRequest")
...@@ -1360,6 +1360,7 @@ class ForumDiscussionXSSTestCase(UrlResetMixin, ModuleStoreTestCase): ...@@ -1360,6 +1360,7 @@ class ForumDiscussionXSSTestCase(UrlResetMixin, ModuleStoreTestCase):
""" """
Test that XSS attack is prevented Test that XSS attack is prevented
""" """
mock_user.return_value.to_dict.return_value = {}
reverse_url = "%s%s" % (reverse( reverse_url = "%s%s" % (reverse(
"discussion.views.forum_form_discussion", "discussion.views.forum_form_discussion",
kwargs={"course_id": unicode(self.course.id)}), '/forum_form_discussion') kwargs={"course_id": unicode(self.course.id)}), '/forum_form_discussion')
...@@ -1377,7 +1378,7 @@ class ForumDiscussionXSSTestCase(UrlResetMixin, ModuleStoreTestCase): ...@@ -1377,7 +1378,7 @@ class ForumDiscussionXSSTestCase(UrlResetMixin, ModuleStoreTestCase):
Test that XSS attack is prevented Test that XSS attack is prevented
""" """
mock_threads.return_value = [], 1, 1 mock_threads.return_value = [], 1, 1
mock_from_django_user.return_value = Mock() mock_from_django_user.return_value.to_dict.return_value = {}
mock_request.side_effect = make_mock_request_impl(course=self.course, text='dummy') mock_request.side_effect = make_mock_request_impl(course=self.course, text='dummy')
url = reverse('discussion.views.user_profile', url = reverse('discussion.views.user_profile',
......
...@@ -3,7 +3,6 @@ Views handling read (GET) requests for the Discussion tab and inline discussions ...@@ -3,7 +3,6 @@ Views handling read (GET) requests for the Discussion tab and inline discussions
""" """
from functools import wraps from functools import wraps
import json
import logging import logging
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
...@@ -248,9 +247,9 @@ def forum_form_discussion(request, course_key): ...@@ -248,9 +247,9 @@ def forum_form_discussion(request, course_key):
'course': course, 'course': course,
#'recent_active_threads': recent_active_threads, #'recent_active_threads': recent_active_threads,
'staff_access': bool(has_access(request.user, 'staff', course)), 'staff_access': bool(has_access(request.user, 'staff', course)),
'threads': json.dumps(threads), 'threads': threads,
'thread_pages': query_params['num_pages'], 'thread_pages': query_params['num_pages'],
'user_info': json.dumps(user_info, default=lambda x: None), 'user_info': user_info,
'can_create_comment': has_permission(request.user, "create_comment", course.id), 'can_create_comment': has_permission(request.user, "create_comment", course.id),
'can_create_subcomment': has_permission(request.user, "create_sub_comment", course.id), 'can_create_subcomment': has_permission(request.user, "create_sub_comment", course.id),
'can_create_thread': has_permission(request.user, "create_thread", course.id), 'can_create_thread': has_permission(request.user, "create_thread", course.id),
...@@ -258,16 +257,16 @@ def forum_form_discussion(request, course_key): ...@@ -258,16 +257,16 @@ def forum_form_discussion(request, course_key):
has_permission(request.user, 'openclose_thread', course.id) or has_permission(request.user, 'openclose_thread', course.id) or
has_access(request.user, 'staff', course) has_access(request.user, 'staff', course)
), ),
'annotated_content_info': json.dumps(annotated_content_info), 'annotated_content_info': annotated_content_info,
'course_id': course.id.to_deprecated_string(), 'course_id': course.id.to_deprecated_string(),
'roles': json.dumps(utils.get_role_ids(course_key)), 'roles': utils.get_role_ids(course_key),
'is_moderator': has_permission(request.user, "see_all_cohorts", course_key), 'is_moderator': has_permission(request.user, "see_all_cohorts", course_key),
'cohorts': course_settings["cohorts"], # still needed to render _thread_list_template 'cohorts': course_settings["cohorts"], # still needed to render _thread_list_template
'user_cohort': user_cohort_id, # read from container in NewPostView 'user_cohort': user_cohort_id, # read from container in NewPostView
'is_course_cohorted': is_course_cohorted(course_key), # still needed to render _thread_list_template 'is_course_cohorted': is_course_cohorted(course_key), # still needed to render _thread_list_template
'sort_preference': user.default_sort_key, 'sort_preference': user.default_sort_key,
'category_map': course_settings["category_map"], 'category_map': course_settings["category_map"],
'course_settings': json.dumps(course_settings), 'course_settings': course_settings,
'disable_courseware_js': True, 'disable_courseware_js': True,
'uses_pattern_library': True, 'uses_pattern_library': True,
} }
...@@ -360,17 +359,17 @@ def single_thread(request, course_key, discussion_id, thread_id): ...@@ -360,17 +359,17 @@ def single_thread(request, course_key, discussion_id, thread_id):
'discussion_id': discussion_id, 'discussion_id': discussion_id,
'csrf': csrf(request)['csrf_token'], 'csrf': csrf(request)['csrf_token'],
'init': '', # TODO: What is this? 'init': '', # TODO: What is this?
'user_info': json.dumps(user_info), 'user_info': user_info,
'can_create_comment': has_permission(request.user, "create_comment", course.id), 'can_create_comment': has_permission(request.user, "create_comment", course.id),
'can_create_subcomment': has_permission(request.user, "create_sub_comment", course.id), 'can_create_subcomment': has_permission(request.user, "create_sub_comment", course.id),
'can_create_thread': has_permission(request.user, "create_thread", course.id), 'can_create_thread': has_permission(request.user, "create_thread", course.id),
'annotated_content_info': json.dumps(annotated_content_info), 'annotated_content_info': annotated_content_info,
'course': course, 'course': course,
#'recent_active_threads': recent_active_threads, #'recent_active_threads': recent_active_threads,
'course_id': course.id.to_deprecated_string(), # TODO: Why pass both course and course.id to template? 'course_id': course.id.to_deprecated_string(), # TODO: Why pass both course and course.id to template?
'thread_id': thread_id, 'thread_id': thread_id,
'threads': json.dumps(threads), 'threads': threads,
'roles': json.dumps(utils.get_role_ids(course_key)), 'roles': utils.get_role_ids(course_key),
'is_moderator': is_moderator, 'is_moderator': is_moderator,
'thread_pages': query_params['num_pages'], 'thread_pages': query_params['num_pages'],
'is_course_cohorted': is_course_cohorted(course_key), 'is_course_cohorted': is_course_cohorted(course_key),
...@@ -382,7 +381,7 @@ def single_thread(request, course_key, discussion_id, thread_id): ...@@ -382,7 +381,7 @@ def single_thread(request, course_key, discussion_id, thread_id):
'user_cohort': user_cohort, 'user_cohort': user_cohort,
'sort_preference': cc_user.default_sort_key, 'sort_preference': cc_user.default_sort_key,
'category_map': course_settings["category_map"], 'category_map': course_settings["category_map"],
'course_settings': json.dumps(course_settings), 'course_settings': course_settings,
'disable_courseware_js': True, 'disable_courseware_js': True,
'uses_pattern_library': True, 'uses_pattern_library': True,
} }
...@@ -433,7 +432,7 @@ def user_profile(request, course_key, user_id): ...@@ -433,7 +432,7 @@ def user_profile(request, course_key, user_id):
'discussion_data': threads, 'discussion_data': threads,
'page': query_params['page'], 'page': query_params['page'],
'num_pages': query_params['num_pages'], 'num_pages': query_params['num_pages'],
'annotated_content_info': json.dumps(annotated_content_info), 'annotated_content_info': annotated_content_info,
}) })
else: else:
django_user = User.objects.get(id=user_id) django_user = User.objects.get(id=user_id)
...@@ -442,9 +441,9 @@ def user_profile(request, course_key, user_id): ...@@ -442,9 +441,9 @@ def user_profile(request, course_key, user_id):
'user': request.user, 'user': request.user,
'django_user': django_user, 'django_user': django_user,
'profiled_user': profiled_user.to_dict(), 'profiled_user': profiled_user.to_dict(),
'threads': json.dumps(threads), 'threads': threads,
'user_info': json.dumps(user_info, default=lambda x: None), 'user_info': user_info,
'annotated_content_info': json.dumps(annotated_content_info), 'annotated_content_info': annotated_content_info,
'page': query_params['page'], 'page': query_params['page'],
'num_pages': query_params['num_pages'], 'num_pages': query_params['num_pages'],
'learner_profile_page_url': reverse('learner_profile', kwargs={'username': django_user.username}), 'learner_profile_page_url': reverse('learner_profile', kwargs={'username': django_user.username}),
...@@ -452,7 +451,7 @@ def user_profile(request, course_key, user_id): ...@@ -452,7 +451,7 @@ def user_profile(request, course_key, user_id):
'uses_pattern_library': True, 'uses_pattern_library': True,
} }
return render_to_response('discussion/user_profile.html', context) return render_to_response('discussion/discussion_profile_page.html', context)
except User.DoesNotExist: except User.DoesNotExist:
raise Http404 raise Http404
...@@ -531,9 +530,9 @@ def followed_threads(request, course_key, user_id): ...@@ -531,9 +530,9 @@ def followed_threads(request, course_key, user_id):
'user': request.user, 'user': request.user,
'django_user': User.objects.get(id=user_id), 'django_user': User.objects.get(id=user_id),
'profiled_user': profiled_user.to_dict(), 'profiled_user': profiled_user.to_dict(),
'threads': json.dumps(paginated_results.collection), 'threads': paginated_results.collection,
'user_info': json.dumps(user_info), 'user_info': user_info,
'annotated_content_info': json.dumps(annotated_content_info), 'annotated_content_info': annotated_content_info,
# 'content': content, # 'content': content,
} }
......
...@@ -24,10 +24,10 @@ class GroupIdAssertionMixin(object): ...@@ -24,10 +24,10 @@ class GroupIdAssertionMixin(object):
def _assert_html_response_contains_group_info(self, response): def _assert_html_response_contains_group_info(self, response):
group_info = {"group_id": None, "group_name": None} group_info = {"group_id": None, "group_name": None}
match = re.search(r'&#34;group_id&#34;: ([\d]*)', response.content) match = re.search(r'"group_id": (\d*),', response.content)
if match and match.group(1) != '': if match and match.group(1) != '':
group_info["group_id"] = int(match.group(1)) group_info["group_id"] = int(match.group(1))
match = re.search(r'&#34;group_name&#34;: &#34;([^&]*)&#34;', response.content) match = re.search(r'"group_name": "(\w*)",', response.content)
if match: if match:
group_info["group_name"] = match.group(1) group_info["group_name"] = match.group(1)
self._assert_thread_contains_group_info(group_info) self._assert_thread_contains_group_info(group_info)
......
define([ define([
'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'teams/js/views/team_discussion', 'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/discussion_spec_helper',
'teams/js/spec_helpers/team_spec_helpers', 'teams/js/spec_helpers/team_spec_helpers',
'xmodule_js/common_static/common/js/spec_helpers/discussion_spec_helper' 'teams/js/views/team_discussion'
], function(_, AjaxHelpers, TeamDiscussionView, TeamSpecHelpers, DiscussionSpecHelper) { ], function(_, AjaxHelpers, DiscussionSpecHelper, TeamSpecHelpers, TeamDiscussionView) {
'use strict'; 'use strict';
xdescribe('TeamDiscussionView', function() { xdescribe('TeamDiscussionView', function() {
var discussionView, createDiscussionView, createPost, expandReplies, postReply; var discussionView, createDiscussionView, createPost, expandReplies, postReply;
...@@ -115,7 +117,7 @@ define([ ...@@ -115,7 +117,7 @@ define([
body: reply, body: reply,
comments_count: 1 comments_count: 1
}), }),
'annotated_content_info': TeamSpecHelpers.createAnnotatedContentInfo() annotated_content_info: TeamSpecHelpers.createAnnotatedContentInfo()
}); });
}; };
...@@ -202,8 +204,7 @@ define([ ...@@ -202,8 +204,7 @@ define([
it('cannot move a new thread to a different topic', function() { it('cannot move a new thread to a different topic', function() {
var requests = AjaxHelpers.requests(this), var requests = AjaxHelpers.requests(this),
view = createDiscussionView(requests), view = createDiscussionView(requests);
postTopicButton;
createPost(requests, view); createPost(requests, view);
expandReplies(requests, view); expandReplies(requests, view);
view.$('.action-more .icon').first().click(); view.$('.action-more .icon').first().click();
......
define([ define([
'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'teams/js/models/team', 'underscore',
'teams/js/views/team_profile', 'teams/js/spec_helpers/team_spec_helpers', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'xmodule_js/common_static/common/js/spec_helpers/discussion_spec_helper' 'common/js/spec_helpers/discussion_spec_helper',
], function(_, AjaxHelpers, TeamModel, TeamProfileView, TeamSpecHelpers, DiscussionSpecHelper) { 'teams/js/spec_helpers/team_spec_helpers',
'teams/js/models/team',
'teams/js/views/team_profile'
], function(_, AjaxHelpers, DiscussionSpecHelper, TeamSpecHelpers, TeamModel, TeamProfileView) {
'use strict'; 'use strict';
describe('TeamProfileView', function() { describe('TeamProfileView', function() {
var profileView, createTeamProfileView, createTeamModelData, clickLeaveTeam, var profileView, createTeamProfileView, createTeamModelData, clickLeaveTeam,
...@@ -10,11 +13,11 @@ define([ ...@@ -10,11 +13,11 @@ define([
leaveTeamLinkSelector = '.leave-team-link', leaveTeamLinkSelector = '.leave-team-link',
DEFAULT_MEMBERSHIP = [ DEFAULT_MEMBERSHIP = [
{ {
'user': { user: {
'username': TeamSpecHelpers.testUser, username: TeamSpecHelpers.testUser,
'profile_image': { profile_image: {
'has_image': true, has_image: true,
'image_url_medium': '/image-url' image_url_medium: '/image-url'
} }
} }
} }
...@@ -198,7 +201,7 @@ define([ ...@@ -198,7 +201,7 @@ define([
it('shows correct error messages', function() { it('shows correct error messages', function() {
var requests = AjaxHelpers.requests(this); var requests = AjaxHelpers.requests(this);
var verifyErrorMessage = function(requests, errorMessage, expectedMessage) { var verifyErrorMessage = function(errorMessage, expectedMessage) {
var view = createTeamProfileView( var view = createTeamProfileView(
requests, {country: 'US', language: 'en', membership: DEFAULT_MEMBERSHIP} requests, {country: 'US', language: 'en', membership: DEFAULT_MEMBERSHIP}
); );
...@@ -212,22 +215,19 @@ define([ ...@@ -212,22 +215,19 @@ define([
// verify user_message // verify user_message
verifyErrorMessage( verifyErrorMessage(
requests, JSON.stringify({user_message: "can't remove user from team"}),
JSON.stringify({'user_message': "can't remove user from team"}),
"can't remove user from team" "can't remove user from team"
); );
// verify generic error message // verify generic error message
verifyErrorMessage( verifyErrorMessage(
requests,
'', '',
'An error occurred. Try again.' 'An error occurred. Try again.'
); );
// verify error message when json parsing succeeded but error message format is incorrect // verify error message when json parsing succeeded but error message format is incorrect
verifyErrorMessage( verifyErrorMessage(
requests, JSON.stringify({blah: "can't remove user from team"}),
JSON.stringify({'blah': "can't remove user from team"}),
'An error occurred. Try again.' 'An error occurred. Try again.'
); );
}); });
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
(function(define) { (function(define) {
'use strict'; 'use strict';
define(['backbone', 'underscore', 'gettext', 'DiscussionModuleView'], define(['backbone', 'underscore', 'gettext', 'common/js/discussion/discussion_module_view'],
function(Backbone, _, gettext, DiscussionModuleView) { function(Backbone, _, gettext, DiscussionModuleView) {
var TeamDiscussionView = Backbone.View.extend({ var TeamDiscussionView = Backbone.View.extend({
initialize: function() { initialize: function() {
......
...@@ -32,10 +32,6 @@ from openedx.core.djangolib.js_utils import ( ...@@ -32,10 +32,6 @@ from openedx.core.djangolib.js_utils import (
<%block name="js_extra"> <%block name="js_extra">
<%include file="../discussion/_js_body_dependencies.html" /> <%include file="../discussion/_js_body_dependencies.html" />
<%static:js group='discussion'/>
<script type="text/javascript">
RequireJS.define('DiscussionModuleView', [], function() {return window['DiscussionModuleView'];});
</script>
<%static:require_module module_name="teams/js/teams_tab_factory" class_name="TeamsTabFactory"> <%static:require_module module_name="teams/js/teams_tab_factory" class_name="TeamsTabFactory">
TeamsTabFactory({ TeamsTabFactory({
......
../djangoapps/discussion/static/discussion
\ No newline at end of file
...@@ -20,7 +20,7 @@ define(['jquery', 'logger', 'js/courseware/courseware_factory'], function($, Log ...@@ -20,7 +20,7 @@ define(['jquery', 'logger', 'js/courseware/courseware_factory'], function($, Log
$('.internal-link').click(); $('.internal-link').click();
expect(Logger.log).toHaveBeenCalledWith('edx.ui.lms.link_clicked', { expect(Logger.log).toHaveBeenCalledWith('edx.ui.lms.link_clicked', {
target_url: 'http://' + window.location.host + '/some/internal/link', target_url: 'http://' + window.location.host + '/some/internal/link',
current_url: 'http://' + window.location.host + '/context.html' current_url: window.location.toString()
}); });
}); });
......
...@@ -12,11 +12,11 @@ var options = { ...@@ -12,11 +12,11 @@ var options = {
// Avoid adding files to this list. Use RequireJS. // Avoid adding files to this list. Use RequireJS.
libraryFilesToInclude: [ libraryFilesToInclude: [
{pattern: 'common/js/vendor/jquery.js', included: true}, {pattern: '../../common/static/common/js/vendor/jquery.js', included: true},
{pattern: 'common/js/vendor/jquery-migrate.js', included: true}, {pattern: '../../common/static/common/js/vendor/jquery-migrate.js', included: true},
{pattern: 'xmodule_js/common_static/js/vendor/jquery.event.drag-2.2.js', included: true}, {pattern: '../../common/static/js/vendor/jquery.event.drag-2.2.js', included: true},
{pattern: 'xmodule_js/common_static/js/vendor/slick.core.js', included: true}, {pattern: '../../common/static/js/vendor/slick.core.js', included: true},
{pattern: 'xmodule_js/common_static/js/vendor/slick.grid.js', included: true} {pattern: '../../common/static/js/vendor/slick.grid.js', included: true}
], ],
libraryFiles: [ libraryFiles: [
...@@ -27,6 +27,7 @@ var options = { ...@@ -27,6 +27,7 @@ var options = {
// Otherwise Istanbul which is used for coverage tracking will cause tests to not run. // Otherwise Istanbul which is used for coverage tracking will cause tests to not run.
sourceFiles: [ sourceFiles: [
{pattern: 'coffee/src/**/!(*spec).js'}, {pattern: 'coffee/src/**/!(*spec).js'},
{pattern: 'discussion/js/**/!(*spec).js'},
{pattern: 'js/**/!(*spec|djangojs).js'}, {pattern: 'js/**/!(*spec|djangojs).js'},
{pattern: 'lms/js/**/!(*spec).js'}, {pattern: 'lms/js/**/!(*spec).js'},
{pattern: 'support/js/**/!(*spec).js'}, {pattern: 'support/js/**/!(*spec).js'},
...@@ -34,19 +35,13 @@ var options = { ...@@ -34,19 +35,13 @@ var options = {
], ],
specFiles: [ specFiles: [
{pattern: 'js/spec/**/*spec.js'}, {pattern: '../**/*spec.js'}
{pattern: 'lms/js/spec/**/*spec.js'},
{pattern: 'support/js/spec/**/*spec.js'},
{pattern: 'teams/js/spec/**/*spec.js'},
{pattern: 'xmodule_js/common_static/coffee/spec/**/*.js'}
], ],
fixtureFiles: [ fixtureFiles: [
{pattern: 'js/fixtures/**/*.html'}, {pattern: '../**/fixtures/**/*.html'},
{pattern: 'lms/fixtures/**/*.html'}, {pattern: '../**/templates/**/*.html'},
{pattern: 'support/templates/**/*.*'}, {pattern: '../**/*.underscore'}
{pattern: 'teams/templates/**/*.*'},
{pattern: 'templates/**/*.*'}
], ],
runFiles: [ runFiles: [
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
modules: getModulesList([ modules: getModulesList([
'discussion/js/discussion_board_factory', 'discussion/js/discussion_board_factory',
'discussion/js/discussion_profile_page_factory',
'js/api_admin/catalog_preview_factory', 'js/api_admin/catalog_preview_factory',
'js/courseware/courseware_factory', 'js/courseware/courseware_factory',
'js/discovery/discovery_factory', 'js/discovery/discovery_factory',
...@@ -77,7 +78,7 @@ ...@@ -77,7 +78,7 @@
'logger': 'empty:', 'logger': 'empty:',
'utility': 'empty:', 'utility': 'empty:',
'URI': 'empty:', 'URI': 'empty:',
'DiscussionModuleView': 'empty:', 'common/js/discussion/discussion_module_view': 'empty:',
'modernizr': 'empty', 'modernizr': 'empty',
// Don't bundle UI Toolkit helpers as they are loaded into the "edx" namespace // Don't bundle UI Toolkit helpers as they are loaded into the "edx" namespace
......
...@@ -21,8 +21,8 @@ $static-path: '../..' !default; ...@@ -21,8 +21,8 @@ $static-path: '../..' !default;
@import '../shared-v2/help-tab'; @import '../shared-v2/help-tab';
// Compatibility support for non-Pattern Library mixins and extensions // Compatibility support for non-Pattern Library mixins and extensions
@import 'utilities/v1-compatibility';
@import 'utilities/variables-v2'; @import 'utilities/variables-v2';
@import 'utilities/v1-compatibility';
// Discussion styling // Discussion styling
@import 'mixins'; @import 'mixins';
......
...@@ -10,7 +10,7 @@ body.discussion { ...@@ -10,7 +10,7 @@ body.discussion {
width: 100%; width: 100%;
h1 { h1 {
font-size: 20px; font-size: $forum-x-large-font-size;
} }
.form-row { .form-row {
...@@ -19,13 +19,13 @@ body.discussion { ...@@ -19,13 +19,13 @@ body.discussion {
.post-cancel { .post-cancel {
@include white-button; @include white-button;
float: left; @include float(left);
margin: ($baseline/2) 0 0 ($baseline*0.75); margin: ($baseline/2) 0 0 ($baseline*0.75);
} }
.post-update { .post-update {
@include blue-button; @include blue-button;
float: left; @include float(left);
margin-top: ($baseline/2); margin-top: ($baseline/2);
padding-bottom: ($baseline/10); padding-bottom: ($baseline/10);
height: 37px; height: 37px;
...@@ -38,19 +38,19 @@ body.discussion { ...@@ -38,19 +38,19 @@ body.discussion {
.edit-post-title { .edit-post-title {
box-sizing: border-box; box-sizing: border-box;
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
border-radius: 3px; border-radius: $forum-border-radius;
padding: 0 ($baseline/2); padding: 0 ($baseline/2);
width: 100%; width: 100%;
height: 40px; height: 40px;
box-shadow: 0 1px 3px $shadow-l1 inset; box-shadow: 0 1px 3px $shadow-l1 inset;
color: $dark-gray; color: $dark-gray;
font-size: 16px; font-size: $forum-large-font-size;
font-family: $sans-serif; font-family: $sans-serif;
} }
} }
.comments .edit-post-form h1 { .comments .edit-post-form h1 {
@extend %t-title6; font-size: $forum-large-font-size;
} }
.thread-title { .thread-title {
...@@ -58,7 +58,7 @@ body.discussion { ...@@ -58,7 +58,7 @@ body.discussion {
margin-bottom: $baseline; margin-bottom: $baseline;
color: $gray-d3; color: $gray-d3;
font-weight: 700; font-weight: 700;
font-size: 21px; font-size: $forum-x-large-font-size;
} }
.wmd-panel { .wmd-panel {
...@@ -71,13 +71,13 @@ body.discussion { ...@@ -71,13 +71,13 @@ body.discussion {
} }
.wmd-input { .wmd-input {
@include border-radius(3px, 3px, 0, 0); @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
width: 100%; width: 100%;
height: 150px; height: 150px;
background-color: $gray-l4; background-color: $gray-l4;
font-style: normal; font-style: normal;
font-size: 0.8em; font-size: $forum-base-font-size;
font-family: $f-sans-serif; font-family: $f-sans-serif;
line-height: 1.6em; line-height: 1.6em;
...@@ -149,22 +149,22 @@ body.discussion { ...@@ -149,22 +149,22 @@ body.discussion {
padding: $baseline; padding: $baseline;
> div { > div {
font-size: 0.8em; font-size: $forum-base-font-size;
font-family: $sans-serif; font-family: $sans-serif;
} }
b { b {
font-size: 16px; font-size: $forum-large-font-size;
} }
> form > input[type="text"] { > form > input[type="text"] {
border-radius: 3px; border-radius: $forum-border-radius;
color: $gray-d3; color: $gray-d3;
} }
> form > input[type="button"] { > form > input[type="button"] {
border: 1px solid #888; border: 1px solid #888;
font-size: 14px; font-size: $forum-base-font-size;
font-family: $sans-serif; font-family: $sans-serif;
} }
...@@ -184,7 +184,7 @@ body.discussion { ...@@ -184,7 +184,7 @@ body.discussion {
.bottom-post-status { .bottom-post-status {
padding: 30px; padding: 30px;
font-size: 20px; font-size: $forum-x-large-font-size;
font-weight: 700; font-weight: 700;
color: $gray-l3; color: $gray-l3;
text-align: center; text-align: center;
...@@ -192,7 +192,6 @@ body.discussion { ...@@ -192,7 +192,6 @@ body.discussion {
.discussion-article { .discussion-article {
position: relative; position: relative;
min-height: 500px;
a { a {
word-wrap: break-word; word-wrap: break-word;
...@@ -210,9 +209,9 @@ body.discussion { ...@@ -210,9 +209,9 @@ body.discussion {
blockquote { blockquote {
background: $gray-l5; background: $gray-l5;
border-radius: 3px; border-radius: $forum-border-radius;
padding: ($baseline/4) ($baseline/2); padding: ($baseline/4) ($baseline/2);
font-size: 14px; font-size: $forum-base-font-size;
} }
.comment-form { .comment-form {
...@@ -237,7 +236,7 @@ body.discussion { ...@@ -237,7 +236,7 @@ body.discussion {
padding: 0 ($baseline/2); padding: 0 ($baseline/2);
box-sizing: border-box; box-sizing: border-box;
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
border-radius: 3px; border-radius: $forum-border-radius;
box-shadow: 0 1px 3px $shadow-l1 inset; box-shadow: 0 1px 3px $shadow-l1 inset;
@include transition(border-color .1s linear 0s); @include transition(border-color .1s linear 0s);
...@@ -257,7 +256,7 @@ body.discussion { ...@@ -257,7 +256,7 @@ body.discussion {
padding: 0 ($baseline/2); padding: 0 ($baseline/2);
h4 { h4 {
font-size: 16px; font-size: $forum-large-font-size;
font-weight: 700; font-weight: 700;
} }
} }
...@@ -298,7 +297,7 @@ body.discussion { ...@@ -298,7 +297,7 @@ body.discussion {
// ==================== // ====================
// inline discussion module and profile thread styling // inline discussion module
.discussion-module { .discussion-module {
@extend .discussion-body; @extend .discussion-body;
...@@ -306,11 +305,11 @@ body.discussion { ...@@ -306,11 +305,11 @@ body.discussion {
margin: $baseline 0; margin: $baseline 0;
padding: $baseline; padding: $baseline;
background: #f6f6f6 !important; background: #f6f6f6 !important;
border-radius: 3px; border-radius: $forum-border-radius;
header { header {
.anonymous{ .anonymous{
font-size: 15px; font-size: $forum-base-font-size;
} }
} }
...@@ -328,129 +327,94 @@ body.discussion { ...@@ -328,129 +327,94 @@ body.discussion {
.loading-animation { .loading-animation {
background-image: url('#{$static-path}/images/spinner.gif'); background-image: url('#{$static-path}/images/spinner.gif');
} }
}
.discussion-show { .discussion-show {
position: relative; position: relative;
top: 3px; top: 3px;
font-size: 14px; font-size: $forum-base-font-size;
text-align: center; text-align: center;
&.shown {
.show-hide-discussion-icon {
background-position: 0 0;
}
}
&.shown {
.show-hide-discussion-icon { .show-hide-discussion-icon {
display: inline-block; background-position: 0 0;
position: relative;
top: 5px;
@include margin-right(6px);
width: 21px;
height: 19px;
background: url('#{$static-path}/images/show-hide-discussion-icon.png') no-repeat;
background-position: -21px 0;
} }
} }
section.discussion { .show-hide-discussion-icon {
clear: both; display: inline-block;
padding-top: $baseline; position: relative;
top: 5px;
.threads { @include margin-right(6px);
} width: 21px;
height: 19px;
background: url('#{$static-path}/images/show-hide-discussion-icon.png') no-repeat;
background-position: -21px 0;
} }
}
.new-post-article { section.discussion {
display: none; @include clearfix();
margin-top: $baseline; }
.inner-wrapper { .new-post-article {
max-width: 1180px; display: none;
min-width: 760px; margin-top: $baseline;
margin: auto;
}
.thread-title { .inner-wrapper {
display: block; max-width: 1180px;
margin-bottom: $baseline; min-width: 760px;
font-size: 21px; margin: auto;
color: $gray-d3;
font-weight: 700;
}
} }
section.discussion-pagination { .thread-title {
margin-top: ($baseline*1.5); display: block;
margin-bottom: $baseline;
nav.discussion-paginator { font-size: $forum-x-large-font-size;
float: right; color: $gray-d3;
font-weight: 700;
ol {
li {
list-style: none;
display: inline-block;
padding-right: 0.5em;
a {
@include white-button;
}
&.current-page span {
display: inline-block;
height: 35px;
padding: 0 ($baseline*0.75);
border: 1px solid $forum-color-border;
border-radius: 3px;
font-size: 13px;
font-weight: 700;
line-height: 32px;
color: $gray-d3;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
}
}
}
} }
}
.edit-post-form { .edit-post-form {
width: 100%; @include clearfix();
margin-bottom: $baseline; width: 100%;
@include clearfix(); margin-bottom: $baseline;
box-sizing: border-box; box-sizing: border-box;
.form-row { .form-row {
margin-top: $baseline; margin-top: $baseline;
} }
.post-cancel { .post-cancel {
@include white-button; @include white-button;
float: left; @include float(left);
margin: ($baseline/2) 0 0 ($baseline*0.75); @include margin($baseline/2, 0, 0, $baseline*0.75);
} }
.post-update { .post-update {
@include blue-button; @include blue-button;
float: left; @include float(left);
height: 37px; height: 37px;
margin-top: ($baseline/2); margin-top: ($baseline/2);
padding-bottom: 2px; padding-bottom: 2px;
&:hover, &:focus { &:hover, &:focus {
border-color: #222; border-color: #222;
}
} }
}
.edit-post-title { .edit-post-title {
width: 100%; width: 100%;
height: 40px; height: 40px;
padding: 0 ($baseline/2); padding: 0 ($baseline/2);
box-sizing: border-box; box-sizing: border-box;
border-radius: 3px; border-radius: $forum-border-radius;
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
font-size: 16px; font-size: $forum-large-font-size;
font-family: $sans-serif; font-family: $sans-serif;
color: $gray-d3; color: $gray-d3;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
}
} }
} }
...@@ -461,6 +425,37 @@ body.discussion { ...@@ -461,6 +425,37 @@ body.discussion {
// ==================== // ====================
// post pagination // post pagination
section.discussion-pagination {
margin-top: ($baseline*1.5);
nav.discussion-paginator {
@include float(right);
ol {
li {
list-style: none;
display: inline-block;
padding-right: 0.5em;
a {
@include white-button;
}
&.current-page span {
display: inline-block;
height: 35px;
padding: 0 ($baseline*0.75);
border: 1px solid $forum-color-border;
border-radius: $forum-border-radius;
font-size: $forum-base-font-size;
font-weight: 700;
line-height: 32px;
color: $gray-d3;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
}
}
}
}
.response-count { .response-count {
@include float(right); @include float(right);
} }
...@@ -477,7 +472,7 @@ body.discussion { ...@@ -477,7 +472,7 @@ body.discussion {
display: block; display: block;
padding: ($baseline/2) 0; padding: ($baseline/2) 0;
color: $gray; color: $gray;
font-size: 14px; font-size: $forum-base-font-size;
} }
.load-response-button { .load-response-button {
......
// Layouts for discussion pages // Layouts for discussion pages
section.user-profile { .user-profile {
background-color: $sidebar-color; background-color: $sidebar-color;
.user-profile { .user-profile {
padding: 32px 36px; padding: $baseline;
min-height: 500px; min-height: 500px;
} }
.sidebar-username { .sidebar-username {
font-weight: 700; font-weight: 700;
font-size: 18px; font-size: $forum-large-font-size;
} }
.sidebar-user-roles { .sidebar-user-roles {
margin-top: 6px; margin-top: $baseline/2;
font-style: italic; font-style: italic;
font-size: 13px; font-size: $forum-base-font-size;
} }
.sidebar-threads-count { .sidebar-threads-count {
margin-top: 14px; margin-top: $baseline/2;
} }
.sidebar-threads-count span, .sidebar-threads-count span,
...@@ -30,11 +30,5 @@ section.user-profile { ...@@ -30,11 +30,5 @@ section.user-profile {
} }
.discussion-column { .discussion-column {
@include float(right);
box-sizing: border-box;
padding-left: ($baseline/2);
width: 68%;
max-width: 800px;
min-height: 500px; min-height: 500px;
border-radius: 3px;
} }
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
@mixin discussion-button() { @mixin discussion-button() {
display: block; display: block;
border: 1px solid; border: 1px solid;
border-radius: 3px; border-radius: $forum-border-radius;
height: 35px; height: 35px;
color: $white;
line-height: 35px; line-height: 35px;
font-size: 13px; font-size: $forum-base-font-size;
white-space: nowrap; // Prevent word-break in Arabic in Google Chrome white-space: nowrap; // Prevent word-break in Arabic in Google Chrome
text-shadow: none; text-shadow: none;
padding: 0 ($baseline*0.75); padding: 0 ($baseline*0.75);
...@@ -52,20 +53,20 @@ ...@@ -52,20 +53,20 @@
box-sizing: border-box; box-sizing: border-box;
margin-top: 0; margin-top: 0;
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
border-radius: 3px 3px 0 0; border-radius: $forum-border-radius $forum-border-radius 0 0;
padding: ($baseline/2); padding: ($baseline/2);
width: 100%; width: 100%;
height: 125px; height: 125px;
background: $forum-color-background; background: $forum-color-background;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
font-size: 13px; font-size: $forum-base-font-size;
font-family: $sans-serif; font-family: $sans-serif;
line-height: 1.6; line-height: 1.6;
} }
@mixin discussion-wmd-preview-container { @mixin discussion-wmd-preview-container {
box-sizing: border-box; box-sizing: border-box;
@include border-radius(0, 0, 3px, 3px); @include border-radius(0, 0, $forum-border-radius, $forum-border-radius);
border: 1px solid $gray-l1; border: 1px solid $gray-l1;
border-top: none; border-top: none;
width: 100%; width: 100%;
...@@ -84,7 +85,7 @@ ...@@ -84,7 +85,7 @@
padding-top: 3px; padding-top: 3px;
width: 100%; width: 100%;
color: $gray-l2; color: $gray-l2;
font-size: 11px; font-size: $forum-small-font-size;
} }
@mixin discussion-wmd-preview { @mixin discussion-wmd-preview {
...@@ -113,11 +114,11 @@ ...@@ -113,11 +114,11 @@
@mixin forum-post-label($color) { @mixin forum-post-label($color) {
@extend %t-weight4; @extend %t-weight4;
@include font-size(9); font-size: $forum-small-font-size;
display: inline; display: inline;
margin-top: ($baseline/4); margin-top: ($baseline/4);
border: 1px solid; border: 1px solid;
border-radius: 3px; border-radius: $forum-border-radius;
padding: 1px 6px; padding: 1px 6px;
white-space: nowrap; white-space: nowrap;
...@@ -138,11 +139,11 @@ ...@@ -138,11 +139,11 @@
} }
@mixin forum-user-label($color) { @mixin forum-user-label($color) {
@include font-size(9); @include margin-left($baseline/4);
@extend %t-weight5; @extend %t-weight5;
font-size: $forum-small-font-size;
vertical-align: middle; vertical-align: middle;
margin-left: ($baseline/4); border-radius: $forum-border-radius;
border-radius: 2px;
padding: 0 ($baseline/5); padding: 0 ($baseline/5);
background: $color; background: $color;
font-style: normal; font-style: normal;
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
box-shadow: 0 1px 1px $shadow-l1; box-shadow: 0 1px 1px $shadow-l1;
position: relative; position: relative;
width: 100%; width: 100%;
border-radius: 3px; border-radius: $forum-border-radius;
margin: ($baseline/4) 0 0 0; margin: ($baseline/4) 0 0 0;
border: 1px solid $gray-l3; border: 1px solid $gray-l3;
padding: ($baseline/2) ($baseline*0.75); padding: ($baseline/2) ($baseline*0.75);
...@@ -121,16 +121,16 @@ ...@@ -121,16 +121,16 @@
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: ($baseline/4); border-radius: $forum-border-radius;
color: $gray-l1; color: $gray-l1;
.action-icon { .action-icon {
@extend %t-icon7;
display: inline-block; display: inline-block;
font-size: $forum-small-font-size;
height: $baseline; height: $baseline;
width: $baseline; width: $baseline;
border: 1px solid $gray-l3; border: 1px solid $forum-color-border;
border-radius: 3px; border-radius: $forum-border-radius;
text-align: center; text-align: center;
color: $gray-l1; color: $gray-l1;
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
} }
.action-icon { .action-icon {
border-radius: 0 3px 3px 0; border-radius: 0 $forum-border-radius $forum-border-radius 0;
} }
} }
...@@ -287,9 +287,9 @@ ...@@ -287,9 +287,9 @@
} }
.action-icon { .action-icon {
@include margin-left($baseline/4);
display: inline-block; display: inline-block;
width: ($baseline/2); width: ($baseline/2);
margin-left: ($baseline/4);
color: inherit; color: inherit;
} }
......
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
.wmd-input { .wmd-input {
width: 100%; width: 100%;
height: 150px; height: 150px;
border-radius: 3px 3px 0 0; border-radius: $forum-border-radius $forum-border-radius 0 0;
font-style: normal; font-style: normal;
font-size: 0.8em; font-size: $forum-base-font-size;
font-family: Monaco, 'Lucida Console', monospace; font-family: Monaco, 'Lucida Console', monospace;
line-height: 1.6em; line-height: 1.6em;
...@@ -75,9 +75,9 @@ ...@@ -75,9 +75,9 @@
} }
.wmd-spacer { .wmd-spacer {
@include margin-left(14px);
position: absolute; position: absolute;
display: inline-block; display: inline-block;
margin-left: 14px;
width: 1px; width: 1px;
height: 20px; height: 20px;
background-color: Silver; background-color: Silver;
...@@ -129,23 +129,23 @@ ...@@ -129,23 +129,23 @@
padding: $baseline; padding: $baseline;
> div { > div {
font-size: 0.8em; font-size: $forum-base-font-size;
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
} }
b { b {
font-size: 16px; font-size: $forum-large-font-size;
} }
> form > input[type="text"] { > form > input[type="text"] {
border-radius: 3px; border-radius: $forum-border-radius;
color: #333; color: #333;
} }
> form > input[type="button"] { > form > input[type="button"] {
border: 1px solid #888; border: 1px solid #888;
font-family: $sans-serif; font-family: $sans-serif;
font-size: 14px; font-size: $forum-x-large-font-size;
} }
> form > input[type="file"] { > form > input[type="file"] {
......
...@@ -2,12 +2,8 @@ ...@@ -2,12 +2,8 @@
// ==================== // ====================
.forum-nav { .forum-nav {
box-sizing: border-box;
@include float(left);
position: relative;
width: 31%;
border: 1px solid #aaa; border: 1px solid #aaa;
border-radius: 3px; border-radius: $forum-border-radius;
} }
// ------ // ------
...@@ -45,13 +41,13 @@ ...@@ -45,13 +41,13 @@
} }
.icon { .icon {
@include font-size(14);
@include margin-right($baseline/4); @include margin-right($baseline/4);
font-size: $forum-base-font-size;
} }
} }
.forum-nav-browse-current { .forum-nav-browse-current {
@include font-size(12); font-size: $forum-small-font-size;
} }
.forum-nav-browse-drop-arrow { .forum-nav-browse-drop-arrow {
...@@ -69,7 +65,7 @@ ...@@ -69,7 +65,7 @@
} }
.forum-nav-search .icon { .forum-nav-search .icon {
@include font-size(12); font-size: $forum-small-font-size;
position: absolute; position: absolute;
margin-top: -6px; margin-top: -6px;
top: 50%; top: 50%;
...@@ -95,7 +91,7 @@ ...@@ -95,7 +91,7 @@
} }
.forum-nav-browse-filter .icon { .forum-nav-browse-filter .icon {
@include font-size(12); font-size: $forum-small-font-size;
position: absolute; position: absolute;
margin-top: -6px; margin-top: -6px;
top: 50%; top: 50%;
...@@ -134,7 +130,7 @@ ...@@ -134,7 +130,7 @@
} }
.forum-nav-browse-menu { .forum-nav-browse-menu {
@include font-size(14); font-size: $forum-base-font-size;
overflow-y: scroll; overflow-y: scroll;
list-style: none; list-style: none;
} }
...@@ -156,7 +152,7 @@ ...@@ -156,7 +152,7 @@
// ------------------- // -------------------
.forum-nav-refine-bar { .forum-nav-refine-bar {
@include clearfix(); @include clearfix();
@include font-size(11); font-size: $forum-small-font-size;
border-bottom: 1px solid $forum-color-border; border-bottom: 1px solid $forum-color-border;
background-color: $gray-l5; background-color: $gray-l5;
padding: ($baseline/4) ($baseline/2); padding: ($baseline/4) ($baseline/2);
...@@ -284,7 +280,7 @@ ...@@ -284,7 +280,7 @@
width: 7%; width: 7%;
.icon { .icon {
@include font-size(14); font-size: $forum-base-font-size;
&:before { &:before {
...@@ -319,19 +315,19 @@ ...@@ -319,19 +315,19 @@
} }
.forum-nav-thread-title { .forum-nav-thread-title {
@extend %t-title7; font-size: $forum-base-font-size;
display: block; display: block;
} }
%forum-nav-thread-wrapper-2-content { %forum-nav-thread-wrapper-2-content {
@include font-size(11); @include margin-right($baseline/4);
font-size: $forum-small-font-size;
display: inline-block; display: inline-block;
margin-right: ($baseline/4);
text-align: center; text-align: center;
color: $black; color: $black;
&:last-child { &:last-child {
margin-right: 0; @include margin-right(0);
} }
} }
...@@ -345,7 +341,7 @@ ...@@ -345,7 +341,7 @@
position: relative; position: relative;
@include margin-left($baseline/4); @include margin-left($baseline/4);
margin-bottom: ($baseline/4); // Because tail is position: absolute margin-bottom: ($baseline/4); // Because tail is position: absolute
border-radius: 2px; border-radius: $forum-border-radius;
padding: ($baseline/10) ($baseline/5); padding: ($baseline/10) ($baseline/5);
min-width: 2em; // Fit most comment counts but allow expansion if necessary min-width: 2em; // Fit most comment counts but allow expansion if necessary
background-color: $gray-l4; background-color: $gray-l4;
......
...@@ -44,7 +44,7 @@ body.discussion { ...@@ -44,7 +44,7 @@ body.discussion {
// alert copy // alert copy
.message { .message {
@include font-size(12); font-size: $forum-small-font-size;
color: $white; color: $white;
em { em {
...@@ -66,11 +66,11 @@ body.discussion { ...@@ -66,11 +66,11 @@ body.discussion {
text-align: right; text-align: right;
.control { .control {
@include font-size(14);
@include transition(none); @include transition(none);
@extend %t-weight5; @extend %t-weight5;
padding: ($baseline/4) ($baseline/2); padding: ($baseline/4) ($baseline/2);
color: $white; color: $white;
font-size: $forum-base-font-size;
// reseting poorly globally scoped hover/focus state for this control // reseting poorly globally scoped hover/focus state for this control
&:hover, &:focus { &:hover, &:focus {
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
// Override global input rules // Override global input rules
.forum-nav-search-input { .forum-nav-search-input {
@include padding-left($baseline/4 !important);
@include padding-right($baseline/2 + 12px !important); // Leave room for icon
box-shadow: none !important; box-shadow: none !important;
border: 1px solid $forum-color-border !important; border: 1px solid $forum-color-border !important;
border-radius: 3px !important; border-radius: $forum-border-radius !important;
height: auto !important; height: auto !important;
@include padding-left($baseline/4 !important); font-size: $forum-small-font-size !important;
@include padding-right($baseline/2 + 12px !important); // Leave room for icon
font-size: 12px !important;
} }
// Firefox does not compute the correct containing box for absolute positioning // Firefox does not compute the correct containing box for absolute positioning
...@@ -45,12 +45,12 @@ ...@@ -45,12 +45,12 @@
// Override global input rules // Override global input rules
.forum-nav-browse-filter-input { .forum-nav-browse-filter-input {
@include padding-left($baseline/4);
@include padding-right($baseline/2 + 12px); // Leave room for icon
box-shadow: none !important; box-shadow: none !important;
border-radius: 3px !important; border-radius: $forum-border-radius !important;
height: auto !important; height: auto !important;
padding-left: ($baseline/4) !important; font-size: $forum-small-font-size !important;
padding-right: ($baseline/2 + 12px) !important; // Leave room for icon
font-size: 12px !important;
} }
// Override global ul rules // Override global ul rules
......
...@@ -31,46 +31,6 @@ ...@@ -31,46 +31,6 @@
%ui-depth4 { z-index: 10000; } %ui-depth4 { z-index: 10000; }
%ui-depth5 { z-index: 100000; } %ui-depth5 { z-index: 100000; }
%t-icon1 {
@include font-size(48);
}
%t-icon2 {
@include font-size(36);
}
%t-icon3 {
@include font-size(24);
}
%t-icon4 {
@include font-size(18);
}
%t-icon5 {
@include font-size(16);
}
%t-icon6 {
@include font-size(14);
}
%t-icon7 {
@include font-size(12);
}
%t-icon8 {
@include font-size(11);
}
%t-icon9 {
@include font-size(10);
}
%t-icon-solo {
@include line-height(0);
}
// weights // weights
%t-ultrastrong { %t-ultrastrong {
font-weight: 700; font-weight: 700;
...@@ -91,97 +51,21 @@ ...@@ -91,97 +51,21 @@
font-weight: 200; font-weight: 200;
} }
// headings/titles
%t-title {
font-family: $f-sans-serif;
}
%t-title1 {
@extend %t-title;
@include font-size(60);
@include line-height(60);
}
%t-title2 {
@extend %t-title;
@include font-size(48);
@include line-height(48);
}
%t-title3 {
@include font-size(36);
@include line-height(36);
}
%t-title4 {
@extend %t-title;
@include font-size(24);
@include line-height(24);
}
%t-title5 {
@extend %t-title;
@include font-size(18);
@include line-height(18);
}
%t-title6 {
@extend %t-title;
@include font-size(16);
@include line-height(16);
}
%t-title7 {
@extend %t-title;
@include font-size(14);
@include line-height(14);
}
%t-title8 {
@extend %t-title;
@include font-size(12);
@include line-height(12);
}
%t-title9 {
@extend %t-title;
@include font-size(11);
@include line-height(11);
}
// copy // copy
%t-copy { %t-copy {
font-family: $f-sans-serif; font-family: $f-sans-serif;
} }
%t-copy-base {
@extend %t-copy;
@include font-size(16);
@include line-height(16);
}
%t-copy-lead1 {
@extend %t-copy;
@include font-size(18);
@include line-height(18);
}
%t-copy-lead2 {
@extend %t-copy;
@include font-size(24);
@include line-height(24);
}
%t-copy-sub1 { %t-copy-sub1 {
@extend %t-copy; @extend %t-copy;
@include font-size(14);
@include line-height(14); @include line-height(14);
font-size: $forum-base-font-size;
} }
%t-copy-sub2 { %t-copy-sub2 {
@extend %t-copy; @extend %t-copy;
@include font-size(12);
@include line-height(12); @include line-height(12);
font-size: $forum-small-font-size;
} }
// extends - UI - removes list styling/spacing when using uls, ols for navigation and less content-centric cases // extends - UI - removes list styling/spacing when using uls, ols for navigation and less content-centric cases
......
...@@ -21,3 +21,12 @@ $forum-color-reading-thread: $gray-d3 !default; ...@@ -21,3 +21,12 @@ $forum-color-reading-thread: $gray-d3 !default;
$post-image-dimension: ($baseline*3) !default; // image size + margin $post-image-dimension: ($baseline*3) !default; // image size + margin
$response-image-dimension: ($baseline*2.5) !default; // image size + margin $response-image-dimension: ($baseline*2.5) !default; // image size + margin
$comment-image-dimension: ($baseline*2) !default; // image size + margin $comment-image-dimension: ($baseline*2) !default; // image size + margin
// font sizes
$forum-base-font-size: 14px;
$forum-x-large-font-size: 21px;
$forum-large-font-size: 16px;
$forum-small-font-size: 12px;
// borders
$forum-border-radius: 3px;
...@@ -21,3 +21,12 @@ $forum-color-reading-thread: palette(grayscale, dark) !default; ...@@ -21,3 +21,12 @@ $forum-color-reading-thread: palette(grayscale, dark) !default;
$post-image-dimension: ($baseline*3) !default; // image size + margin $post-image-dimension: ($baseline*3) !default; // image size + margin
$response-image-dimension: ($baseline*2.5) !default; // image size + margin $response-image-dimension: ($baseline*2.5) !default; // image size + margin
$comment-image-dimension: ($baseline*2) !default; // image size + margin $comment-image-dimension: ($baseline*2) !default; // image size + margin
// font sizes
$forum-base-font-size: font-size(small);
$forum-x-large-font-size: font-size(x-large);
$forum-large-font-size: font-size(base);
$forum-small-font-size: font-size(x-small);
// borders
$forum-border-radius: $component-border-radius;
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@include clearfix(); @include clearfix();
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
border-radius: 3px; border-radius: $forum-border-radius;
padding: $baseline; padding: $baseline;
max-width: 1180px; max-width: 1180px;
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
display: inline-block; display: inline-block;
width: 25%; width: 25%;
vertical-align: top; vertical-align: top;
font-size: 12px; font-size: $forum-small-font-size;
line-height: 40px; line-height: 40px;
} }
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
display: inline-block; display: inline-block;
@include padding-left($baseline); @include padding-left($baseline);
width: 50%; width: 50%;
font-size: 12px; font-size: $forum-small-font-size;
} }
} }
...@@ -73,11 +74,11 @@ ...@@ -73,11 +74,11 @@
padding: 0 $baseline 0 ($baseline*0.75); padding: 0 $baseline 0 ($baseline*0.75);
width: 100%; width: 100%;
height: 40px; height: 40px;
font-size: 14px; font-size: $forum-base-font-size;
line-height: 36px; line-height: 36px;
.drop-arrow { .drop-arrow {
float: right; @include float(right);
color: #999; color: #999;
} }
} }
...@@ -89,7 +90,7 @@ ...@@ -89,7 +90,7 @@
.post-type-label { .post-type-label {
@extend %cont-truncated; @extend %cont-truncated;
@include white-button; @include white-button;
@include font-size(14); font-size: $forum-base-font-size;
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
padding: 0 ($baseline/2); padding: 0 ($baseline/2);
...@@ -101,7 +102,7 @@ ...@@ -101,7 +102,7 @@
line-height: 36px; line-height: 36px;
.icon { .icon {
margin-right: ($baseline/4); @include margin-right($baseline/4);
} }
} }
...@@ -119,13 +120,13 @@ ...@@ -119,13 +120,13 @@
input[type=text].field-input { input[type=text].field-input {
box-sizing: border-box; box-sizing: border-box;
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
border-radius: 3px; border-radius: $forum-border-radius;
padding: 0 $baseline/2; padding: 0 $baseline/2;
height: 40px; height: 40px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
color: #333; color: #333;
font-weight: 700; font-weight: 700;
font-size: 16px; font-size: $forum-large-font-size;
font-family: 'Open Sans', sans-serif; font-family: 'Open Sans', sans-serif;
} }
...@@ -134,7 +135,7 @@ ...@@ -134,7 +135,7 @@
display: inline-block; display: inline-block;
@include margin-right($baseline); @include margin-right($baseline);
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 3px; border-radius: $forum-border-radius;
padding: ($baseline/2); padding: ($baseline/2);
&:hover { &:hover {
...@@ -147,11 +148,11 @@ ...@@ -147,11 +148,11 @@
} }
.post-option-input { .post-option-input {
margin-right: ($baseline/2); @include margin-right($baseline/2);
} }
.icon { .icon {
margin-right: 0.5em; @include margin-right($baseline/2);
} }
} }
} }
...@@ -162,8 +163,8 @@ ...@@ -162,8 +163,8 @@
.forum-new-post-form { .forum-new-post-form {
.submit { .submit {
@include blue-button; @include blue-button;
@include margin-right($baseline/2);
display: inline-block; display: inline-block;
margin-right: ($baseline/2);
} }
.cancel { .cancel {
...@@ -179,7 +180,7 @@ ...@@ -179,7 +180,7 @@
.edit-post-form { .edit-post-form {
.post-errors { .post-errors {
margin-bottom: $baseline; margin-bottom: $baseline;
border-radius: 3px; border-radius: $forum-border-radius;
padding: 0; padding: 0;
background: $error-color; background: $error-color;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 rgba(255, 255, 255, .2); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 rgba(255, 255, 255, .2);
...@@ -230,7 +231,7 @@ ...@@ -230,7 +231,7 @@
width: 100%; width: 100%;
height: 30px; height: 30px;
color: #333; color: #333;
font-size: 11px; font-size: $forum-small-font-size;
line-height: 16px; line-height: 16px;
} }
...@@ -249,7 +250,7 @@ ...@@ -249,7 +250,7 @@
.topic-title { .topic-title {
display: block; display: block;
padding: ($baseline/4) ($baseline/2); padding: ($baseline/4) ($baseline/2);
font-size: 14px; font-size: $forum-base-font-size;
} }
a.topic-title { a.topic-title {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
} }
.home-title { .home-title {
@extend %t-title5; font-size: $forum-large-font-size;
color: $black; color: $black;
margin-bottom: ($baseline/4); margin-bottom: ($baseline/4);
} }
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
vertical-align: middle; vertical-align: middle;
.count { .count {
@extend %t-title4; font-size: $forum-x-large-font-size;
display: inline-block; display: inline-block;
padding: 0 ($baseline/2); padding: 0 ($baseline/2);
vertical-align: middle; vertical-align: middle;
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
.home-helpgrid { .home-helpgrid {
border-bottom: none; border-bottom: none;
border-radius: 3px; border-radius: $forum-border-radius;
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
box-shadow: 0 1px 3px rgba(0, 0, 0, .15); box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
} }
...@@ -84,11 +84,11 @@ ...@@ -84,11 +84,11 @@
.row-title { .row-title {
padding: ($baseline*1.5) $baseline; padding: ($baseline*1.5) $baseline;
background-color: #dedede; background-color: #dedede;
font-size: 12px; font-size: $forum-small-font-size;
} }
.row-item-full, .row-item { .row-item-full, .row-item {
font-size: 12px; font-size: $forum-small-font-size;
padding: 0 ($baseline/2); padding: 0 ($baseline/2);
width: 26%; width: 26%;
vertical-align: middle; vertical-align: middle;
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
@include margin-right($baseline/2); @include margin-right($baseline/2);
display: inline-block; display: inline-block;
@include padding($baseline/4, 0, $baseline/2, 0); @include padding($baseline/4, 0, $baseline/2, 0);
border-radius: 5px; border-radius: $forum-border-radius;
border: 1px solid gray; border: 1px solid gray;
.email-setting { .email-setting {
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
position: relative; position: relative;
margin: $baseline 0; margin: $baseline 0;
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
border-radius: 3px; border-radius: $forum-border-radius;
box-shadow: 0 0 1px $shadow; box-shadow: 0 0 1px $shadow;
} }
// wrapper - main response area // wrapper - main response area
.discussion-response { .discussion-response {
box-sizing: border-box; box-sizing: border-box;
@include border-radius(3px, 3px, 0, 0); @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
padding: $baseline; padding: $baseline;
background-color: $forum-color-background; background-color: $forum-color-background;
} }
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
// CASE: larger username for responses // CASE: larger username for responses
.username { .username {
@include font-size(14);
@extend %t-weight5; @extend %t-weight5;
font-size: $forum-base-font-size;
} }
} }
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
// +CASE: answered question - collapsed comments in answers // +CASE: answered question - collapsed comments in answers
.forum-response .action-show-comments { .forum-response .action-show-comments {
@include font-size(13); font-size: $forum-base-font-size;
box-sizing: border-box; box-sizing: border-box;
display: block; display: block;
padding: ($baseline/2) $baseline; padding: ($baseline/2) $baseline;
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
// CASE: banner - staff response // CASE: banner - staff response
.staff-banner { .staff-banner {
@include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
...@@ -102,9 +103,8 @@ ...@@ -102,9 +103,8 @@
height: 14px; height: 14px;
padding: 1px ($baseline/4); padding: 1px ($baseline/4);
box-sizing: border-box; box-sizing: border-box;
border-radius: 2px 2px 0 0;
background: #009fe2; background: #009fe2;
font-size: 9px; font-size: $forum-small-font-size;
font-weight: 700; font-weight: 700;
color: $white; color: $white;
} }
...@@ -118,9 +118,9 @@ ...@@ -118,9 +118,9 @@
height: 14px; height: 14px;
padding: 1px ($baseline/4); padding: 1px ($baseline/4);
box-sizing: border-box; box-sizing: border-box;
border-radius: 2px 2px 0 0; border-radius: $forum-border-radius $forum-border-radius 0 0;
background: $forum-color-community-ta; background: $forum-color-community-ta;
font-size: 9px; font-size: $forum-small-font-size;
font-weight: 700; font-weight: 700;
color: $white; color: $white;
} }
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
// +comments styling // +comments styling
.container .discussion-body .comments { .container .discussion-body .comments {
@extend %ui-no-list; @extend %ui-no-list;
border-radius: 0 0 3px 3px; border-radius: 0 0 $forum-border-radius $forum-border-radius;
background: $gray-l6; background: $gray-l6;
box-shadow: 0 1px 3px -1px $shadow inset; box-shadow: 0 1px 3px -1px $shadow inset;
...@@ -149,9 +149,9 @@ ...@@ -149,9 +149,9 @@
blockquote { blockquote {
background: $gray-l4; background: $gray-l4;
border-radius: 3px; border-radius: $forum-border-radius;
padding: ($baseline/4) ($baseline/2); padding: ($baseline/4) ($baseline/2);
font-size: 14px; font-size: $forum-base-font-size;
} }
.comment-form { .comment-form {
...@@ -160,12 +160,12 @@ ...@@ -160,12 +160,12 @@
.comment-form-input { .comment-form-input {
padding: ($baseline/4) ($baseline/2); padding: ($baseline/4) ($baseline/2);
background-color: $forum-color-background; background-color: $forum-color-background;
font-size: 14px; font-size: $forum-base-font-size;
} }
.discussion-submit-comment { .discussion-submit-comment {
@include blue-button; @include blue-button;
float: left; @include float(left);
margin-top: 8px; margin-top: 8px;
} }
......
...@@ -127,7 +127,7 @@ body.discussion { ...@@ -127,7 +127,7 @@ body.discussion {
} }
img { img {
border-radius: 3px; border-radius: $forum-border-radius;
} }
} }
} }
...@@ -138,21 +138,17 @@ body.discussion { ...@@ -138,21 +138,17 @@ body.discussion {
} }
// +post - individual element styling // +post - individual element styling
body.discussion .discussion-post, // NOTE: discussion-article is used for inline discussion modules.
body.discussion .discussion-article, .discussion-post,
body.view-in-course .discussion-post, .discussion-article {
body.view-in-course .discussion-article {
// NOTE: discussion-article is used for inline discussion modules.
@include clearfix(); @include clearfix();
.post-header-content { .post-header-content {
// post title // post title
.post-title { .post-title {
@extend %t-title4; font-size: $forum-x-large-font-size;
@extend %t-ultrastrong;
margin-bottom: ($baseline/4); margin-bottom: ($baseline/4);
letter-spacing: 0;
} }
} }
...@@ -211,14 +207,14 @@ body.view-in-course .discussion-article { ...@@ -211,14 +207,14 @@ body.view-in-course .discussion-article {
.discussion-article { .discussion-article {
@include transition(all .2s linear 0s); @include transition(all .2s linear 0s);
border: 1px solid $forum-color-border; border: 1px solid $forum-color-border;
border-radius: 3px; border-radius: $forum-border-radius;
min-height: 0; min-height: 0;
background: $forum-color-background; background: $forum-color-background;
box-shadow: 0 1px 0 $shadow; box-shadow: 0 1px 0 $shadow;
@include transition(all .2s linear 0s); @include transition(all .2s linear 0s);
.thread-wrapper { .thread-wrapper {
@include border-radius(3px, 3px, 0, 0); @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
...@@ -228,16 +224,16 @@ body.view-in-course .discussion-article { ...@@ -228,16 +224,16 @@ body.view-in-course .discussion-article {
.discussion-post { .discussion-post {
.inline-comment-count { .inline-comment-count {
@include margin-right($baseline/2);
@extend %ui-depth2; @extend %ui-depth2;
@include float(right);
position: relative; position: relative;
float: right;
display: block; display: block;
height: 27px; height: 27px;
margin-top: 6px; margin-top: 6px;
margin-right: 8px;
padding: 0 8px; padding: 0 8px;
border-radius: ($baseline/4); border-radius: $forum-border-radius;
font-size: 12px; font-size: $forum-small-font-size;
font-weight: 400; font-weight: 400;
line-height: 25px; line-height: 25px;
color: #888; color: #888;
...@@ -250,15 +246,15 @@ body.view-in-course .discussion-article { ...@@ -250,15 +246,15 @@ body.view-in-course .discussion-article {
margin-bottom: ($baseline*0.75); margin-bottom: ($baseline*0.75);
.posted-by { .posted-by {
float: left; @include margin-right($baseline/4);
margin-right: ($baseline/4); @include float(left);
font-size: 16px; font-size: $forum-large-font-size;
} }
} }
.response-body { .response-body {
margin-bottom: 0.2em; margin-bottom: 0.2em;
font-size: 14px; font-size: $forum-base-font-size;
} }
} }
...@@ -289,12 +285,12 @@ body.view-in-course .discussion-article { ...@@ -289,12 +285,12 @@ body.view-in-course .discussion-article {
a { a {
display: block; display: block;
padding: ($baseline*0.25) $baseline; padding: ($baseline*0.25) $baseline;
font-size: 12px; font-size: $forum-small-font-size;
line-height: 30px; line-height: 30px;
.icon { .icon {
@include margin-right($baseline*0.25);
color: $link-color; color: $link-color;
margin-right: ($baseline*0.25);
} }
} }
} }
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
@include clearfix(); @include clearfix();
border: 1px solid $lms-border-color; border: 1px solid $lms-border-color;
background-color: $lms-container-background-color; background-color: $lms-container-background-color;
padding: $baseline;
} }
.page-header { .page-header {
@include clearfix(); @include clearfix();
border-bottom: 1px solid $lms-border-color; border-bottom: 1px solid $lms-border-color;
padding: $baseline;
.page-title { .page-title {
@extend %t-title4; @extend %t-title4;
...@@ -67,6 +67,6 @@ ...@@ -67,6 +67,6 @@
} }
.page-content { .page-content {
padding-top: $baseline; padding: $baseline;
} }
} }
...@@ -52,7 +52,6 @@ ${static.get_page_title_breadcrumbs(course_name())} ...@@ -52,7 +52,6 @@ ${static.get_page_title_breadcrumbs(course_name())}
<script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script> <script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script>
<%static:js group='courseware'/> <%static:js group='courseware'/>
<%static:js group='discussion'/>
<%include file="../discussion/_js_body_dependencies.html" /> <%include file="../discussion/_js_body_dependencies.html" />
% if staff_access: % if staff_access:
......
...@@ -73,7 +73,8 @@ ${static.get_page_title_breadcrumbs(course_name())} ...@@ -73,7 +73,8 @@ ${static.get_page_title_breadcrumbs(course_name())}
<script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script> <script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script>
<%static:js group='courseware'/> <%static:js group='courseware'/>
<%static:js group='discussion'/> <%include file="../discussion/_js_body_dependencies.html" />
% if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'): % if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'):
<%static:require_module module_name="js/search/course/course_search_factory" class_name="CourseSearchFactory"> <%static:require_module module_name="js/search/course/course_search_factory" class_name="CourseSearchFactory">
var courseId = $('.courseware-results').data('courseId'); var courseId = $('.courseware-results').data('courseId');
...@@ -85,7 +86,6 @@ ${static.get_page_title_breadcrumbs(course_name())} ...@@ -85,7 +86,6 @@ ${static.get_page_title_breadcrumbs(course_name())}
CoursewareFactory(); CoursewareFactory();
</%static:require_module> </%static:require_module>
<%include file="../discussion/_js_body_dependencies.html" />
% if staff_access: % if staff_access:
<%include file="xqa_interface.html"/> <%include file="xqa_interface.html"/>
% endif % endif
......
<%page expression_filter="h"/>
<%inherit file="../courseware/course_navigation.html" />
<%!
from django.utils.translation import ugettext as _
from django_comment_client.permissions import has_permission
%>
<%block name="extratabs">
% if has_permission(user, 'create_thread', course.id):
<li class="right">
<button class="new-post-btn btn btn-small">${_("Add a Post")}</button>
</li>
% endif
</%block>
<%page args="disable_fast_preview=True"/> ## mako
<%namespace name='static' file='/static_content.html'/>
<%page args="disable_fast_preview=True" expression_filter="h"/>
<%!
from openedx.core.djangolib.js_utils import js_escaped_string
%>
<%include file="/mathjax_include.html" args="disable_fast_preview=disable_fast_preview"/> <%include file="/mathjax_include.html" args="disable_fast_preview=disable_fast_preview"/>
<%static:js group='discussion'/>
## Add RequireJS definitions for each discussion class
<%
discussion_classes = [
['Discussion', 'common/js/discussion/discussion'],
['DiscussionModuleView', 'common/js/discussion/discussion_module_view'],
['DiscussionThreadView', 'common/js/discussion/views/discussion_thread_view'],
['DiscussionThreadListView', 'common/js/discussion/views/discussion_thread_list_view'],
['DiscussionThreadProfileView', 'common/js/discussion/views/discussion_thread_profile_view'],
['DiscussionUtil', 'common/js/discussion/utils'],
['NewPostView', 'common/js/discussion/views/new_post_view'],
]
%>
<script type="text/javascript">
% for discussion_class in discussion_classes:
RequireJS.define(
'${discussion_class[1] | n, js_escaped_string}',
[],
function() {
return window['${discussion_class[0] | n, js_escaped_string}'];
}
);
% endfor
</script>
...@@ -16,7 +16,7 @@ template_names = [ ...@@ -16,7 +16,7 @@ template_names = [
'thread', 'thread-show', 'thread-edit', 'thread-response', 'thread-response-show', 'thread-response-edit', 'thread', 'thread-show', 'thread-edit', 'thread-response', 'thread-response-show', 'thread-response-edit',
'response-comment-show', 'response-comment-edit', 'thread-list-item', 'discussion-home', 'search-alert', 'response-comment-show', 'response-comment-edit', 'thread-list-item', 'discussion-home', 'search-alert',
'new-post', 'thread-type', 'new-post-menu-entry', 'new-post-menu-category', 'topic', 'post-user-display', 'new-post', 'thread-type', 'new-post-menu-entry', 'new-post-menu-category', 'topic', 'post-user-display',
'inline-discussion', 'pagination', 'user-profile', 'profile-thread', 'customwmd-prompt', 'nav-loading' 'inline-discussion', 'pagination', 'profile-thread', 'customwmd-prompt', 'nav-loading'
] ]
## same, but without trailing "-template" in script ID - these templates does not contain any free variables ## same, but without trailing "-template" in script ID - these templates does not contain any free variables
......
...@@ -64,8 +64,30 @@ ...@@ -64,8 +64,30 @@
</div> </div>
</header> </header>
<div class="page-content"> <div class="page-content">
<h3>This is where the page content belongs</h3> <div class="layout layout-1t2t">
<p>Useful stuff goes here</p> <aside class="layout-col layout-col-a" role="complementary" aria-label="Navigation">
<h3>Sidebar</h3>
<ul>
<li>Item one</li>
<li>Item two</li>
<li>Item three</li>
</ul>
</aside>
<main id="main" aria-label="Content" tabindex="-1" class="layout-col layout-col-b">
<article tabindex="-1" aria-label="Main Content">
<h3>Main content goes here.</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis molestie, orci at viverra ornare,
augue urna fermentum ex, vitae dignissim magna est sit amet diam. Nunc sodales dolor finibus
pulvinar placerat. Suspendisse vitae tellus auctor, sodales erat ac, venenatis quam. Etiam
purus est, consequat nec erat vel, bibendum volutpat ex. Fusce vitae consectetur ante.
Suspendisse elit mauris, iaculis sed diam eu, efficitur tempor dui. Praesent tristique nunc
quam, in tincidunt ligula accumsan et. Etiam augue sem, commodo ac ipsum vel, fringilla dapibus
lacus. Sed facilisis euismod felis, non malesuada massa scelerisque sed. Etiam et placerat
lorem. Nullam quis tincidunt sapien.</p>
</article>
</main>
</div>
</div> </div>
</section> </section>
</%block> </%block>
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