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
af777420
Commit
af777420
authored
Dec 01, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #334 from open-craft/eugeny/discussion-backport
Reverted using cached permissions for disciussion
parents
c646dd9c
10426bc9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
common/templates/discussion/_discussion_course.html
+2
-2
common/templates/discussion/_discussion_course_navigation.html
+2
-2
common/templates/discussion/_discussion_inline.html
+2
-2
common/templates/discussion/_underscore_templates.html
+4
-4
No files found.
common/templates/discussion/_discussion_course.html
View file @
af777420
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django_comment_client
.
permissions
import
cached_
has_permission
%
>
<
%!
from
django_comment_client
.
permissions
import
has_permission
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<div
class=
"discussion-course"
>
<div
class=
"discussion-course"
>
% if enable_new_post_btn and
cached_
has_permission(user, "create_thread", course_id):
% if enable_new_post_btn and has_permission(user, "create_thread", course_id):
<div
class=
"discussion-course-new right"
>
<div
class=
"discussion-course-new right"
>
<a
href=
"#"
class=
"new-post-btn"
role=
"button"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a>
<a
href=
"#"
class=
"new-post-btn"
role=
"button"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a>
</div>
</div>
...
...
common/templates/discussion/_discussion_course_navigation.html
View file @
af777420
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django_comment_client
.
permissions
import
cached_
has_permission
%
>
<
%!
from
django_comment_client
.
permissions
import
has_permission
%
>
<
%
inherit
file=
"../courseware/course_navigation.html"
/>
<
%
inherit
file=
"../courseware/course_navigation.html"
/>
<
%
block
name=
"extratabs"
>
<
%
block
name=
"extratabs"
>
% if
cached_
has_permission(user, 'create_thread', course.id):
% if has_permission(user, 'create_thread', course.id):
<li
class=
"right"
><a
href=
"#"
class=
"new-post-btn"
role=
"button"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a></li>
<li
class=
"right"
><a
href=
"#"
class=
"new-post-btn"
role=
"button"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a></li>
% endif
% endif
</
%
block>
</
%
block>
common/templates/discussion/_discussion_inline.html
View file @
af777420
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django_comment_client
.
permissions
import
cached_
has_permission
%
>
<
%!
from
django_comment_client
.
permissions
import
has_permission
%
>
<
%
include
file=
"_underscore_templates.html"
/>
<
%
include
file=
"_underscore_templates.html"
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<div
class=
"discussion-module"
data-discussion-id=
"${discussion_id | h}"
>
<div
class=
"discussion-module"
data-discussion-id=
"${discussion_id | h}"
>
<a
class=
"discussion-show control-button"
href=
"javascript:void(0)"
data-discussion-id=
"${discussion_id | h}"
role=
"button"
><span
class=
"show-hide-discussion-icon"
></span><span
class=
"button-text"
>
${_("Show Discussion")}
</span></a>
<a
class=
"discussion-show control-button"
href=
"javascript:void(0)"
data-discussion-id=
"${discussion_id | h}"
role=
"button"
><span
class=
"show-hide-discussion-icon"
></span><span
class=
"button-text"
>
${_("Show Discussion")}
</span></a>
% if
cached_
has_permission(user, 'create_thread', course.id):
% if has_permission(user, 'create_thread', course.id):
<a
href=
"#"
class=
"new-post-btn"
role=
"button"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a>
<a
href=
"#"
class=
"new-post-btn"
role=
"button"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a>
% endif
% endif
</div>
</div>
common/templates/discussion/_underscore_templates.html
View file @
af777420
<
%!
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_comment_client
.
permissions
import
cached_
has_permission
%
>
<
%!
from
django_comment_client
.
permissions
import
has_permission
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<
/div
>
<
/div
>
<
div
class
=
"post-extended-content"
>
<
div
class
=
"post-extended-content"
>
<
div
class
=
"response-count"
/>
<
div
class
=
"response-count"
/>
%
if
course
is
UNDEFINED
or
cached_
has_permission
(
user
,
'create_comment'
,
course
.
id
):
%
if
course
is
UNDEFINED
or
has_permission
(
user
,
'create_comment'
,
course
.
id
):
<
div
class
=
"add-response"
>
<
div
class
=
"add-response"
>
<
button
class
=
"button add-response-btn"
>
<
button
class
=
"button add-response-btn"
>
<
i
class
=
"icon icon-reply"
><
/i
>
<
i
class
=
"icon icon-reply"
><
/i
>
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<
div
class
=
"post-status-closed bottom-post-status"
style
=
"display: none"
>
<
div
class
=
"post-status-closed bottom-post-status"
style
=
"display: none"
>
$
{
_
(
"This thread is closed."
)}
$
{
_
(
"This thread is closed."
)}
<
/div
>
<
/div
>
%
if
course
is
UNDEFINED
or
cached_
has_permission
(
user
,
'create_comment'
,
course
.
id
):
%
if
course
is
UNDEFINED
or
has_permission
(
user
,
'create_comment'
,
course
.
id
):
<
form
class
=
"discussion-reply-new"
data
-
id
=
"${'<%- id %>'}"
>
<
form
class
=
"discussion-reply-new"
data
-
id
=
"${'<%- id %>'}"
>
<
h4
>
$
{
_
(
"Post a response:"
)}
<
/h4
>
<
h4
>
$
{
_
(
"Post a response:"
)}
<
/h4
>
<
ul
class
=
"discussion-errors"
><
/ul
>
<
ul
class
=
"discussion-errors"
><
/ul
>
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
<
/a
>
<
/a
>
<
ol
class
=
"comments"
>
<
ol
class
=
"comments"
>
<
li
class
=
"new-comment"
>
<
li
class
=
"new-comment"
>
%
if
course
is
UNDEFINED
or
cached_
has_permission
(
user
,
'create_sub_comment'
,
course
.
id
):
%
if
course
is
UNDEFINED
or
has_permission
(
user
,
'create_sub_comment'
,
course
.
id
):
<
form
class
=
"comment-form"
data
-
id
=
"${'<%- wmdId %>'}"
>
<
form
class
=
"comment-form"
data
-
id
=
"${'<%- wmdId %>'}"
>
<
ul
class
=
"discussion-errors"
><
/ul
>
<
ul
class
=
"discussion-errors"
><
/ul
>
<
label
class
=
"sr"
for
=
"add-new-comment"
>
$
{
_
(
"Add a comment"
)}
<
/label
>
<
label
class
=
"sr"
for
=
"add-new-comment"
>
$
{
_
(
"Add a comment"
)}
<
/label
>
...
...
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