Implement note editing and saving
authorCharlie DeTar <cfd@media.mit.edu>
Sat, 31 Jan 2015 19:26:28 +0000 (12:26 -0700)
committerBryan <btbonval@gmail.com>
Fri, 27 Feb 2015 01:08:12 +0000 (20:08 -0500)
commit6bb9dc4018759c36e168297d341e9029b355e9c9
tree549bd4a148dfe38344740f6d2d885d9b2be064b4
parent650d4f06752fcebbd58945eb31c9485b1e580864
Implement note editing and saving

 - Refactor HTML sanitization into separate file, based primarily on
   bleach rather than BeautifulSoup.  BS makes it hard to sanitize
   fragments of html without retaining ``<html><body>`` etc wrappers.
   Move canonical link setting into a separate function, as these only
   make sense where the HTML fragment has a ``<head>`` in it.
 - Update FontAwesome to 4.3.
 - Refactor ``NoteDetailView``, ``NoteSaveView``, and ``NoteView`` into
   a single class inheriting from ``UpdateView``, greatly simplifying
   that code.

TODO: Simplify NoteKeywordsView and NoteQuizView in a similar fashion,
if it makes sense to do so.  Explore removing html2text from workflow
now that we have the aggressive cleaning from ``bleach``, and test
results with various document types.
17 files changed:
karmaworld/apps/notes/forms.py
karmaworld/apps/notes/gdrive.py
karmaworld/apps/notes/management/commands/populate_s3.py
karmaworld/apps/notes/models.py
karmaworld/apps/notes/sanitizer.py [new file with mode: 0644]
karmaworld/apps/notes/tests.py
karmaworld/apps/notes/views.py
karmaworld/apps/wysihtml5/templates/wysihtml5/widget.html
karmaworld/apps/wysihtml5/templatetags/wysihtml5.py
karmaworld/assets/css/font-awesome.css
karmaworld/assets/css/fonts/FontAwesome.otf
karmaworld/assets/css/fonts/fontawesome-webfont.eot
karmaworld/assets/css/fonts/fontawesome-webfont.svg
karmaworld/assets/css/fonts/fontawesome-webfont.ttf
karmaworld/assets/css/fonts/fontawesome-webfont.woff
karmaworld/assets/css/fonts/fontawesome-webfont.woff2 [new file with mode: 0644]
karmaworld/templates/notes/note_base.html