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
4c4476a7
Commit
4c4476a7
authored
Aug 05, 2016
by
Brian Jacobel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lint issues on feature branch
parent
a60d456f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
94 additions
and
104 deletions
+94
-104
common/static/common/js/discussion/views/discussion_thread_list_view.js
+48
-42
common/static/common/js/spec/discussion/view/discussion_thread_list_view_spec.js
+29
-33
common/static/common/js/spec_helpers/discussion_spec_helper.js
+9
-12
lms/djangoapps/discussion/static/discussion/js/discussion_board_factory.js
+1
-1
lms/djangoapps/discussion/static/discussion/js/discussion_profile_page_factory.js
+3
-4
lms/djangoapps/discussion/static/discussion/js/spec/views/discussion_user_profile_view_spec.js
+1
-9
lms/djangoapps/discussion/static/discussion/js/views/discussion_fake_breadcrumbs.js
+1
-1
lms/static/js/spec/courseware/link_clicked_events_spec.js
+1
-1
lms/static/lms/js/spec/main.js
+1
-1
No files found.
common/static/common/js/discussion/views/discussion_thread_list_view.js
View file @
4c4476a7
/* globals Content, Discussion, DiscussionUtil */
/* globals
_, Backbone,
Content, Discussion, DiscussionUtil */
(
function
()
{
'use strict'
;
var
__hasProp
=
{}.
hasOwnProperty
,
...
...
@@ -156,16 +156,13 @@
/**
* Creates search alert model and adds it to collection
* @param message - alert message
* @param css
_c
lass - Allows setting custom css class for a message. This can be used to style messages
*
of different types differently (i.e. other background, completely hide, etc.)
* @param css
C
lass - Allows setting custom css class for a message. This can be used to style messages
* of different types differently (i.e. other background, completely hide, etc.)
* @returns {Backbone.Model}
*/
DiscussionThreadListView
.
prototype
.
addSearchAlert
=
function
(
message
,
css
_c
lass
)
{
DiscussionThreadListView
.
prototype
.
addSearchAlert
=
function
(
message
,
css
C
lass
)
{
var
m
;
if
(
typeof
css_class
===
'undefined'
||
css_class
===
null
)
{
css_class
=
''
;
}
m
=
new
Backbone
.
Model
({
'message'
:
message
,
'css_class'
:
css_class
});
m
=
new
Backbone
.
Model
({
message
:
message
,
css_class
:
cssClass
||
''
});
this
.
searchAlertCollection
.
add
(
m
);
return
m
;
};
...
...
@@ -179,16 +176,16 @@
};
DiscussionThreadListView
.
prototype
.
reloadDisplayedCollection
=
function
(
thread
)
{
var
active
,
$content
,
current_el
,
thread_i
d
;
var
active
,
$content
,
$currentElement
,
threadI
d
;
this
.
clearSearchAlerts
();
thread
_i
d
=
thread
.
get
(
'id'
);
thread
I
d
=
thread
.
get
(
'id'
);
$content
=
this
.
renderThread
(
thread
);
current_el
=
this
.
$
(
'.forum-nav-thread[data-id='
+
thread_i
d
+
']'
);
active
=
current_el
.
has
(
'.forum-nav-thread-link.is-active'
).
length
!==
0
;
current_el
.
replaceWith
(
$content
);
$currentElement
=
this
.
$
(
'.forum-nav-thread[data-id='
+
threadI
d
+
']'
);
active
=
$currentElement
.
has
(
'.forum-nav-thread-link.is-active'
).
length
!==
0
;
$currentElement
.
replaceWith
(
$content
);
this
.
showMetadataAccordingToSort
();
if
(
active
)
{
return
this
.
setActiveThread
(
thread
_i
d
);
return
this
.
setActiveThread
(
thread
I
d
);
}
};
...
...
@@ -198,14 +195,14 @@
DiscussionThreadListView
.
prototype
.
addAndSelectThread
=
function
(
thread
)
{
var
commentable
_i
d
,
menuItem
,
var
commentable
I
d
,
menuItem
,
self
=
this
;
commentable
_i
d
=
thread
.
get
(
'commentable_id'
);
commentable
I
d
=
thread
.
get
(
'commentable_id'
);
menuItem
=
this
.
$
(
'.forum-nav-browse-menu-item[data-discussion-id]'
).
filter
(
function
()
{
return
$
(
this
).
data
(
'discussion-id'
)
===
commentable
_i
d
;
return
$
(
this
).
data
(
'discussion-id'
)
===
commentable
I
d
;
});
this
.
setCurrentTopicDisplay
(
this
.
getPathText
(
menuItem
));
return
this
.
retrieveDiscussion
(
commentable
_i
d
,
function
()
{
return
this
.
retrieveDiscussion
(
commentable
I
d
,
function
()
{
return
self
.
trigger
(
'thread:created'
,
thread
.
get
(
'id'
));
});
};
...
...
@@ -403,27 +400,28 @@
this
.
trigger
(
'thread:removed'
,
thread
);
};
DiscussionThreadListView
.
prototype
.
setActiveThread
=
function
(
thread
_i
d
)
{
DiscussionThreadListView
.
prototype
.
setActiveThread
=
function
(
thread
I
d
)
{
var
$srElem
;
this
.
$
(
'.forum-nav-thread-link'
).
find
(
'.sr'
).
remove
();
this
.
$
(
".forum-nav-thread[data-id!='"
+
thread
_i
d
+
"'] .forum-nav-thread-link"
)
this
.
$
(
".forum-nav-thread[data-id!='"
+
thread
I
d
+
"'] .forum-nav-thread-link"
)
.
removeClass
(
'is-active'
);
$srElem
=
edx
.
HtmlUtils
.
joinHtml
(
edx
.
HtmlUtils
.
HTML
(
'<span class="sr">'
),
edx
.
HtmlUtils
.
ensureHtml
(
gettext
(
'Current conversation'
)),
edx
.
HtmlUtils
.
HTML
(
'</span>'
)
).
toString
();
this
.
$
(
".forum-nav-thread[data-id='"
+
thread
_i
d
+
"'] .forum-nav-thread-link"
)
this
.
$
(
".forum-nav-thread[data-id='"
+
thread
I
d
+
"'] .forum-nav-thread-link"
)
.
addClass
(
'is-active'
).
find
(
'.forum-nav-thread-wrapper-1'
)
.
prepend
(
$srElem
);
};
DiscussionThreadListView
.
prototype
.
goHome
=
function
()
{
var
url
,
$t
pl_c
ontent
;
var
url
,
$t
emplateC
ontent
;
this
.
template
=
_
.
template
(
$
(
'#discussion-home-template'
).
html
());
$tpl_content
=
$
(
this
.
template
());
$
(
'.forum-content'
).
empty
().
append
(
$tpl_content
);
$
(
'.forum-nav-thread-list a'
).
removeClass
(
'is-active'
).
find
(
'.sr'
).
remove
();
$templateContent
=
$
(
this
.
template
());
$
(
'.forum-content'
).
empty
().
append
(
$templateContent
);
$
(
'.forum-nav-thread-list a'
).
removeClass
(
'is-active'
).
find
(
'.sr'
)
.
remove
();
$
(
'input.email-setting'
).
bind
(
'click'
,
this
.
updateEmailNotifications
);
url
=
DiscussionUtil
.
urlFor
(
'notifications_status'
,
window
.
user
.
get
(
'id'
));
DiscussionUtil
.
safeAjax
({
...
...
@@ -480,12 +478,19 @@
};
DiscussionThreadListView
.
prototype
.
getBreadcrumbText
=
function
(
$item
)
{
var
subTopic
=
$
(
'.forum-nav-browse-title'
,
$item
).
first
().
text
().
trim
(),
$parentSubMenus
=
$item
.
parents
(
'.forum-nav-browse-submenu'
),
crumbs
=
[];
var
$parentSubMenus
=
$item
.
parents
(
'.forum-nav-browse-submenu'
),
crumbs
=
[],
subTopic
=
$
(
'.forum-nav-browse-title'
,
$item
)
.
first
()
.
text
()
.
trim
();
$parentSubMenus
.
each
(
function
(
i
,
el
)
{
crumbs
.
push
(
$
(
el
).
siblings
(
'.forum-nav-browse-title'
).
first
().
text
().
trim
());
crumbs
.
push
(
$
(
el
).
siblings
(
'.forum-nav-browse-title'
)
.
first
()
.
text
()
.
trim
()
);
});
if
(
subTopic
!==
'All Discussions'
)
{
...
...
@@ -505,15 +510,15 @@
}
else
{
items
.
hide
();
return
items
.
each
(
function
(
i
,
item
)
{
var
path
,
pathText
;
item
=
$
(
item
);
if
(
!
item
.
is
(
':visible'
))
{
pathText
=
self
.
getPathText
(
item
).
toLowerCase
();
var
path
,
pathText
,
$
item
=
$
(
item
);
if
(
!
$
item
.
is
(
':visible'
))
{
pathText
=
self
.
getPathText
(
$
item
).
toLowerCase
();
if
(
query
.
split
(
' '
).
every
(
function
(
term
)
{
return
pathText
.
search
(
term
.
toLowerCase
())
!==
-
1
;
}))
{
path
=
item
.
parents
(
'.forum-nav-browse-menu-item'
).
andSelf
();
return
path
.
add
(
item
.
find
(
'.forum-nav-browse-menu-item'
)).
show
();
path
=
$
item
.
parents
(
'.forum-nav-browse-menu-item'
).
andSelf
();
return
path
.
add
(
$
item
.
find
(
'.forum-nav-browse-menu-item'
)).
show
();
}
}
});
...
...
@@ -559,7 +564,7 @@
_results
.
push
(
x
.
replace
(
/^
\s
+|
\s
+$/g
,
''
));
}
return
_results
;
}
)(
);
}
()
);
prefix
=
''
;
while
(
path
.
length
>
1
)
{
prefix
=
gettext
(
'…'
)
+
'/'
;
...
...
@@ -619,9 +624,10 @@
return
this
.
retrieveFirstPage
();
};
DiscussionThreadListView
.
prototype
.
retrieveDiscussion
=
function
(
discussion_id
,
callback
)
{
var
url
,
self
=
this
;
url
=
DiscussionUtil
.
urlFor
(
'retrieve_discussion'
,
discussion_id
);
DiscussionThreadListView
.
prototype
.
retrieveDiscussion
=
function
(
discussionId
,
callback
)
{
var
url
,
self
=
this
;
url
=
DiscussionUtil
.
urlFor
(
'retrieve_discussion'
,
discussionId
);
return
DiscussionUtil
.
safeAjax
({
url
:
url
,
type
:
'GET'
,
...
...
@@ -671,7 +677,7 @@
this
.
hideBrowseMenu
();
this
.
setCurrentTopicDisplay
(
gettext
(
'Search Results'
));
text
=
this
.
$
(
'.forum-nav-search-input'
).
val
();
return
this
.
searchFor
(
text
);
this
.
searchFor
(
text
);
}
};
...
...
@@ -730,10 +736,10 @@
message
=
edx
.
HtmlUtils
.
interpolateHtml
(
noResponseMsg
,
{
'original_query'
:
edx
.
HtmlUtils
.
joinHtml
(
original_query
:
edx
.
HtmlUtils
.
joinHtml
(
edx
.
HtmlUtils
.
HTML
(
'<em>'
),
text
,
edx
.
HtmlUtils
.
HTML
(
'</em>'
)
),
'suggested_query'
:
edx
.
HtmlUtils
.
joinHtml
(
suggested_query
:
edx
.
HtmlUtils
.
joinHtml
(
edx
.
HtmlUtils
.
HTML
(
'<em>'
),
response
.
corrected_text
,
edx
.
HtmlUtils
.
HTML
(
'</em>'
)
...
...
common/static/common/js/spec/discussion/view/discussion_thread_list_view_spec.js
View file @
4c4476a7
/* globals
Discussion, DiscussionCourseSettings, DiscussionViewSpecHelper, DiscussionSpecHelper,
_,
Discussion, DiscussionCourseSettings, DiscussionViewSpecHelper, DiscussionSpecHelper,
DiscussionThreadListView, DiscussionUtil, Thread
*/
(
function
()
{
...
...
@@ -156,22 +156,22 @@
return
expect
(
this
.
view
.
$
(
'.forum-nav-filter-main-control'
).
val
()).
toEqual
(
'all'
);
});
checkThreadsOrdering
=
function
(
view
,
sort
_o
rder
,
type
)
{
checkThreadsOrdering
=
function
(
view
,
sort
O
rder
,
type
)
{
expect
(
view
.
$el
.
find
(
'.forum-nav-thread'
).
children
().
length
).
toEqual
(
4
);
expect
(
view
.
$el
.
find
(
'.forum-nav-thread:nth-child(1) .forum-nav-thread-title'
).
text
())
.
toEqual
(
sort
_o
rder
[
0
]);
.
toEqual
(
sort
O
rder
[
0
]);
expect
(
view
.
$el
.
find
(
'.forum-nav-thread:nth-child(2) .forum-nav-thread-title'
).
text
())
.
toEqual
(
sort
_o
rder
[
1
]);
.
toEqual
(
sort
O
rder
[
1
]);
expect
(
view
.
$el
.
find
(
'.forum-nav-thread:nth-child(3) .forum-nav-thread-title'
).
text
())
.
toEqual
(
sort
_o
rder
[
2
]);
.
toEqual
(
sort
O
rder
[
2
]);
expect
(
view
.
$el
.
find
(
'.forum-nav-thread:nth-child(4) .forum-nav-thread-title'
).
text
())
.
toEqual
(
sort
_o
rder
[
3
]);
.
toEqual
(
sort
O
rder
[
3
]);
return
expect
(
view
.
$el
.
find
(
'.forum-nav-sort-control'
).
val
()).
toEqual
(
type
);
};
describe
(
'thread rendering should be correct'
,
function
()
{
var
checkRender
;
checkRender
=
function
(
threads
,
type
,
sort
_o
rder
)
{
checkRender
=
function
(
threads
,
type
,
sort
O
rder
)
{
var
discussion
,
view
;
discussion
=
new
Discussion
(
_
.
map
(
threads
,
function
(
thread
)
{
return
new
Thread
(
thread
);
...
...
@@ -181,56 +181,56 @@
});
view
=
makeView
(
discussion
);
view
.
render
();
checkThreadsOrdering
(
view
,
sort
_o
rder
,
type
);
checkThreadsOrdering
(
view
,
sort
O
rder
,
type
);
expect
(
view
.
$el
.
find
(
'.forum-nav-thread-comments-count:visible'
).
length
)
.
toEqual
(
type
===
'votes'
?
0
:
4
);
expect
(
view
.
$el
.
find
(
'.forum-nav-thread-votes-count:visible'
).
length
)
.
toEqual
(
type
===
'votes'
?
4
:
0
);
if
(
type
===
'votes'
)
{
return
expect
(
_
.
map
(
view
.
$el
.
find
(
'.forum-nav-thread-votes-count'
),
function
(
element
)
{
expect
(
_
.
map
(
view
.
$el
.
find
(
'.forum-nav-thread-votes-count'
),
function
(
element
)
{
return
$
(
element
).
text
().
trim
();
})).
toEqual
([
'+25 votes'
,
'+20 votes'
,
'+42 votes'
,
'+12 votes'
]);
}
};
it
(
'with sort preference activity'
,
function
()
{
return
checkRender
(
this
.
threads
,
'activity'
,
[
'Thread1'
,
'Thread2'
,
'Thread3'
,
'Thread4'
]);
checkRender
(
this
.
threads
,
'activity'
,
[
'Thread1'
,
'Thread2'
,
'Thread3'
,
'Thread4'
]);
});
it
(
'with sort preference votes'
,
function
()
{
return
checkRender
(
this
.
threads
,
'votes'
,
[
'Thread4'
,
'Thread1'
,
'Thread2'
,
'Thread3'
]);
checkRender
(
this
.
threads
,
'votes'
,
[
'Thread4'
,
'Thread1'
,
'Thread2'
,
'Thread3'
]);
});
it
(
'with sort preference comments'
,
function
()
{
return
checkRender
(
this
.
threads
,
'comments'
,
[
'Thread1'
,
'Thread4'
,
'Thread3'
,
'Thread2'
]);
checkRender
(
this
.
threads
,
'comments'
,
[
'Thread1'
,
'Thread4'
,
'Thread3'
,
'Thread2'
]);
});
});
describe
(
'Sort change should be correct'
,
function
()
{
var
changeSorting
;
changeSorting
=
function
(
threads
,
selected
_type
,
new_type
,
sort_o
rder
)
{
var
discussion
,
sortControl
,
sorted
_t
hreads
,
view
;
changeSorting
=
function
(
threads
,
selected
Type
,
newType
,
sortO
rder
)
{
var
discussion
,
sortControl
,
sorted
T
hreads
,
view
;
discussion
=
new
Discussion
(
_
.
map
(
threads
,
function
(
thread
)
{
return
new
Thread
(
thread
);
}),
{
pages
:
1
,
sort
:
selected
_t
ype
sort
:
selected
T
ype
});
view
=
makeView
(
discussion
);
view
.
render
();
sortControl
=
view
.
$el
.
find
(
'.forum-nav-sort-control'
);
expect
(
sortControl
.
val
()).
toEqual
(
selected
_t
ype
);
sorted
_t
hreads
=
[];
if
(
new
_t
ype
===
'activity'
)
{
sorted
_t
hreads
=
[
threads
[
0
],
threads
[
3
],
threads
[
1
],
threads
[
2
]];
}
else
if
(
new
_t
ype
===
'comments'
)
{
sorted
_t
hreads
=
[
threads
[
0
],
threads
[
3
],
threads
[
2
],
threads
[
1
]];
}
else
if
(
new
_t
ype
===
'votes'
)
{
sorted
_t
hreads
=
[
threads
[
3
],
threads
[
0
],
threads
[
1
],
threads
[
2
]];
expect
(
sortControl
.
val
()).
toEqual
(
selected
T
ype
);
sorted
T
hreads
=
[];
if
(
new
T
ype
===
'activity'
)
{
sorted
T
hreads
=
[
threads
[
0
],
threads
[
3
],
threads
[
1
],
threads
[
2
]];
}
else
if
(
new
T
ype
===
'comments'
)
{
sorted
T
hreads
=
[
threads
[
0
],
threads
[
3
],
threads
[
2
],
threads
[
1
]];
}
else
if
(
new
T
ype
===
'votes'
)
{
sorted
T
hreads
=
[
threads
[
3
],
threads
[
0
],
threads
[
1
],
threads
[
2
]];
}
$
.
ajax
.
and
.
callFake
(
function
(
params
)
{
params
.
success
({
'discussion_data'
:
sorted_t
hreads
,
discussion_data
:
sortedT
hreads
,
page
:
1
,
num_pages
:
1
});
...
...
@@ -239,9 +239,9 @@
}
};
});
sortControl
.
val
(
new
_t
ype
).
change
();
sortControl
.
val
(
new
T
ype
).
change
();
expect
(
$
.
ajax
).
toHaveBeenCalled
();
checkThreadsOrdering
(
view
,
sort
_order
,
new_t
ype
);
checkThreadsOrdering
(
view
,
sort
Order
,
newT
ype
);
};
it
(
'with sort preference activity'
,
function
()
{
...
...
@@ -290,7 +290,7 @@
});
it
(
'renders search alert with custom class'
,
function
()
{
var
foo
,
messages
;
var
messages
;
testAlertMessages
([]);
this
.
view
.
addSearchAlert
(
'foo'
,
'custom-class'
);
...
...
@@ -299,7 +299,7 @@
expect
(
messages
[
0
].
text
).
toEqual
(
'foo'
);
expect
(
messages
[
0
].
css_class
).
toEqual
(
'search-alert custom-class'
);
foo
=
this
.
view
.
addSearchAlert
(
'bar'
,
'other-class'
);
this
.
view
.
addSearchAlert
(
'bar'
,
'other-class'
);
messages
=
getAlertMessagesAndClasses
();
expect
(
messages
.
length
).
toEqual
(
2
);
...
...
@@ -572,11 +572,7 @@
});
describe
(
'when shown'
,
function
()
{
beforeEach
(
function
()
{
return
$
(
'.forum-nav-browse'
).
click
();
});
it
(
'should hide when header button is clicked'
,
function
()
{
it
(
'should show again when header button is clicked'
,
function
()
{
$
(
'.forum-nav-browse'
).
click
();
return
expectBrowseMenuVisible
(
false
);
});
...
...
common/static/common/js/spec_helpers/discussion_spec_helper.js
View file @
4c4476a7
...
...
@@ -22,18 +22,18 @@
DiscussionSpecHelper
.
getTestRoleInfo
=
function
()
{
return
{
'Moderator'
:
[],
'Administrator'
:
[],
Moderator
:
[],
Administrator
:
[],
'Community TA'
:
[]
};
};
DiscussionSpecHelper
.
makeTA
=
function
()
{
return
DiscussionUtil
.
roleIds
[
'Community TA'
].
push
(
parseInt
(
DiscussionUtil
.
getUser
().
id
));
return
DiscussionUtil
.
roleIds
[
'Community TA'
].
push
(
parseInt
(
DiscussionUtil
.
getUser
().
id
,
10
));
};
DiscussionSpecHelper
.
makeModerator
=
function
()
{
return
DiscussionUtil
.
roleIds
.
Moderator
.
push
(
parseInt
(
DiscussionUtil
.
getUser
().
id
));
return
DiscussionUtil
.
roleIds
.
Moderator
.
push
(
parseInt
(
DiscussionUtil
.
getUser
().
id
,
10
));
};
DiscussionSpecHelper
.
makeAjaxSpy
=
function
(
fakeAjax
)
{
...
...
@@ -50,25 +50,22 @@
return
jasmine
.
createSpyObj
(
'event'
,
[
'preventDefault'
,
'target'
]);
};
DiscussionSpecHelper
.
makeCourseSettings
=
function
(
isCohorted
)
{
if
(
typeof
isCohorted
===
'undefined'
||
isCohorted
===
null
)
{
isCohorted
=
true
;
}
DiscussionSpecHelper
.
makeCourseSettings
=
function
()
{
return
new
DiscussionCourseSettings
({
category_map
:
{
children
:
[
'Test Topic'
,
'Other Topic'
],
entries
:
{
'Test Topic'
:
{
is_cohorted
:
isCohorted
,
is_cohorted
:
true
,
id
:
'test_topic'
},
'Other Topic'
:
{
is_cohorted
:
isCohorted
,
is_cohorted
:
true
,
id
:
'other_topic'
}
}
},
is_cohorted
:
isCohorted
is_cohorted
:
true
});
};
...
...
@@ -106,7 +103,7 @@
// suppressing Line is too long (4272 characters!)
/* jshint -W101 */
appendSetFixtures
(
"<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>"
);
"<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>"
);
// eslint-disable-line max-len, no-useless-escape
appendSetFixtures
(
'<div id=
\'
fixture-element
\'
></div>
\
n'
+
...
...
lms/djangoapps/discussion/static/discussion/js/discussion_board_factory.js
View file @
4c4476a7
...
...
@@ -55,7 +55,7 @@
BreadcrumbsModel
=
Backbone
.
Model
.
extend
({
defaults
:
{
contents
:
[]
,
contents
:
[]
}
});
...
...
lms/djangoapps/discussion/static/discussion/js/discussion_profile_page_factory.js
View file @
4c4476a7
...
...
@@ -11,14 +11,13 @@
numPages
=
options
.
numPages
;
// Roles are not included in user profile page, but they are not used for anything
window
.
DiscussionUtil
.
loadRoles
({
'Moderator'
:
[],
'Administrator'
:
[],
Moderator
:
[],
Administrator
:
[],
'Community TA'
:
[]
});
window
.
$$course_id
=
options
.
courseId
;
window
.
user
=
new
window
.
DiscussionUser
(
userInfo
);
// jshint nonew:false
new
DiscussionUserProfileView
({
new
DiscussionUserProfileView
({
// eslint-disable-line no-new
el
:
$element
,
collection
:
threads
,
page
:
page
,
...
...
lms/djangoapps/discussion/static/discussion/js/spec/views/discussion_user_profile_view_spec.js
View file @
4c4476a7
...
...
@@ -62,15 +62,7 @@ define(
});
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
checkRender
=
function
(
params
)
{
var
getPageNumber
,
paginator
,
view
;
view
=
makeView
([],
params
.
page
,
params
.
numPages
);
paginator
=
view
.
$
(
'.discussion-paginator'
);
...
...
lms/djangoapps/discussion/static/discussion/js/views/discussion_fake_breadcrumbs.js
View file @
4c4476a7
...
...
@@ -12,7 +12,7 @@
define
([
'backbone'
,
'edx-ui-toolkit/js/utils/html-utils'
,
'text!discussion/templates/fake-breadcrumbs.underscore'
,
'text!discussion/templates/fake-breadcrumbs.underscore'
],
function
(
Backbone
,
HtmlUtils
,
breadcrumbsTemplate
)
{
var
DiscussionFakeBreadcrumbs
=
Backbone
.
View
.
extend
({
...
...
lms/static/js/spec/courseware/link_clicked_events_spec.js
View file @
4c4476a7
...
...
@@ -12,7 +12,7 @@ define(['jquery', 'logger', 'js/courseware/courseware_factory'], function($, Log
$
(
'.external-link'
).
click
();
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'edx.ui.lms.link_clicked'
,
{
target_url
:
'http://example.com/'
,
current_url
:
'http://'
+
window
.
location
.
host
+
'/context.html'
current_url
:
window
.
location
.
toString
()
});
});
...
...
lms/static/lms/js/spec/main.js
View file @
4c4476a7
...
...
@@ -8,7 +8,7 @@
paths
:
{
'gettext'
:
'xmodule_js/common_static/js/test/i18n'
,
'codemirror'
:
'xmodule_js/common_static/js/vendor/CodeMirror/codemirror'
,
'jquery'
:
'common/js/vendor/jquery'
,
jquery
:
'common/js/vendor/jquery'
,
'jquery-migrate'
:
'common/js/vendor/jquery-migrate'
,
'jquery.ui'
:
'xmodule_js/common_static/js/vendor/jquery-ui.min'
,
'jquery.eventDrag'
:
'xmodule_js/common_static/js/vendor/jquery.event.drag-2.2'
,
...
...
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