Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6c540351
Commit
6c540351
authored
Jun 06, 2016
by
Andy Armstrong
Committed by
Brian Jacobel
Aug 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a content header to the discussion board
parent
89f93df4
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
1227 additions
and
1290 deletions
+1227
-1290
common/static/common/js/discussion/main.js
+0
-73
common/static/common/js/discussion/utils.js
+0
-4
common/static/common/js/spec_helpers/discussion_spec_helper.js
+42
-28
common/test/acceptance/pages/lms/discussion.py
+4
-4
lms/djangoapps/discussion/static/discussion/js/discussion_board_factory.js
+36
-20
lms/djangoapps/discussion/static/discussion/js/discussion_profile_page_factory.js
+9
-9
lms/djangoapps/discussion/static/discussion/js/discussion_router.js
+134
-191
lms/djangoapps/discussion/static/discussion/js/spec/discussion_board_factory_spec.js
+57
-0
lms/djangoapps/discussion/static/discussion/js/spec/discussion_profile_page_factory_spec.js
+41
-0
lms/djangoapps/discussion/static/discussion/js/spec/views/discussion_user_profile_view_spec.js
+262
-232
lms/djangoapps/discussion/static/discussion/js/views/discussion_user_profile_view.js
+85
-97
lms/djangoapps/discussion/static/discussion/templates/user-profile.underscore
+1
-1
lms/djangoapps/discussion/templates/discussion/discussion_board.html
+41
-27
lms/djangoapps/discussion/templates/discussion/discussion_profile_page.html
+55
-18
lms/djangoapps/discussion/templates/discussion/maintenance.html
+24
-2
lms/djangoapps/discussion/templates/discussion/user_profile.html
+0
-62
lms/djangoapps/discussion/tests/test_views.py
+8
-7
lms/djangoapps/discussion/views.py
+18
-19
lms/djangoapps/django_comment_client/tests/group_id.py
+2
-2
lms/djangoapps/teams/static/teams/js/spec/views/team_discussion_spec.js
+7
-6
lms/djangoapps/teams/static/teams/js/spec/views/team_profile_spec.js
+15
-15
lms/djangoapps/teams/static/teams/js/views/team_discussion.js
+1
-1
lms/djangoapps/teams/templates/teams/teams.html
+0
-4
lms/static/discussion
+2
-0
lms/static/js/spec/courseware/link_clicked_events_spec.js
+1
-1
lms/static/karma_lms.conf.js
+10
-15
lms/static/lms/js/build.js
+2
-1
lms/static/lms/js/spec/main.js
+56
-63
lms/static/sass/discussion/_build.scss
+1
-1
lms/static/sass/discussion/_discussion.scss
+121
-126
lms/static/sass/discussion/_layouts.scss
+6
-12
lms/static/sass/discussion/_mixins.scss
+12
-11
lms/static/sass/discussion/elements/_actions.scss
+7
-7
lms/static/sass/discussion/elements/_editor.scss
+7
-7
lms/static/sass/discussion/elements/_navigation.scss
+13
-17
lms/static/sass/discussion/utilities/_developer.scss
+2
-2
lms/static/sass/discussion/utilities/_shame.scss
+8
-8
lms/static/sass/discussion/utilities/_v1-compatibility.scss
+2
-118
lms/static/sass/discussion/utilities/_variables-v1.scss
+9
-0
lms/static/sass/discussion/utilities/_variables-v2.scss
+9
-0
lms/static/sass/discussion/views/_create-edit-post.scss
+17
-16
lms/static/sass/discussion/views/_home.scss
+6
-6
lms/static/sass/discussion/views/_response.scss
+13
-13
lms/static/sass/discussion/views/_thread.scss
+17
-21
lms/static/sass/shared-v2/_layouts.scss
+2
-2
lms/templates/courseware/courseware-chromeless.html
+0
-1
lms/templates/courseware/courseware.html
+2
-2
lms/templates/discussion/_discussion_course_navigation.html
+0
-14
lms/templates/discussion/_js_body_dependencies.html
+35
-1
lms/templates/discussion/_underscore_templates.html
+1
-1
lms/templates/ux/reference/course-skeleton.html
+24
-2
No files found.
common/static/common/js/discussion/main.js
deleted
100644 → 0
View file @
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
);
common/static/common/js/discussion/utils.js
View file @
6c540351
...
@@ -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
))
{
...
...
common/static/common/js/spec_helpers/discussion_spec_helper.js
View file @
6c540351
...
@@ -6,18 +6,26 @@
...
@@ -6,18 +6,26 @@
}
}
DiscussionSpecHelper
.
setUpGlobals
=
function
()
{
DiscussionSpecHelper
.
setUpGlobals
=
function
()
{
DiscussionUtil
.
loadRoles
({
DiscussionUtil
.
loadRoles
(
DiscussionSpecHelper
.
getTestRoleInfo
());
'Moderator'
:
[],
'Administrator'
:
[],
'Community TA'
:
[]
});
window
.
$$course_id
=
'edX/999/test'
;
window
.
$$course_id
=
'edX/999/test'
;
window
.
user
=
new
DiscussionUser
({
window
.
user
=
new
DiscussionUser
(
DiscussionSpecHelper
.
getTestUserInfo
());
return
DiscussionUtil
.
setUser
(
window
.
user
);
};
DiscussionSpecHelper
.
getTestUserInfo
=
function
()
{
return
{
username
:
'test_user'
,
username
:
'test_user'
,
id
:
'567'
,
id
:
'567'
,
upvoted_ids
:
[]
upvoted_ids
:
[]
});
};
return
DiscussionUtil
.
setUser
(
window
.
user
);
};
DiscussionSpecHelper
.
getTestRoleInfo
=
function
()
{
return
{
'Moderator'
:
[],
'Administrator'
:
[],
'Community TA'
:
[]
};
};
};
DiscussionSpecHelper
.
makeTA
=
function
()
{
DiscussionSpecHelper
.
makeTA
=
function
()
{
...
@@ -42,69 +50,75 @@
...
@@ -42,69 +50,75 @@
return
jasmine
.
createSpyObj
(
'event'
,
[
'preventDefault'
,
'target'
]);
return
jasmine
.
createSpyObj
(
'event'
,
[
'preventDefault'
,
'target'
]);
};
};
DiscussionSpecHelper
.
makeCourseSettings
=
function
(
is
_c
ohorted
)
{
DiscussionSpecHelper
.
makeCourseSettings
=
function
(
is
C
ohorted
)
{
if
(
typeof
is
_cohorted
===
'undefined'
||
is_c
ohorted
===
null
)
{
if
(
typeof
is
Cohorted
===
'undefined'
||
isC
ohorted
===
null
)
{
is
_c
ohorted
=
true
;
is
C
ohorted
=
true
;
}
}
return
new
DiscussionCourseSettings
({
return
new
DiscussionCourseSettings
({
category_map
:
{
category_map
:
{
children
:
[
'Test Topic'
,
'Other Topic'
],
children
:
[
'Test Topic'
,
'Other Topic'
],
entries
:
{
entries
:
{
'Test Topic'
:
{
'Test Topic'
:
{
is_cohorted
:
is
_c
ohorted
,
is_cohorted
:
is
C
ohorted
,
id
:
'test_topic'
id
:
'test_topic'
},
},
'Other Topic'
:
{
'Other Topic'
:
{
is_cohorted
:
is
_c
ohorted
,
is_cohorted
:
is
C
ohorted
,
id
:
'other_topic'
id
:
'other_topic'
}
}
}
}
},
},
is_cohorted
:
is
_c
ohorted
is_cohorted
:
is
C
ohorted
});
});
};
};
DiscussionSpecHelper
.
setUnderscoreFixtures
=
function
()
{
DiscussionSpecHelper
.
setUnderscoreFixtures
=
function
()
{
var
templateFixture
,
templateName
,
templateNames
,
templateNamesNoTrailingTemplate
,
_i
,
_j
,
_len
,
_len1
;
var
templateFixture
,
templateName
,
templateNames
,
templateNamesNoTrailingTemplate
,
i
,
j
,
len
;
templateNames
=
[
templateNames
=
[
'thread'
,
'thread-show'
,
'thread-edit'
,
'thread-response'
,
'thread-response-show'
,
'thread'
,
'thread-show'
,
'thread-edit'
,
'thread-response'
,
'thread-response-show'
,
'thread-response-edit'
,
'response-comment-show'
,
'response-comment-edit'
,
'thread-list-item'
,
'thread-response-edit'
,
'response-comment-show'
,
'response-comment-edit'
,
'thread-list-item'
,
'discussion-home'
,
'search-alert'
,
'new-post'
,
'thread-type'
,
'new-post-menu-entry'
,
'discussion-home'
,
'search-alert'
,
'new-post'
,
'thread-type'
,
'new-post-menu-entry'
,
'new-post-menu-category'
,
'topic'
,
'post-user-display'
,
'inline-discussion'
,
'pagination'
,
'new-post-menu-category'
,
'topic'
,
'post-user-display'
,
'inline-discussion'
,
'pagination'
,
'
user-profile'
,
'
profile-thread'
,
'customwmd-prompt'
,
'nav-loading'
'profile-thread'
,
'customwmd-prompt'
,
'nav-loading'
];
];
templateNamesNoTrailingTemplate
=
[
templateNamesNoTrailingTemplate
=
[
'forum-action-endorse'
,
'forum-action-answer'
,
'forum-action-follow'
,
'forum-action-vote'
,
'forum-action-endorse'
,
'forum-action-answer'
,
'forum-action-follow'
,
'forum-action-vote'
,
'forum-action-report'
,
'forum-action-pin'
,
'forum-action-close'
,
'forum-action-edit'
,
'forum-action-report'
,
'forum-action-pin'
,
'forum-action-close'
,
'forum-action-edit'
,
'forum-action-delete'
,
'forum-actions'
,
'alert-popup'
,
'nav-load-more-link'
'forum-action-delete'
,
'forum-actions'
,
'alert-popup'
,
'nav-load-more-link'
];
];
for
(
_i
=
0
,
_len
=
templateNames
.
length
;
_i
<
_len
;
_
i
++
)
{
for
(
i
=
0
,
len
=
templateNames
.
length
;
i
<
len
;
i
++
)
{
templateName
=
templateNames
[
_
i
];
templateName
=
templateNames
[
i
];
templateFixture
=
readFixtures
(
'common/templates/discussion/'
+
templateName
+
'.underscore'
);
templateFixture
=
readFixtures
(
'common/templates/discussion/'
+
templateName
+
'.underscore'
);
appendSetFixtures
(
$
(
'<script>'
,
{
appendSetFixtures
(
$
(
'<script>'
,
{
id
:
templateName
+
'-template'
,
id
:
templateName
+
'-template'
,
type
:
'text/template'
type
:
'text/template'
}).
text
(
templateFixture
));
}).
text
(
templateFixture
));
}
}
for
(
_j
=
0
,
_len1
=
templateNamesNoTrailingTemplate
.
length
;
_j
<
_len1
;
_
j
++
)
{
for
(
j
=
0
,
len
=
templateNamesNoTrailingTemplate
.
length
;
j
<
len
;
j
++
)
{
templateName
=
templateNamesNoTrailingTemplate
[
_
j
];
templateName
=
templateNamesNoTrailingTemplate
[
j
];
templateFixture
=
readFixtures
(
'common/templates/discussion/'
+
templateName
+
'.underscore'
);
templateFixture
=
readFixtures
(
'common/templates/discussion/'
+
templateName
+
'.underscore'
);
appendSetFixtures
(
$
(
'<script>'
,
{
appendSetFixtures
(
$
(
'<script>'
,
{
id
:
templateName
,
id
:
templateName
,
type
:
'text/template'
type
:
'text/template'
}).
text
(
templateFixture
));
}).
text
(
templateFixture
));
}
}
return
appendSetFixtures
(
'<div id="fixture-element"></div>
\
n'
+
// suppressing Line is too long (4272 characters!)
'<div id="discussion-container"'
+
/* jshint -W101 */
' data-course-name="Fake Course"'
+
appendSetFixtures
(
' data-user-create-comment="true"'
+
"<script type=
\
'text/template
\
' id=
\
'thread-list-template
\
'>
\
n <div class=
\
'forum-nav-header
\
'>
\
n <button type=
\
'button
\
' class=
\
'forum-nav-browse
\
' id=
\
'forum-nav-browse
\
' aria-haspopup=
\
'true
\
'>
\
n <span class=
\
'icon fa fa-bars
\
' aria-hidden=
\
'true
\
'></span>
\
n <span class=
\
'sr
\
'>Discussion topics; currently listing: </span>
\
n <span class=
\
'forum-nav-browse-current
\
'>All Discussions</span>
\
n ▾
\
n </button>
\
n <form class=
\
'forum-nav-search
\
'>
\
n <label>
\
n <span class=
\
'sr
\
'>Search all posts</span>
\
n <input class=
\
'forum-nav-search-input
\
' id=
\
'forum-nav-search
\
' type=
\
'text
\
' placeholder=
\
'Search all posts
\
'>
\
n <span class=
\
'icon fa fa-search
\
' aria-hidden=
\
'true
\
'></span>
\
n </label>
\
n </form>
\
n </div>
\
n <div class=
\
'forum-nav-browse-menu-wrapper
\
' style=
\
'display: none
\
'>
\
n <form class=
\
'forum-nav-browse-filter
\
'>
\
n <label>
\
n <span class=
\
'sr
\
'>Filter Topics</span>
\
n <input type=
\
'text
\
' class=
\
'forum-nav-browse-filter-input
\
' placeholder=
\
'filter topics
\
'>
\
n </label>
\
n </form>
\
n <ul class=
\
'forum-nav-browse-menu
\
'>
\
n <li class=
\
'forum-nav-browse-menu-item forum-nav-browse-menu-all
\
'>
\
n <a href=
\
'#
\
' class=
\
'forum-nav-browse-title
\
'>All Discussions</a>
\
n </li>
\
n <li class=
\
'forum-nav-browse-menu-item forum-nav-browse-menu-following
\
'>
\
n <a href=
\
'#
\
' class=
\
'forum-nav-browse-title
\
'><span class=
\
'icon fa fa-star
\
' aria-hidden=
\
'true
\
'></span>Posts I'm Following</a>
\
n </li>
\
n <li class=
\
'forum-nav-browse-menu-item
\
'>
\
n <a href=
\
'#
\
' class=
\
'forum-nav-browse-title
\
'>Parent</a>
\
n <ul class=
\
'forum-nav-browse-submenu
\
'>
\
n <li class=
\
'forum-nav-browse-menu-item
\
'>
\
n <a href=
\
'#
\
' class=
\
'forum-nav-browse-title
\
'>Target</a>
\
n <ul class=
\
'forum-nav-browse-submenu
\
'>
\
n <li
\
n class=
\
'forum-nav-browse-menu-item
\
'
\
n data-discussion-id=
\
'child
\
'
\
n data-cohorted=
\
'false
\
'
\
n >
\
n <a href=
\
'#
\
' class=
\
'forum-nav-browse-title
\
'>Child</a>
\
n </li>
\
n </ul>
\
n <li
\
n class=
\
'forum-nav-browse-menu-item
\
'
\
n data-discussion-id=
\
'sibling
\
'
\
n data-cohorted=
\
'false
\
'
\
n >
\
n <a href=
\
'#
\
' class=
\
'forum-nav-browse-title
\
'>Sibling</a>
\
n </li>
\
n </ul>
\
n </li>
\
n <li
\
n class=
\
'forum-nav-browse-menu-item
\
'
\
n data-discussion-id=
\
'other
\
'
\
n data-cohorted=
\
'true
\
'
\
n >
\
n <a href=
\
'#
\
' class=
\
'forum-nav-browse-title
\
'>Other Category</a>
\
n </li>
\
n </ul>
\
n </div>
\
n <div class=
\
'forum-nav-thread-list-wrapper
\
' id=
\
'sort-filter-wrapper
\
' tabindex=
\
'-1
\
'>
\
n <div class=
\
'forum-nav-refine-bar
\
'>
\
n <label class=
\
'forum-nav-filter-main
\
'>
\
n <select class=
\
'forum-nav-filter-main-control
\
'>
\
n <option value=
\
'all
\
'>Show all</option>
\
n <option value=
\
'unread
\
'>Unread</option>
\
n <option value=
\
'unanswered
\
'>Unanswered</option>
\
n <option value=
\
'flagged
\
'>Flagged</option>
\
n </select>
\
n </label>
\
n <% if (isCohorted && isPrivilegedUser) { %>
\
n <label class=
\
'forum-nav-filter-cohort
\
'>
\
n <span class=
\
'sr
\
'>Cohort:</span>
\
n <select class=
\
'forum-nav-filter-cohort-control
\
'>
\
n <option value=
\
'
\
'>in all cohorts</option>
\
n <option value=
\
'1
\
'>Cohort1</option>
\
n <option value=
\
'2
\
'>Cohort2</option>
\
n </select>
\
n </label>
\
n <% } %>
\
n <label class=
\
'forum-nav-sort
\
'>
\
n <select class=
\
'forum-nav-sort-control
\
'>
\
n <option value=
\
'activity
\
'>by recent activity</option>
\
n <option value=
\
'comments
\
'>by most activity</option>
\
n <option value=
\
'votes
\
'>by most votes</option>
\
n </select>
\
n </label>
\
n </div>
\
n </div>
\
n <div class=
\
'search-alerts
\
'></div>
\
n <ul class=
\
'forum-nav-thread-list
\
'></ul>
\
n</script>"
);
' data-user-create-subcomment="true"'
+
' data-read-only="false"'
+
appendSetFixtures
(
'<div id=
\'
fixture-element
\'
></div>
\
n'
+
'<div id=
\'
discussion-container
\'
'
+
' data-course-name=
\'
Fake Course
\'
'
+
' data-user-create-comment=
\'
true
\'
'
+
' data-user-create-subcomment=
\'
true
\'
'
+
' data-read-only=
\'
false
\'
'
+
'></div>'
'></div>'
);
);
};
};
return
DiscussionSpecHelper
;
return
DiscussionSpecHelper
;
}
)(
);
}
()
);
}).
call
(
this
);
}).
call
(
this
);
common/test/acceptance/pages/lms/discussion.py
View file @
6c540351
...
@@ -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
...
...
lms/djangoapps/discussion/static/discussion/js/discussion_board_factory.js
View file @
6c540351
;
(
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
.
loadRoles
FromContainer
(
);
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
);
lms/djangoapps/discussion/static/discussion/js/discussion_profile_page_factory.js
View file @
6c540351
;
(
function
(
define
)
{
(
function
(
define
)
{
'use strict'
;
'use strict'
;
define
([
'jquery'
,
'
DiscussionUserProfileV
iew'
],
define
([
'jquery'
,
'
discussion/js/views/discussion_user_profile_v
iew'
],
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
...
...
lms/djangoapps/discussion/static/discussion/js/discussion_router.js
View file @
6c540351
/* globals DiscussionThreadListView, DiscussionThreadView, DiscussionUtil, NewPostView, Thread */
(
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
;
};
function
getSingleThreadRoute
(
commentable_id
,
thread_id
)
{
return
commentable_id
+
'/threads/'
+
thread_id
;
}
if
(
typeof
Backbone
!==
'undefined'
&&
Backbone
!==
null
)
{
this
.
DiscussionRouter
=
(
function
(
_super
)
{
var
allThreadsRoute
=
''
,
singleThreadRoute
=
getSingleThreadRoute
(
':forum_name'
,
':thread_id'
),
// :forum_name/threads/:thread_id
routes
=
{};
routes
[
allThreadsRoute
]
=
'allThreads'
;
routes
[
singleThreadRoute
]
=
'showThread'
;
__extends
(
DiscussionRouter
,
_super
);
function
DiscussionRouter
()
{
var
self
=
this
;
this
.
hideNewPost
=
function
()
{
return
DiscussionRouter
.
prototype
.
hideNewPost
.
apply
(
self
,
arguments
);
};
this
.
showNewPost
=
function
()
{
return
DiscussionRouter
.
prototype
.
showNewPost
.
apply
(
self
,
arguments
);
};
this
.
navigateToAllThreads
=
function
()
{
return
DiscussionRouter
.
prototype
.
navigateToAllThreads
.
apply
(
self
,
arguments
);
};
this
.
navigateToThread
=
function
()
{
return
DiscussionRouter
.
prototype
.
navigateToThread
.
apply
(
self
,
arguments
);
};
this
.
showMain
=
function
()
{
return
DiscussionRouter
.
prototype
.
showMain
.
apply
(
self
,
arguments
);
};
this
.
renderThreadView
=
function
()
{
return
DiscussionRouter
.
prototype
.
renderThreadView
.
apply
(
self
,
arguments
);
};
this
.
setActiveThread
=
function
()
{
return
DiscussionRouter
.
prototype
.
setActiveThread
.
apply
(
self
,
arguments
);
};
return
DiscussionRouter
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
}
DiscussionRouter
.
prototype
.
routes
=
routes
;
DiscussionRouter
.
prototype
.
initialize
=
function
(
options
)
{
var
self
=
this
;
this
.
discussion
=
options
.
discussion
;
this
.
course_settings
=
options
.
course_settings
;
this
.
nav
=
new
DiscussionThreadListView
({
collection
:
this
.
discussion
,
el
:
$
(
'.forum-nav'
),
courseSettings
:
this
.
course_settings
});
this
.
nav
.
on
(
'thread:selected'
,
this
.
navigateToThread
);
this
.
nav
.
on
(
'thread:removed'
,
this
.
navigateToAllThreads
);
this
.
nav
.
on
(
'threads:rendered'
,
this
.
setActiveThread
);
this
.
nav
.
on
(
'thread:created'
,
this
.
navigateToThread
);
this
.
nav
.
render
();
this
.
newPost
=
$
(
'.new-post-article'
);
this
.
newPostView
=
new
NewPostView
({
el
:
this
.
newPost
,
collection
:
this
.
discussion
,
course_settings
:
this
.
course_settings
,
mode
:
'tab'
});
this
.
newPostView
.
render
();
this
.
listenTo
(
this
.
newPostView
,
'newPost:cancel'
,
this
.
hideNewPost
);
$
(
'.new-post-btn'
).
bind
(
'click'
,
this
.
showNewPost
);
return
$
(
'.new-post-btn'
).
bind
(
'keydown'
,
function
(
event
)
{
return
DiscussionUtil
.
activateOnSpace
(
event
,
self
.
showNewPost
);
});
};
DiscussionRouter
.
prototype
.
allThreads
=
function
()
{
this
.
nav
.
updateSidebar
();
this
.
nav
.
goHome
();
};
DiscussionRouter
.
prototype
.
setActiveThread
=
function
()
{
if
(
this
.
thread
)
{
this
.
nav
.
setActiveThread
(
this
.
thread
.
get
(
'id'
));
}
};
DiscussionRouter
.
prototype
.
showThread
=
function
(
forum_name
,
thread_id
)
{
var
self
=
this
;
this
.
thread
=
this
.
discussion
.
get
(
thread_id
);
if
(
this
.
thread
)
{
define
(
this
.
renderThreadView
();
[
return
;
'underscore'
,
}
'backbone'
,
'common/js/discussion/utils'
,
// if thread is not loaded yet for some reason - try loading it
'common/js/discussion/views/discussion_thread_list_view'
,
DiscussionUtil
.
safeAjax
({
'common/js/discussion/views/discussion_thread_view'
url
:
DiscussionUtil
.
urlFor
(
'retrieve_single_thread'
,
forum_name
,
thread_id
)
],
}).
done
(
function
(
data
)
{
function
(
_
,
Backbone
,
DiscussionUtil
,
DiscussionThreadListView
,
DiscussionThreadView
)
{
// if succeded - proceed normally
var
DiscussionRouter
=
Backbone
.
Router
.
extend
({
self
.
thread
=
new
Thread
(
data
.
content
);
routes
:
{
self
.
discussion
.
add
(
self
.
thread
);
''
:
'allThreads'
,
self
.
renderThreadView
();
':forum_name/threads/:thread_id'
:
'showThread'
}).
fail
(
function
(
xhr
)
{
},
// otherwise display error message and navigate to all threads view
var
errorMsg
;
initialize
:
function
(
options
)
{
if
(
xhr
.
status
===
404
)
{
Backbone
.
Router
.
prototype
.
initialize
.
call
(
this
);
errorMsg
=
gettext
(
'The thread you selected has been deleted. Please select another thread.'
);
_
.
bindAll
(
this
,
'allThreads'
,
'showThread'
);
this
.
courseId
=
options
.
courseId
;
this
.
discussion
=
options
.
discussion
;
this
.
course_settings
=
options
.
courseSettings
;
this
.
newPostView
=
options
.
newPostView
;
this
.
nav
=
new
DiscussionThreadListView
({
collection
:
this
.
discussion
,
el
:
$
(
'.forum-nav'
),
courseSettings
:
this
.
course_settings
});
this
.
nav
.
render
();
},
start
:
function
()
{
var
self
=
this
,
$newPostButton
=
$
(
'.new-post-btn'
);
this
.
listenTo
(
this
.
newPostView
,
'newPost:cancel'
,
this
.
hideNewPost
);
$newPostButton
.
bind
(
'click'
,
_
.
bind
(
this
.
showNewPost
,
this
));
$newPostButton
.
bind
(
'keydown'
,
function
(
event
)
{
DiscussionUtil
.
activateOnSpace
(
event
,
self
.
showNewPost
);
});
// Automatically navigate when the user selects threads
this
.
nav
.
on
(
'thread:selected'
,
_
.
bind
(
this
.
navigateToThread
,
this
));
this
.
nav
.
on
(
'thread:removed'
,
_
.
bind
(
this
.
navigateToAllThreads
,
this
));
this
.
nav
.
on
(
'threads:rendered'
,
_
.
bind
(
this
.
setActiveThread
,
this
));
this
.
nav
.
on
(
'thread:created'
,
_
.
bind
(
this
.
navigateToThread
,
this
));
Backbone
.
history
.
start
({
pushState
:
true
,
root
:
'/courses/'
+
this
.
courseId
+
'/discussion/forum/'
});
},
stop
:
function
()
{
Backbone
.
history
.
stop
();
},
allThreads
:
function
()
{
this
.
nav
.
updateSidebar
();
return
this
.
nav
.
goHome
();
},
setActiveThread
:
function
()
{
if
(
this
.
thread
)
{
return
this
.
nav
.
setActiveThread
(
this
.
thread
.
get
(
'id'
));
}
else
{
}
else
{
errorMsg
=
gettext
(
'We had some trouble loading more responses. Please try again.'
)
;
return
this
.
nav
.
goHome
;
}
}
DiscussionUtil
.
discussionAlert
(
gettext
(
'Sorry'
),
errorMsg
);
},
this
.
allThreads
();
});
showThread
:
function
(
forumName
,
threadId
)
{
};
this
.
thread
=
this
.
discussion
.
get
(
threadId
);
this
.
thread
.
set
(
'unread_comments_count'
,
0
);
DiscussionRouter
.
prototype
.
renderThreadView
=
function
()
{
this
.
thread
.
set
(
'read'
,
true
);
this
.
thread
.
set
(
'unread_comments_count'
,
0
);
this
.
setActiveThread
();
this
.
thread
.
set
(
'read'
,
true
);
return
this
.
showMain
();
this
.
setActiveThread
();
},
this
.
showMain
();
};
showMain
:
function
()
{
var
self
=
this
;
DiscussionRouter
.
prototype
.
showMain
=
function
()
{
if
(
this
.
main
)
{
var
self
=
this
;
this
.
main
.
cleanup
();
if
(
this
.
main
)
{
this
.
main
.
undelegateEvents
();
this
.
main
.
cleanup
();
this
.
main
.
undelegateEvents
();
}
if
(
!
(
$
(
'.forum-content'
).
is
(
':visible'
)))
{
$
(
'.forum-content'
).
fadeIn
();
}
if
(
this
.
newPost
.
is
(
':visible'
))
{
this
.
newPost
.
fadeOut
();
}
this
.
main
=
new
DiscussionThreadView
({
el
:
$
(
'.forum-content'
),
model
:
this
.
thread
,
mode
:
'tab'
,
course_settings
:
this
.
course_settings
});
this
.
main
.
render
();
this
.
main
.
on
(
'thread:responses:rendered'
,
function
()
{
return
self
.
nav
.
updateSidebar
();
});
this
.
thread
.
on
(
'thread:thread_type_updated'
,
this
.
showMain
);
};
DiscussionRouter
.
prototype
.
navigateToThread
=
function
(
thread_id
)
{
var
thread
,
targetThreadRoute
;
thread
=
this
.
discussion
.
get
(
thread_id
);
targetThreadRoute
=
getSingleThreadRoute
(
thread
.
get
(
'commentable_id'
),
thread_id
);
this
.
navigate
(
targetThreadRoute
,
{
trigger
:
true
});
};
DiscussionRouter
.
prototype
.
navigateToAllThreads
=
function
()
{
this
.
navigate
(
allThreadsRoute
,
{
trigger
:
true
});
};
DiscussionRouter
.
prototype
.
showNewPost
=
function
()
{
var
self
=
this
;
$
(
'.forum-content'
).
fadeOut
({
duration
:
200
,
complete
:
function
()
{
return
self
.
newPost
.
fadeIn
(
200
).
focus
();
}
}
});
if
(
!
(
$
(
'.forum-content'
).
is
(
':visible'
)))
{
};
$
(
'.forum-content'
).
fadeIn
();
}
DiscussionRouter
.
prototype
.
hideNewPost
=
function
()
{
if
(
this
.
newPostView
.
$el
.
is
(
':visible'
))
{
this
.
newPost
.
fadeOut
({
this
.
newPostView
.
$el
.
fadeOut
();
duration
:
200
,
complete
:
function
()
{
return
$
(
'.forum-content'
).
fadeIn
(
200
).
find
(
'.thread-wrapper'
).
focus
();
}
}
});
this
.
main
=
new
DiscussionThreadView
({
};
el
:
$
(
'.forum-content'
),
model
:
this
.
thread
,
mode
:
'tab'
,
course_settings
:
this
.
course_settings
});
this
.
main
.
render
();
this
.
main
.
on
(
'thread:responses:rendered'
,
function
()
{
return
self
.
nav
.
updateSidebar
();
});
return
this
.
thread
.
on
(
'thread:thread_type_updated'
,
this
.
showMain
);
},
navigateToThread
:
function
(
threadId
)
{
var
thread
;
thread
=
this
.
discussion
.
get
(
threadId
);
return
this
.
navigate
(
''
+
(
thread
.
get
(
'commentable_id'
))
+
'/threads/'
+
threadId
,
{
trigger
:
true
});
},
navigateToAllThreads
:
function
()
{
return
this
.
navigate
(
''
,
{
trigger
:
true
});
},
showNewPost
:
function
()
{
var
self
=
this
;
return
$
(
'.forum-content'
).
fadeOut
({
duration
:
200
,
complete
:
function
()
{
return
self
.
newPostView
.
$el
.
fadeIn
(
200
).
focus
();
}
});
},
hideNewPost
:
function
()
{
return
this
.
newPostView
.
$el
.
fadeOut
({
duration
:
200
,
complete
:
function
()
{
return
$
(
'.forum-content'
).
fadeIn
(
200
).
find
(
'.thread-wrapper'
)
.
focus
();
}
});
}
});
return
DiscussionRouter
;
return
DiscussionRouter
;
})(
Backbone
.
Router
);
});
}
}).
call
(
this
,
define
||
RequireJS
.
define
);
}).
call
(
window
);
lms/djangoapps/discussion/static/discussion/js/spec/discussion_board_factory_spec.js
0 → 100644
View file @
6c540351
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'
);
});
});
}
);
lms/djangoapps/discussion/static/discussion/js/spec/discussion_profile_page_factory_spec.js
0 → 100644
View file @
6c540351
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'
);
});
});
}
);
lms/djangoapps/discussion/static/discussion/js/spec/views/discussion_user_profile_view_spec.js
View file @
6c540351
/* globals DiscussionSpecHelper, DiscussionThreadProfileView, DiscussionUserProfileView, URI, DiscussionUtil */
define
(
(
function
()
{
[
'use strict'
;
'underscore'
,
describe
(
'DiscussionUserProfileView'
,
function
()
{
'jquery'
,
var
makeThreads
,
makeView
;
'URI'
,
beforeEach
(
function
()
{
'common/js/discussion/utils'
,
DiscussionSpecHelper
.
setUpGlobals
();
'common/js/discussion/views/discussion_thread_profile_view'
,
DiscussionSpecHelper
.
setUnderscoreFixtures
();
'common/js/spec_helpers/discussion_spec_helper'
,
return
spyOn
(
DiscussionThreadProfileView
.
prototype
,
'render'
);
'discussion/js/views/discussion_user_profile_view'
});
],
makeThreads
=
function
(
numThreads
)
{
function
(
_
,
$
,
URI
,
DiscussionUtil
,
DiscussionThreadProfileView
,
DiscussionSpecHelper
,
DiscussionUserProfileView
)
{
return
_
.
map
(
_
.
range
(
numThreads
),
function
(
i
)
{
'use strict'
;
return
{
id
:
i
.
toString
(),
describe
(
'DiscussionUserProfileView'
,
function
()
{
body
:
'dummy body'
var
makeThreads
,
makeView
;
};
beforeEach
(
function
()
{
});
DiscussionSpecHelper
.
setUpGlobals
();
};
DiscussionSpecHelper
.
setUnderscoreFixtures
();
makeView
=
function
(
threads
,
page
,
numPages
)
{
return
spyOn
(
DiscussionThreadProfileView
.
prototype
,
'render'
);
return
new
DiscussionUserProfileView
({
collection
:
threads
,
page
:
page
,
numPages
:
numPages
});
});
};
describe
(
'thread rendering should be correct'
,
function
()
{
makeThreads
=
function
(
numThreads
)
{
var
checkRender
;
return
_
.
map
(
_
.
range
(
numThreads
),
function
(
i
)
{
checkRender
=
function
(
numThreads
)
{
return
{
var
threads
,
view
;
id
:
i
.
toString
(),
threads
=
makeThreads
(
numThreads
);
body
:
'dummy body'
view
=
makeView
(
threads
,
1
,
1
);
};
expect
(
view
.
$
(
'.discussion'
).
children
().
length
).
toEqual
(
numThreads
);
return
_
.
each
(
threads
,
function
(
thread
)
{
return
expect
(
view
.
$
(
'#thread_'
+
thread
.
id
).
length
).
toEqual
(
1
);
});
});
};
};
it
(
'with no threads'
,
function
()
{
return
checkRender
(
0
);
makeView
=
function
(
threads
,
page
,
numPages
)
{
});
return
new
DiscussionUserProfileView
({
it
(
'with one thread'
,
function
()
{
collection
:
threads
,
return
checkRender
(
1
);
page
:
page
,
});
numPages
:
numPages
it
(
'with several threads'
,
function
()
{
});
return
checkRender
(
5
);
});
});
describe
(
'pagination rendering should be correct'
,
function
()
{
var
baseUri
,
checkRender
,
pageInfo
;
baseUri
=
URI
(
window
.
location
);
pageInfo
=
function
(
page
)
{
return
{
url
:
baseUri
.
clone
().
addSearch
(
'page'
,
page
).
toString
(),
number
:
page
};
};
};
checkRender
=
function
(
params
)
{
var
get_page_number
,
paginator
,
view
;
describe
(
'thread rendering should be correct'
,
function
()
{
view
=
makeView
([],
params
.
page
,
params
.
numPages
);
var
checkRender
;
paginator
=
view
.
$
(
'.discussion-paginator'
);
checkRender
=
function
(
numThreads
)
{
expect
(
paginator
.
find
(
'.current-page'
).
text
()).
toEqual
(
params
.
page
.
toString
());
var
threads
,
view
;
expect
(
paginator
.
find
(
'.first-page'
).
length
).
toBe
(
params
.
first
?
1
:
0
);
threads
=
makeThreads
(
numThreads
);
expect
(
paginator
.
find
(
'.previous-page'
).
length
).
toBe
(
params
.
previous
?
1
:
0
);
view
=
makeView
(
threads
,
1
,
1
);
expect
(
paginator
.
find
(
'.previous-ellipses'
).
length
).
toBe
(
params
.
leftdots
?
1
:
0
);
expect
(
view
.
$
(
'.discussion'
).
children
().
length
).
toEqual
(
numThreads
);
expect
(
paginator
.
find
(
'.next-page'
).
length
).
toBe
(
params
.
next
?
1
:
0
);
return
_
.
each
(
threads
,
function
(
thread
)
{
expect
(
paginator
.
find
(
'.next-ellipses'
).
length
).
toBe
(
params
.
rightdots
?
1
:
0
);
return
expect
(
view
.
$
(
'#thread_'
+
thread
.
id
).
length
).
toEqual
(
1
);
expect
(
paginator
.
find
(
'.last-page'
).
length
).
toBe
(
params
.
last
?
1
:
0
);
});
get_page_number
=
function
(
element
)
{
return
parseInt
(
$
(
element
).
text
());
};
};
expect
(
_
.
map
(
paginator
.
find
(
'.lower-page a'
),
get_page_number
)).
toEqual
(
params
.
lowPages
);
return
expect
(
_
.
map
(
paginator
.
find
(
'.higher-page a'
),
get_page_number
)).
toEqual
(
params
.
highPages
);
it
(
'with no threads'
,
function
()
{
};
return
checkRender
(
0
);
it
(
'for one page'
,
function
()
{
return
checkRender
({
page
:
1
,
numPages
:
1
,
previous
:
null
,
first
:
null
,
leftdots
:
false
,
lowPages
:
[],
highPages
:
[],
rightdots
:
false
,
last
:
null
,
next
:
null
});
});
});
it
(
'for first page of three (max with no last)'
,
function
()
{
it
(
'with one thread'
,
function
()
{
return
checkRender
({
return
checkRender
(
1
);
page
:
1
,
numPages
:
3
,
previous
:
null
,
first
:
null
,
leftdots
:
false
,
lowPages
:
[],
highPages
:
[
2
,
3
],
rightdots
:
false
,
last
:
null
,
next
:
2
});
});
});
it
(
'for first page of four (has last but no dots)'
,
function
()
{
it
(
'with several threads'
,
function
()
{
return
checkRender
({
return
checkRender
(
5
);
page
:
1
,
numPages
:
4
,
previous
:
null
,
first
:
null
,
leftdots
:
false
,
lowPages
:
[],
highPages
:
[
2
,
3
],
rightdots
:
false
,
last
:
4
,
next
:
2
});
});
});
});
it
(
'for first page of five (has dots)'
,
function
()
{
return
checkRender
({
describe
(
'pagination rendering should be correct'
,
function
()
{
page
:
1
,
var
baseUri
,
checkRender
,
pageInfo
;
numPages
:
5
,
baseUri
=
URI
(
window
.
location
);
previous
:
null
,
pageInfo
=
function
(
page
)
{
first
:
null
,
return
{
leftdots
:
false
,
url
:
baseUri
.
clone
().
addSearch
(
'page'
,
page
).
toString
(),
lowPages
:
[],
number
:
page
highPages
:
[
2
,
3
],
};
rightdots
:
true
,
};
last
:
5
,
checkRender
=
function
(
params
)
{
next
:
2
var
getPageNumber
,
paginator
,
view
;
view
=
makeView
([],
params
.
page
,
params
.
numPages
);
paginator
=
view
.
$
(
'.discussion-paginator'
);
expect
(
paginator
.
find
(
'.current-page'
).
text
()).
toEqual
(
params
.
page
.
toString
());
expect
(
paginator
.
find
(
'.first-page'
).
length
).
toBe
(
params
.
first
?
1
:
0
);
expect
(
paginator
.
find
(
'.previous-page'
).
length
).
toBe
(
params
.
previous
?
1
:
0
);
expect
(
paginator
.
find
(
'.previous-ellipses'
).
length
).
toBe
(
params
.
leftdots
?
1
:
0
);
expect
(
paginator
.
find
(
'.next-page'
).
length
).
toBe
(
params
.
next
?
1
:
0
);
expect
(
paginator
.
find
(
'.next-ellipses'
).
length
).
toBe
(
params
.
rightdots
?
1
:
0
);
expect
(
paginator
.
find
(
'.last-page'
).
length
).
toBe
(
params
.
last
?
1
:
0
);
getPageNumber
=
function
(
element
)
{
return
parseInt
(
$
(
element
).
text
(),
10
);
};
expect
(
_
.
map
(
paginator
.
find
(
'.lower-page a'
),
getPageNumber
)).
toEqual
(
params
.
lowPages
);
return
expect
(
_
.
map
(
paginator
.
find
(
'.higher-page a'
),
getPageNumber
)).
toEqual
(
params
.
highPages
);
};
it
(
'for one page'
,
function
()
{
return
checkRender
({
page
:
1
,
numPages
:
1
,
previous
:
null
,
first
:
null
,
leftdots
:
false
,
lowPages
:
[],
highPages
:
[],
rightdots
:
false
,
last
:
null
,
next
:
null
});
});
});
});
it
(
'for last page of three (max with no first)'
,
function
()
{
it
(
'for first page of three (max with no last)'
,
function
()
{
return
checkRender
({
return
checkRender
({
page
:
3
,
page
:
1
,
numPages
:
3
,
numPages
:
3
,
previous
:
2
,
previous
:
null
,
first
:
null
,
first
:
null
,
leftdots
:
false
,
leftdots
:
false
,
lowPages
:
[
1
,
2
],
lowPages
:
[],
highPages
:
[],
highPages
:
[
2
,
3
],
rightdots
:
false
,
rightdots
:
false
,
last
:
null
,
last
:
null
,
next
:
null
next
:
2
});
});
});
});
it
(
'for last page of four (has first but no dots)'
,
function
()
{
it
(
'for first page of four (has last but no dots)'
,
function
()
{
return
checkRender
({
return
checkRender
({
page
:
4
,
page
:
1
,
numPages
:
4
,
numPages
:
4
,
previous
:
3
,
previous
:
null
,
first
:
1
,
first
:
null
,
leftdots
:
false
,
leftdots
:
false
,
lowPages
:
[
2
,
3
],
lowPages
:
[],
highPages
:
[],
highPages
:
[
2
,
3
],
rightdots
:
false
,
rightdots
:
false
,
last
:
null
,
last
:
4
,
next
:
null
next
:
2
});
});
});
});
it
(
'for last page of five (has dots)'
,
function
()
{
it
(
'for first page of five (has dots)'
,
function
()
{
return
checkRender
({
return
checkRender
({
page
:
5
,
page
:
1
,
numPages
:
5
,
numPages
:
5
,
previous
:
4
,
previous
:
null
,
first
:
1
,
first
:
null
,
leftdots
:
true
,
leftdots
:
false
,
lowPages
:
[
3
,
4
],
lowPages
:
[],
highPages
:
[],
highPages
:
[
2
,
3
],
rightdots
:
false
,
rightdots
:
true
,
last
:
null
,
last
:
5
,
next
:
null
next
:
2
});
});
});
});
it
(
'for middle page of five (max with no first/last)'
,
function
()
{
it
(
'for last page of three (max with no first)'
,
function
()
{
return
checkRender
({
return
checkRender
({
page
:
3
,
page
:
3
,
numPages
:
5
,
numPages
:
3
,
previous
:
2
,
previous
:
2
,
first
:
null
,
first
:
null
,
leftdots
:
false
,
leftdots
:
false
,
lowPages
:
[
1
,
2
],
lowPages
:
[
1
,
2
],
highPages
:
[
4
,
5
],
highPages
:
[],
rightdots
:
false
,
rightdots
:
false
,
last
:
null
,
last
:
null
,
next
:
4
next
:
null
});
});
});
});
it
(
'for middle page of seven (has first/last but no dots)'
,
function
()
{
it
(
'for last page of four (has first but no dots)'
,
function
()
{
return
checkRender
({
return
checkRender
({
page
:
4
,
page
:
4
,
numPages
:
7
,
numPages
:
4
,
previous
:
3
,
previous
:
3
,
first
:
1
,
first
:
1
,
leftdots
:
false
,
leftdots
:
false
,
lowPages
:
[
2
,
3
],
lowPages
:
[
2
,
3
],
highPages
:
[
5
,
6
],
highPages
:
[],
rightdots
:
false
,
rightdots
:
false
,
last
:
7
,
last
:
null
,
next
:
5
next
:
null
});
});
});
});
it
(
'for middle page of nine (has dots)'
,
function
()
{
it
(
'for last page of five (has dots)'
,
function
()
{
return
checkRender
({
return
checkRender
({
page
:
5
,
page
:
5
,
numPages
:
9
,
numPages
:
5
,
previous
:
4
,
previous
:
4
,
first
:
1
,
first
:
1
,
leftdots
:
true
,
leftdots
:
true
,
lowPages
:
[
3
,
4
],
lowPages
:
[
3
,
4
],
highPages
:
[
6
,
7
],
highPages
:
[],
rightdots
:
true
,
rightdots
:
false
,
last
:
9
,
last
:
null
,
next
:
6
next
:
null
});
});
it
(
'for middle page of five (max with no first/last)'
,
function
()
{
return
checkRender
({
page
:
3
,
numPages
:
5
,
previous
:
2
,
first
:
null
,
leftdots
:
false
,
lowPages
:
[
1
,
2
],
highPages
:
[
4
,
5
],
rightdots
:
false
,
last
:
null
,
next
:
4
});
});
it
(
'for middle page of seven (has first/last but no dots)'
,
function
()
{
return
checkRender
({
page
:
4
,
numPages
:
7
,
previous
:
3
,
first
:
1
,
leftdots
:
false
,
lowPages
:
[
2
,
3
],
highPages
:
[
5
,
6
],
rightdots
:
false
,
last
:
7
,
next
:
5
});
});
it
(
'for middle page of nine (has dots)'
,
function
()
{
return
checkRender
({
page
:
5
,
numPages
:
9
,
previous
:
4
,
first
:
1
,
leftdots
:
true
,
lowPages
:
[
3
,
4
],
highPages
:
[
6
,
7
],
rightdots
:
true
,
last
:
9
,
next
:
6
});
});
});
});
});
});
describe
(
'pagination interaction'
,
function
()
{
describe
(
'pagination interaction'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
var
deferred
;
var
deferred
;
this
.
view
=
makeView
(
makeThreads
(
3
),
1
,
2
);
this
.
view
=
makeView
(
makeThreads
(
3
),
1
,
2
);
deferred
=
$
.
Deferred
();
deferred
=
$
.
Deferred
();
return
spyOn
(
$
,
'ajax'
).
and
.
returnValue
(
deferred
);
return
spyOn
(
$
,
'ajax'
).
and
.
returnValue
(
deferred
);
});
});
it
(
'causes updated rendering'
,
function
()
{
$
.
ajax
.
and
.
callFake
(
function
(
params
)
{
it
(
'causes updated rendering'
,
function
()
{
params
.
success
({
$
.
ajax
.
and
.
callFake
(
function
(
params
)
{
discussion_data
:
[
params
.
success
({
{
discussion_data
:
[
id
:
'on_page_42'
,
{
body
:
'dummy body'
id
:
'on_page_42'
,
body
:
'dummy body'
}
],
page
:
42
,
num_pages
:
99
});
return
{
always
:
function
()
{
}
}
],
};
page
:
42
,
num_pages
:
99
});
});
return
{
this
.
view
.
$
(
'.discussion-pagination a'
).
first
().
click
();
always
:
function
()
{
expect
(
this
.
view
.
$
(
'.current-page'
).
text
()).
toEqual
(
'42'
);
}
return
expect
(
this
.
view
.
$
(
'.last-page'
).
text
()).
toEqual
(
'99'
);
};
});
});
this
.
view
.
$
(
'.discussion-pagination a'
).
first
().
click
();
expect
(
this
.
view
.
$
(
'.current-page'
).
text
()).
toEqual
(
'42'
);
it
(
'handles AJAX errors'
,
function
()
{
return
expect
(
this
.
view
.
$
(
'.last-page'
).
text
()).
toEqual
(
'99
'
);
spyOn
(
DiscussionUtil
,
'discussionAlert
'
);
});
$
.
ajax
.
and
.
callFake
(
function
(
params
)
{
it
(
'handles AJAX errors'
,
function
()
{
params
.
error
();
spyOn
(
DiscussionUtil
,
'discussionAlert'
);
return
{
$
.
ajax
.
and
.
callFake
(
function
(
params
)
{
always
:
function
(
)
{
params
.
error
();
}
return
{
};
always
:
function
()
{
});
}
this
.
view
.
$
(
'.discussion-pagination a'
).
first
().
click
();
}
;
return
expect
(
DiscussionUtil
.
discussionAlert
).
toHaveBeenCalled
()
;
});
});
this
.
view
.
$
(
'.discussion-pagination a'
).
first
().
click
();
return
expect
(
DiscussionUtil
.
discussionAlert
).
toHaveBeenCalled
();
});
});
});
});
});
});
}).
call
(
this
);
lms/djangoapps/discussion/static/discussion/js/views/discussion_user_profile_view.js
View file @
6c540351
/* 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
);
common/static/common/templates/discussion
/user-profile.underscore
→
lms/djangoapps/discussion/static/discussion/templates
/user-profile.underscore
View file @
6c540351
<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"/>
lms/djangoapps/discussion/templates/discussion/discussion_board.html
View file @
6c540351
...
@@ -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>
...
...
lms/djangoapps/discussion/templates/discussion/discussion_profile_page.html
View file @
6c540351
<
%
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"
/>
lms/djangoapps/discussion/templates/discussion/maintenance.html
View file @
6c540351
## 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>
lms/djangoapps/discussion/templates/discussion/user_profile.html
deleted
100644 → 0
View file @
89f93df4
## 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"
/>
lms/djangoapps/discussion/tests/test_views.py
View file @
6c540351
...
@@ -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'
"group_name": "student_cohort"
'
)
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'
4;id": "{}"
;'
.
format
(
self
.
TEST_THREAD_ID
))
self
.
assertRegexpMatches
(
html
,
r'
9;id': '{}'
;'
.
format
(
self
.
TEST_THREAD_ID
))
self
.
assertRegexpMatches
(
html
,
r'
4;title": "{}"
;'
.
format
(
self
.
TEST_THREAD_TEXT
))
self
.
assertRegexpMatches
(
html
,
r'
9;title': '{}'
;'
.
format
(
self
.
TEST_THREAD_TEXT
))
self
.
assertRegexpMatches
(
html
,
r'
4;body": "{}"
;'
.
format
(
self
.
TEST_THREAD_TEXT
))
self
.
assertRegexpMatches
(
html
,
r'
9;body': '{}'
;'
.
format
(
self
.
TEST_THREAD_TEXT
))
self
.
assertRegexpMatches
(
html
,
r'
4;username": "{}"
;'
.
format
(
self
.
student
.
username
))
self
.
assertRegexpMatches
(
html
,
r'
9;username': u'{}'
;'
.
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'
,
...
...
lms/djangoapps/discussion/views.py
View file @
6c540351
...
@@ -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_profil
e.html'
,
context
)
return
render_to_response
(
'discussion/
discussion_profile_pag
e.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,
}
}
...
...
lms/djangoapps/django_comment_client/tests/group_id.py
View file @
6c540351
...
@@ -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'
"group_id": ([\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'
"group_name": "([^&]*)"
'
,
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
)
...
...
lms/djangoapps/teams/static/teams/js/spec/views/team_discussion_spec.js
View file @
6c540351
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
();
...
...
lms/djangoapps/teams/static/teams/js/spec/views/team_profile_spec.js
View file @
6c540351
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.'
);
);
});
});
...
...
lms/djangoapps/teams/static/teams/js/views/team_discussion.js
View file @
6c540351
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
(
function
(
define
)
{
(
function
(
define
)
{
'use strict'
;
'use strict'
;
define
([
'backbone'
,
'underscore'
,
'gettext'
,
'
DiscussionModuleV
iew'
],
define
([
'backbone'
,
'underscore'
,
'gettext'
,
'
common/js/discussion/discussion_module_v
iew'
],
function
(
Backbone
,
_
,
gettext
,
DiscussionModuleView
)
{
function
(
Backbone
,
_
,
gettext
,
DiscussionModuleView
)
{
var
TeamDiscussionView
=
Backbone
.
View
.
extend
({
var
TeamDiscussionView
=
Backbone
.
View
.
extend
({
initialize
:
function
()
{
initialize
:
function
()
{
...
...
lms/djangoapps/teams/templates/teams/teams.html
View file @
6c540351
...
@@ -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({
...
...
lms/static/discussion
0 → 120000
View file @
6c540351
../djangoapps/discussion/static/discussion
\ No newline at end of file
lms/static/js/spec/courseware/link_clicked_events_spec.js
View file @
6c540351
...
@@ -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
()
});
});
});
});
...
...
lms/static/karma_lms.conf.js
View file @
6c540351
...
@@ -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
:
[
...
...
lms/static/lms/js/build.js
View file @
6c540351
...
@@ -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:'
,
'
DiscussionModuleV
iew'
:
'empty:'
,
'
common/js/discussion/discussion_module_v
iew'
:
'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
...
...
lms/static/lms/js/spec/main.js
View file @
6c540351
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
paths
:
{
paths
:
{
'gettext'
:
'xmodule_js/common_static/js/test/i18n'
,
'gettext'
:
'xmodule_js/common_static/js/test/i18n'
,
'codemirror'
:
'xmodule_js/common_static/js/vendor/CodeMirror/codemirror'
,
'codemirror'
:
'xmodule_js/common_static/js/vendor/CodeMirror/codemirror'
,
'jquery'
:
'
xmodule_js/common_static/
common/js/vendor/jquery'
,
'jquery'
:
'common/js/vendor/jquery'
,
'jquery-migrate'
:
'
xmodule_js/common_static/
common/js/vendor/jquery-migrate'
,
'jquery-migrate'
:
'common/js/vendor/jquery-migrate'
,
'jquery.ui'
:
'xmodule_js/common_static/js/vendor/jquery-ui.min'
,
'jquery.ui'
:
'xmodule_js/common_static/js/vendor/jquery-ui.min'
,
'jquery.eventDrag'
:
'xmodule_js/common_static/js/vendor/jquery.event.drag-2.2'
,
'jquery.eventDrag'
:
'xmodule_js/common_static/js/vendor/jquery.event.drag-2.2'
,
'jquery.flot'
:
'xmodule_js/common_static/js/vendor/flot/jquery.flot.min'
,
'jquery.flot'
:
'xmodule_js/common_static/js/vendor/flot/jquery.flot.min'
,
...
@@ -87,9 +87,6 @@
...
@@ -87,9 +87,6 @@
'js/student_profile/views/learner_profile_view'
:
'js/student_profile/views/learner_profile_view'
,
'js/student_profile/views/learner_profile_view'
:
'js/student_profile/views/learner_profile_view'
,
'js/ccx/schedule'
:
'js/ccx/schedule'
,
'js/ccx/schedule'
:
'js/ccx/schedule'
,
// Discussion classes loaded explicitly until they are converted to use RequireJS
'DiscussionModuleView'
:
'xmodule_js/common_static/common/js/discussion/discussion_module_view'
,
'js/bookmarks/collections/bookmarks'
:
'js/bookmarks/collections/bookmarks'
,
'js/bookmarks/collections/bookmarks'
:
'js/bookmarks/collections/bookmarks'
,
'js/bookmarks/models/bookmark'
:
'js/bookmarks/models/bookmark'
,
'js/bookmarks/models/bookmark'
:
'js/bookmarks/models/bookmark'
,
'js/bookmarks/views/bookmarks_list_button'
:
'js/bookmarks/views/bookmarks_list_button'
,
'js/bookmarks/views/bookmarks_list_button'
:
'js/bookmarks/views/bookmarks_list_button'
,
...
@@ -517,7 +514,7 @@
...
@@ -517,7 +514,7 @@
exports
:
'Slick'
exports
:
'Slick'
},
},
// Discussions
// Discussions
'
xmodule_js/common_static/
common/js/discussion/utils'
:
{
'common/js/discussion/utils'
:
{
deps
:
[
deps
:
[
'jquery'
,
'jquery'
,
'jquery.timeago'
,
'jquery.timeago'
,
...
@@ -536,135 +533,128 @@
...
@@ -536,135 +533,128 @@
});
});
}
}
},
},
'
xmodule_js/common_static/
common/js/discussion/content'
:
{
'common/js/discussion/content'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'Content'
exports
:
'Content'
},
},
'
xmodule_js/common_static/
common/js/discussion/discussion'
:
{
'common/js/discussion/discussion'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
,
'common/js/discussion/utils'
,
'xmodule_js/common_static/common/js/discussion/content'
'xmodule_js/common_static/common/js/discussion/content'
],
],
exports
:
'Discussion'
exports
:
'Discussion'
},
},
'
xmodule_js/common_static/common/js/discussion/models
/discussion_course_settings'
:
{
'
common/js/discussion
/discussion_course_settings'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionCourseSettings'
exports
:
'DiscussionCourseSettings'
},
},
'
xmodule_js/common_static/
common/js/discussion/models/discussion_user'
:
{
'common/js/discussion/models/discussion_user'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionUser'
exports
:
'DiscussionUser'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/discussion_content_view'
:
{
'common/js/discussion/views/discussion_content_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionContentView'
exports
:
'DiscussionContentView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/discussion_thread_edit_view'
:
{
'common/js/discussion/views/discussion_thread_edit_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionThreadEditView'
exports
:
'DiscussionThreadEditView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/discussion_thread_list_view'
:
{
'common/js/discussion/views/discussion_thread_list_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionThreadListView'
exports
:
'DiscussionThreadListView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/discussion_thread_profile_view'
:
{
'common/js/discussion/views/discussion_thread_profile_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionThreadProfileView'
exports
:
'DiscussionThreadProfileView'
},
},
'xmodule_js/common_static/common/js/discussion/views/discussion_thread_show_view'
:
{
'xmodule_js/common_static/common/js/discussion/views/discussion_thread_show_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
,
'common/js/discussion/utils'
,
'
xmodule_js/common_static/
common/js/discussion/views/discussion_content_view'
'common/js/discussion/views/discussion_content_view'
],
],
exports
:
'DiscussionThreadShowView'
exports
:
'DiscussionThreadShowView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/discussion_thread_view'
:
{
'common/js/discussion/views/discussion_thread_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
,
'common/js/discussion/utils'
,
'
xmodule_js/common_static/
common/js/discussion/views/discussion_content_view'
'common/js/discussion/views/discussion_content_view'
],
],
exports
:
'DiscussionThreadView'
exports
:
'DiscussionThreadView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/discussion_topic_menu_view'
:
{
'common/js/discussion/views/discussion_topic_menu_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionTopicMenuView'
exports
:
'DiscussionTopicMenuView'
},
},
'xmodule_js/common_static/common/js/discussion/views/discussion_user_profile_view'
:
{
'common/js/discussion/views/new_post_view'
:
{
deps
:
[
'xmodule_js/common_static/common/js/discussion/utils'
],
exports
:
'DiscussionUserProfileView'
},
'xmodule_js/common_static/common/js/discussion/views/new_post_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'NewPostView'
exports
:
'NewPostView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/thread_response_edit_view'
:
{
'common/js/discussion/views/thread_response_edit_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'ThreadResponseEditView'
exports
:
'ThreadResponseEditView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/thread_response_show_view'
:
{
'common/js/discussion/views/thread_response_show_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'ThreadResponseShowView'
exports
:
'ThreadResponseShowView'
},
},
'
xmodule_js/common_static/
common/js/discussion/views/thread_response_view'
:
{
'common/js/discussion/views/thread_response_view'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'ThreadResponseView'
exports
:
'ThreadResponseView'
},
},
'
DiscussionModuleV
iew'
:
{
'
common/js/discussion/discussion_module_v
iew'
:
{
deps
:
[
deps
:
[
'jquery'
,
'jquery'
,
'underscore'
,
'underscore'
,
'backbone'
,
'backbone'
,
'gettext'
,
'gettext'
,
'URI'
,
'URI'
,
'xmodule_js/common_static/common/js/discussion/content'
,
'common/js/discussion/content'
,
'xmodule_js/common_static/common/js/discussion/discussion'
,
'common/js/discussion/discussion'
,
'xmodule_js/common_static/common/js/discussion/utils'
,
'common/js/discussion/models/discussion_course_settings'
,
'xmodule_js/common_static/common/js/discussion/models/discussion_course_settings'
,
'common/js/discussion/models/discussion_user'
,
'xmodule_js/common_static/common/js/discussion/models/discussion_user'
,
'common/js/discussion/utils'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_content_view'
,
'common/js/discussion/views/discussion_content_view'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_thread_edit_view'
,
'common/js/discussion/views/discussion_thread_edit_view'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_thread_list_view'
,
'common/js/discussion/views/discussion_thread_list_view'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_thread_profile_view'
,
'common/js/discussion/views/discussion_thread_profile_view'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_thread_show_view'
,
'common/js/discussion/views/discussion_thread_show_view'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_thread_view'
,
'common/js/discussion/views/discussion_thread_view'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_topic_menu_view'
,
'common/js/discussion/views/discussion_topic_menu_view'
,
'xmodule_js/common_static/common/js/discussion/views/discussion_user_profile_view'
,
'common/js/discussion/views/new_post_view'
,
'xmodule_js/common_static/common/js/discussion/views/new_post_view'
,
'common/js/discussion/views/thread_response_edit_view'
,
'xmodule_js/common_static/common/js/discussion/views/thread_response_edit_view'
,
'common/js/discussion/views/thread_response_show_view'
,
'xmodule_js/common_static/common/js/discussion/views/thread_response_show_view'
,
'common/js/discussion/views/thread_response_view'
'xmodule_js/common_static/common/js/discussion/views/thread_response_view'
],
],
exports
:
'DiscussionModuleView'
exports
:
'DiscussionModuleView'
},
},
'
xmodule_js/common_static/
common/js/spec_helpers/discussion_spec_helper'
:
{
'common/js/spec_helpers/discussion_spec_helper'
:
{
deps
:
[
deps
:
[
'
xmodule_js/common_static/
common/js/discussion/utils'
'common/js/discussion/utils'
],
],
exports
:
'DiscussionSpecHelper'
exports
:
'DiscussionSpecHelper'
}
}
...
@@ -672,6 +662,9 @@
...
@@ -672,6 +662,9 @@
});
});
var
testFiles
=
[
var
testFiles
=
[
'discussion/js/spec/discussion_board_factory_spec.js'
,
'discussion/js/spec/discussion_profile_page_factory_spec.js'
,
'discussion/js/spec/views/discussion_user_profile_view_spec.js'
,
'lms/js/spec/preview/preview_factory_spec.js'
,
'lms/js/spec/preview/preview_factory_spec.js'
,
'js/spec/api_admin/catalog_preview_spec.js'
,
'js/spec/api_admin/catalog_preview_spec.js'
,
'js/spec/courseware/bookmark_button_view_spec.js'
,
'js/spec/courseware/bookmark_button_view_spec.js'
,
...
...
lms/static/sass/discussion/_build.scss
View file @
6c540351
...
@@ -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'
;
...
...
lms/static/sass/discussion/_discussion.scss
View file @
6c540351
...
@@ -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
{
...
...
lms/static/sass/discussion/_layouts.scss
View file @
6c540351
// 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
;
}
}
lms/static/sass/discussion/_mixins.scss
View file @
6c540351
...
@@ -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
;
...
...
lms/static/sass/discussion/elements/_actions.scss
View file @
6c540351
...
@@ -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
;
}
}
...
...
lms/static/sass/discussion/elements/_editor.scss
View file @
6c540351
...
@@ -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"
]
{
...
...
lms/static/sass/discussion/elements/_navigation.scss
View file @
6c540351
...
@@ -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
;
...
...
lms/static/sass/discussion/utilities/_developer.scss
View file @
6c540351
...
@@ -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
{
...
...
lms/static/sass/discussion/utilities/_shame.scss
View file @
6c540351
...
@@ -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
...
...
lms/static/sass/discussion/utilities/_v1-compatibility.scss
View file @
6c540351
...
@@ -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
...
...
lms/static/sass/discussion/utilities/_variables-v1.scss
View file @
6c540351
...
@@ -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
;
lms/static/sass/discussion/utilities/_variables-v2.scss
View file @
6c540351
...
@@ -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
;
lms/static/sass/discussion/views/_create-edit-post.scss
View file @
6c540351
...
@@ -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
{
...
...
lms/static/sass/discussion/views/_home.scss
View file @
6c540351
...
@@ -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
{
...
...
lms/static/sass/discussion/views/_response.scss
View file @
6c540351
...
@@ -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
;
}
}
...
...
lms/static/sass/discussion/views/_thread.scss
View file @
6c540351
...
@@ -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
);
}
}
}
}
}
}
...
...
lms/static/sass/shared-v2/_layouts.scss
View file @
6c540351
...
@@ -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
;
}
}
}
}
lms/templates/courseware/courseware-chromeless.html
View file @
6c540351
...
@@ -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:
...
...
lms/templates/courseware/courseware.html
View file @
6c540351
...
@@ -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
...
...
lms/templates/discussion/_discussion_course_navigation.html
deleted
100644 → 0
View file @
89f93df4
<
%
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>
lms/templates/discussion/_js_body_dependencies.html
View file @
6c540351
<
%
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>
lms/templates/discussion/_underscore_templates.html
View file @
6c540351
...
@@ -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
...
...
lms/templates/ux/reference/course-skeleton.html
View file @
6c540351
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment