33f168ed6e
svn: r19718
107 lines
3.4 KiB
HTML
107 lines
3.4 KiB
HTML
{% extends "view_page_detail.html" %}
|
|
{% load my_tags %}
|
|
|
|
{% block content %}
|
|
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$('#tabs').tabs({
|
|
'select': function(event, ui){
|
|
document.location.hash = ui.panel.id;
|
|
}
|
|
});
|
|
$('.wysiwyg').htmlarea({
|
|
toolbar: [
|
|
"bold", "italic", "underline",
|
|
"|", "forecolor", "superscript", "p",
|
|
"|", "link", "unlink",
|
|
"|", "html"
|
|
]
|
|
});
|
|
// FIXME: add font, fontsize, backcolor
|
|
// FIXME: find easier way:
|
|
$('.jHtmlArea').contents().find('iframe').contents().find('body').css({"background-color": "white"});
|
|
});
|
|
function setnotetext() {
|
|
document.getElementById('notetext').value = $('.jHtmlArea').contents().find('iframe').contents().find('body').html();
|
|
}
|
|
</script>
|
|
<div class="content" id="IndividualDetail">
|
|
|
|
{% include "detail_breadcrumb.html" %}
|
|
|
|
<div id="summaryarea">
|
|
<table class="infolist" style="width:90%;">
|
|
<tbody>
|
|
{% 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 %}
|
|
<form method="post" onsubmit="setnotetext()">{% csrf_token %}
|
|
<tr>
|
|
<td class="ColumnAttribute">{{noteform.notetext.label}}:</td>
|
|
<td class="ColumnValue" id="data" colspan="3">
|
|
{% if action == "edit" or action == "add" %}
|
|
<input type="hidden" id="notetext" name="notetext" value=""></input>
|
|
{% render noteform.notetext user action %}
|
|
{% else %}
|
|
<div style="overflow-y: scroll; height: 100px;">{{notetext|safe}}</div>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td></td>
|
|
<td class="ColumnAttribute">{{noteform.preformatted.label}}:</td>
|
|
<td class="ColumnValue" id="data">{% render noteform.preformatted user action %}</td>
|
|
</tr>
|
|
<tr>
|
|
<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>
|
|
<td class="ColumnAttribute">{{noteform.tags.label}}:</td>
|
|
<td class="ColumnValue" id="data" colspan="4">{% render noteform.tags user action %}</td>
|
|
</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">
|
|
<li class="ui-corner-top ui-state-default"><a href="#tab-references">References</a></li>
|
|
</ul>
|
|
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" id="tab-references">
|
|
{% note_reference_table note user action %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if user.is_superuser %}
|
|
{% if action == "edit" %}
|
|
{% make_button "Cancel" "/note/%s" note.handle %}
|
|
<input type="hidden" name="action" value="save"/>
|
|
<input type="submit" value="Save"/>
|
|
{% else %}
|
|
{% ifequal action "add" %}
|
|
{% make_button "Cancel" "/note/" %}
|
|
<input type="hidden" name="action" value="create"/>
|
|
<input type="submit" value="Create"/>
|
|
{% else %}
|
|
{% make_button "Add Note" "/note/add" %}
|
|
{% make_button "Edit Note" "/note/%s/edit" note.handle %}
|
|
{% make_button "Delete Note" "/note/%s/delete" note.handle %}
|
|
{% endifequal %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% endif %}
|
|
</form>
|
|
{% endblock %}
|
|
|