From: Charles Connell Date: Sun, 13 Apr 2014 15:42:16 +0000 (-0400) Subject: Show keywords in read-only mode first X-Git-Tag: release-20150131~144^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=86728d2ba3f66d1d5c9f86a5704d37d331fc7cbc;p=oweals%2Fkarmaworld.git Show keywords in read-only mode first --- diff --git a/karmaworld/apps/notes/views.py b/karmaworld/apps/notes/views.py index ba02345..da1eaa7 100644 --- a/karmaworld/apps/notes/views.py +++ b/karmaworld/apps/notes/views.py @@ -59,6 +59,7 @@ class NoteDetailView(DetailView): kwargs['keyword_prototype_form'] = KeywordForm kwargs['keyword_formset'] = self.keyword_formset + kwargs['keywords'] = Keyword.objects.filter(note=self.object) if self.object.is_pdf(): kwargs['pdf_controls'] = True diff --git a/karmaworld/assets/css/global.css b/karmaworld/assets/css/global.css index 3fb63ce..8c52274 100644 --- a/karmaworld/assets/css/global.css +++ b/karmaworld/assets/css/global.css @@ -98,9 +98,10 @@ button:focus, button.disabled, button.disabled:hover, -button.disabled:focus +button.disabled:focus, +.button.disabled, .button.disable:hover, -.button.disabled:focus, { +.button.disabled:focus { background: #333333; color: #bcbdc0; cursor: default; @@ -191,6 +192,10 @@ table.dataTable a { background-color: transparent !important; } +td { + background-color: inherit !important; +} + ul.ui-autocomplete { z-index: 1000; } diff --git a/karmaworld/assets/css/note_course_pages.css b/karmaworld/assets/css/note_course_pages.css index 6524e16..1ae6d2d 100644 --- a/karmaworld/assets/css/note_course_pages.css +++ b/karmaworld/assets/css/note_course_pages.css @@ -117,4 +117,14 @@ div.header-title-row { .note-keyword-toggle { margin: 0 0 10px 0; +} + +#keywords-data-table td { + padding: 10px 10px 10px 10px; +} + +#edit-keywords-button { + font-size: inherit; + margin: 0; + padding: 5px; } \ No newline at end of file diff --git a/karmaworld/assets/js/note-detail.js b/karmaworld/assets/js/note-detail.js index cf6358b..5531e5f 100644 --- a/karmaworld/assets/js/note-detail.js +++ b/karmaworld/assets/js/note-detail.js @@ -256,9 +256,6 @@ $(function() { } }); }); - - - }, error: function(data, textStatus, jqXHR) { writeNoteFrame("

Sorry, your note could not be retrieved.

"); @@ -269,6 +266,17 @@ $(function() { $('.definition').keydown(tabHandler); $('#add-row-btn').click(addForm); + $('#keywords-data-table').dataTable({ + // don't provide a option for the user to change the table page length + 'bLengthChange': false, + 'sDom': 't<"clear">' + }); + + $('#edit-keywords-button').click(function(event) { + $('#keywords-data-table').toggle(); + $('#keyword-form').toggle(); + }); + }); diff --git a/karmaworld/templates/notes/note_detail.html b/karmaworld/templates/notes/note_detail.html index 8122061..19b4b28 100644 --- a/karmaworld/templates/notes/note_detail.html +++ b/karmaworld/templates/notes/note_detail.html @@ -8,6 +8,7 @@ {% block pagestyle %} + {% endblock %} {% block pagescripts %} @@ -31,6 +32,7 @@ +