2009-11-13 11:02:33 +05:30
|
|
|
{% extends "view_page_detail.html" %}
|
|
|
|
{% load my_tags %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
2012-05-28 22:47:15 +05:30
|
|
|
<script type="text/javascript">
|
2012-05-31 03:09:01 +05:30
|
|
|
$(function(){
|
|
|
|
$('#tabs').tabs({
|
|
|
|
'select': function(event, ui){
|
2012-05-31 05:03:44 +05:30
|
|
|
document.location.hash = ui.panel.id;
|
|
|
|
}
|
2012-05-31 03:09:01 +05:30
|
|
|
});
|
2012-05-28 22:47:15 +05:30
|
|
|
$('.wysiwyg').htmlarea({
|
|
|
|
toolbar: [
|
2012-05-29 06:54:23 +05:30
|
|
|
"bold", "italic", "underline",
|
2012-05-29 19:38:56 +05:30
|
|
|
"|", "forecolor", "superscript", "p",
|
2012-05-29 06:02:55 +05:30
|
|
|
"|", "link", "unlink",
|
|
|
|
"|", "html"
|
2012-05-28 22:47:15 +05:30
|
|
|
]
|
|
|
|
});
|
2012-05-29 19:09:55 +05:30
|
|
|
// FIXME: add font, fontsize, backcolor
|
|
|
|
// FIXME: find easier way:
|
2012-05-28 22:47:15 +05:30
|
|
|
$('.jHtmlArea').contents().find('iframe').contents().find('body').css({"background-color": "white"});
|
2012-05-31 03:09:01 +05:30
|
|
|
});
|
|
|
|
function setnotetext() {
|
2012-05-28 23:24:22 +05:30
|
|
|
document.getElementById('notetext').value = $('.jHtmlArea').contents().find('iframe').contents().find('body').html();
|
2012-05-31 03:09:01 +05:30
|
|
|
}
|
2012-05-28 22:47:15 +05:30
|
|
|
</script>
|
2009-12-07 05:05:46 +05:30
|
|
|
<div class="content" id="IndividualDetail">
|
2011-10-16 22:30:32 +05:30
|
|
|
|
2011-12-13 04:51:13 +05:30
|
|
|
{% include "detail_breadcrumb.html" %}
|
2011-10-16 22:30:32 +05:30
|
|
|
|
2009-12-07 05:05:46 +05:30
|
|
|
<div id="summaryarea">
|
2012-05-17 17:26:59 +05:30
|
|
|
<table class="infolist" style="width:90%;">
|
2009-12-07 05:05:46 +05:30
|
|
|
<tbody>
|
2012-05-26 08:40:55 +05:30
|
|
|
{% if noteform.errors %}
|
|
|
|
<hr>
|
|
|
|
<p id="error">The following fields have errors. Please correct and try again.</p>
|
|
|
|
<div id="error">{{noteform.errors}}</div>
|
|
|
|
<hr>
|
|
|
|
{% endif %}
|
2012-05-28 22:47:15 +05:30
|
|
|
<form method="post" onsubmit="setnotetext()">{% csrf_token %}
|
2009-11-13 11:02:33 +05:30
|
|
|
<tr>
|
2012-05-29 06:02:55 +05:30
|
|
|
<td class="ColumnAttribute">{{noteform.notetext.label}}:</td>
|
2012-05-28 22:47:15 +05:30
|
|
|
<td class="ColumnValue" id="data" colspan="3">
|
|
|
|
{% if action == "edit" or action == "add" %}
|
2012-05-29 06:02:55 +05:30
|
|
|
<input type="hidden" id="notetext" name="notetext" value=""></input>
|
2012-05-28 22:47:15 +05:30
|
|
|
{% render noteform.notetext user action %}
|
|
|
|
{% else %}
|
2012-05-29 06:02:55 +05:30
|
|
|
<div style="overflow-y: scroll; height: 100px;">{{notetext|safe}}</div>
|
2012-05-28 22:47:15 +05:30
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
2012-05-26 08:40:55 +05:30
|
|
|
</tr>
|
|
|
|
<tr>
|
2012-05-26 10:02:48 +05:30
|
|
|
<td></td>
|
|
|
|
<td></td>
|
2012-05-26 08:40:55 +05:30
|
|
|
<td class="ColumnAttribute">{{noteform.preformatted.label}}:</td>
|
|
|
|
<td class="ColumnValue" id="data">{% render noteform.preformatted user action %}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2012-05-26 10:02:48 +05:30
|
|
|
<td class="ColumnAttribute">{{noteform.gramps_id.label}}:</td>
|
|
|
|
<td class="ColumnValue" id="data"> {% render noteform.gramps_id user action %}</td>
|
|
|
|
<td class="ColumnAttribute">{{noteform.note_type.label}}:</td>
|
|
|
|
<td class="ColumnValue" id="data">{% render noteform.note_type user action %}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2012-05-26 08:40:55 +05:30
|
|
|
<td class="ColumnAttribute">{{noteform.tags.label}}:</td>
|
|
|
|
<td class="ColumnValue" id="data" colspan="4">{% render noteform.tags user action %}</td>
|
2009-11-13 11:02:33 +05:30
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<!-- Tabs -->
|
|
|
|
|
|
|
|
<div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
|
|
|
|
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
|
2012-05-31 02:35:38 +05:30
|
|
|
<li class="ui-corner-top ui-state-default"><a href="#tab-references">References</a></li>
|
2012-06-20 08:04:15 +05:30
|
|
|
<li class="ui-corner-top ui-state-default"><a href="#tab-history">History</a></li>
|
2009-11-13 11:02:33 +05:30
|
|
|
</ul>
|
2012-05-31 02:35:38 +05:30
|
|
|
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" id="tab-references">
|
2012-05-30 21:24:51 +05:30
|
|
|
{% note_reference_table note user action %}
|
2009-12-07 05:05:46 +05:30
|
|
|
</div>
|
2012-06-20 08:04:15 +05:30
|
|
|
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" id="tab-history">
|
|
|
|
{% history_table note user action %}
|
|
|
|
</div>
|
2009-12-07 05:05:46 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2009-11-13 11:02:33 +05:30
|
|
|
</div>
|
2012-05-26 08:40:55 +05:30
|
|
|
|
|
|
|
{% if user.is_superuser %}
|
|
|
|
{% if action == "edit" %}
|
2012-06-05 07:18:39 +05:30
|
|
|
{% make_button "Cancel" "/note/%s" note.handle args %}
|
2012-05-26 08:40:55 +05:30
|
|
|
<input type="hidden" name="action" value="save"/>
|
2012-06-05 07:18:39 +05:30
|
|
|
<input type="hidden" name="search" value="{{search}}"/>
|
|
|
|
<input type="hidden" name="page" value="{{page}}"/>
|
2012-05-26 08:40:55 +05:30
|
|
|
<input type="submit" value="Save"/>
|
|
|
|
{% else %}
|
|
|
|
{% ifequal action "add" %}
|
2012-06-05 07:18:39 +05:30
|
|
|
{% make_button "Cancel" "/note/" args %}
|
2012-05-26 08:40:55 +05:30
|
|
|
<input type="hidden" name="action" value="create"/>
|
2012-06-05 07:18:39 +05:30
|
|
|
<input type="hidden" name="search" value="{{search}}"/>
|
|
|
|
<input type="hidden" name="page" value="{{page}}"/>
|
2012-05-26 08:40:55 +05:30
|
|
|
<input type="submit" value="Create"/>
|
|
|
|
{% else %}
|
2012-06-05 07:18:39 +05:30
|
|
|
{% make_button "Add Note" "/note/add" args %}
|
|
|
|
{% make_button "Edit Note" "/note/%s/edit" note.handle args %}
|
|
|
|
{% make_button "Delete Note" "/note/%s/delete" note.handle args %}
|
2012-05-26 08:40:55 +05:30
|
|
|
{% endifequal %}
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
2009-11-13 11:02:33 +05:30
|
|
|
{% endblock %}
|
|
|
|
|