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
e22371b8
Commit
e22371b8
authored
Aug 04, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some notification stuff
parent
7c58fd27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
11 deletions
+42
-11
lms/templates/notifications.html
+42
-11
No files found.
lms/templates/notifications.html
View file @
e22371b8
...
...
@@ -20,6 +20,11 @@ def discussion_title(discussion_id):
return
get_discussion_title
(
discussion_id=
discussion_id)
%
>
<
%
def
url_for_user
(
user_id
)
:
#
TODO
return
"
javascript:void
(
0
)"
%
>
<div
class=
"notifications"
>
% for notification in notifications:
...
...
@@ -27,21 +32,47 @@ def discussion_title(discussion_id):
% endfor
</div>
<
%
def
name=
"render_user_link(notification)"
>
<
%
info =
notification['info']
%
>
% if notification.get('actor_id', None):
<a
href=
"${url_for_user(notification['actor_id'])}"
>
${info['actor_username']}
</a>
% else:
Anonymous
% endif
</
%
def>
<
%
def
name=
"render_thread_link(notification)"
>
<
%
info =
notification['info']
%
>
<a
href=
"${url_for_thread(info['commentable_id'], info['thread_id'])}"
>
${info['thread_title']}
</a>
</
%
def>
<
%
def
name=
"render_comment_link(notification)"
>
<
%
info =
notification['info']
%
>
<a
href=
"${url_for_comment(info['commentable_id'], info['thread_id'], info['comment_id'])}"
>
comment
</a>
</
%
def>
<
%
def
name=
"render_discussion_link(notification)"
>
<
%
info =
notification['info']
%
>
<a
href=
"${url_for_discussion(info['commentable_id'])}"
>
${discussion_title(info['commentable_id'])}
</a>
</
%
def>
<
%
def
name=
"render_notification(notification)"
>
<div
class=
"notification"
>
<
%
info =
notification['info']
%
>
% if notification['notification_type'] == 'post_reply':
User No.${notification['actor_id']} posted a
<a
href=
"${url_for_comment(info['commentable_id'], info['thread_id'], info['comment_id'])}"
>
comment
</a>
to the thread
<a
href=
"${url_for_thread(info['commentable_id'], info['thread_id'])}"
>
${info['thread_title']}
</a>
in discussion
<a
href=
"${url_for_discussion(info['commentable_id'])}"
>
${discussion_title(info['commentable_id'])}
</a>
${render_user_link(notification)} posted a ${render_comment_link(notification)}
to the thread ${render_thread_link(notification)} in discussion ${render_discussion_link(notification)}
% elif notification['notification_type'] == 'post_topic':
User No.${notification['actor_id']} posted a new thread
<a
href=
"${url_for_thread(info['commentable_id'], info['thread_id'])}"
>
${info['thread_title']}
</a>
in discussion
<a
href=
"${url_for_discussion(info['commentable_id'])}"
>
${discussion_title(info['commentable_id'])}
</a>
${render_user_link(notification)} posted a new thread ${render_thread_link(notification)}
in discussion ${render_discussion_link(notification)}
% elif notification['notification_type'] == 'at_user':
${render_user(info)} mentioned you in
% if notification['info']['content_type'] == 'thread':
the thread ${render_thread_link(notification)}
in discussion ${render_discussion_link(notification)}
% else:
${render_comment_link(notification)}
to the thread ${render_thread_link(notification)} in discussion ${render_discussion_link(notification)}
% endif
% endif
</div>
...
...
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