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
026773b5
Commit
026773b5
authored
May 13, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pep8 warnings and add empty message to notes tab
parent
996b3513
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
lms/djangoapps/notes/api.py
+1
-1
lms/djangoapps/notes/models.py
+2
-2
lms/djangoapps/notes/views.py
+1
-3
lms/templates/notes.html
+7
-1
No files found.
lms/djangoapps/notes/api.py
View file @
026773b5
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
HttpResponse
,
Http404
from
django.core.exceptions
import
ValidationError
from
django.core.exceptions
import
ValidationError
from
notes.models
import
Note
from
notes.utils
import
notes_enabled_for_course
...
...
lms/djangoapps/notes/models.py
View file @
026773b5
...
...
@@ -12,9 +12,9 @@ class Note(models.Model):
uri
=
models
.
CharField
(
max_length
=
1024
,
db_index
=
True
)
text
=
models
.
TextField
(
default
=
""
)
quote
=
models
.
TextField
(
default
=
""
)
range_start
=
models
.
CharField
(
max_length
=
2048
)
# xpath string
range_start
=
models
.
CharField
(
max_length
=
2048
)
# xpath string
range_start_offset
=
models
.
IntegerField
()
range_end
=
models
.
CharField
(
max_length
=
2048
)
# xpath string
range_end
=
models
.
CharField
(
max_length
=
2048
)
# xpath string
range_end_offset
=
models
.
IntegerField
()
tags
=
models
.
TextField
(
default
=
""
)
# comma-separated string
created
=
models
.
DateTimeField
(
auto_now_add
=
True
,
null
=
True
,
db_index
=
True
)
...
...
lms/djangoapps/notes/views.py
View file @
026773b5
...
...
@@ -16,11 +16,9 @@ def notes(request, course_id):
raise
Http404
notes
=
Note
.
objects
.
filter
(
course_id
=
course_id
,
user
=
request
.
user
)
.
order_by
(
'-created'
,
'uri'
)
json_notes
=
json
.
dumps
([
n
.
as_dict
()
for
n
in
notes
])
context
=
{
'course'
:
course
,
'notes'
:
notes
,
'json_notes'
:
json_notes
'notes'
:
notes
}
return
render_to_response
(
'notes.html'
,
context
)
lms/templates/notes.html
View file @
026773b5
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
inherit
file=
"main.html"
/>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
block
name=
"headextra"
>
<
%
static:css
group=
'course'
/>
...
...
@@ -52,7 +55,7 @@
<section
class=
"container"
>
<div
class=
"notes-wrapper"
>
<h
2>
My Notes
</h2
>
<h
1>
My Notes
</h1
>
% for note in notes:
<div
class=
"note"
>
<blockquote>
${note.quote|h}
</blockquote>
...
...
@@ -67,6 +70,9 @@
</ul>
</div>
% endfor
% if notes is UNDEFINED or len(notes) == 0:
<p>
You do not have any notes.
</p>
% endif
</div>
</section>
...
...
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