Skip to content

Commit

Permalink
Rearrange work edit/post controls
Browse files Browse the repository at this point in the history
  • Loading branch information
c-e-p committed Jun 19, 2023
1 parent 32e7df9 commit 85838f6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 33 deletions.
1 change: 1 addition & 0 deletions ourchive_app/frontend/templates/edit_tags.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<h3 id="obj-attrs-form-header">{{ object_friendly|default_if_none:'' }} Tags <sup uk-icon="icon: question"></sup></h3>
{% for type, tag_data in tags.items %}
{% if tag_data.admin_administrated %}
<div class="uk-margin" id="{{ object }}-form-tag-parent">
Expand Down
72 changes: 39 additions & 33 deletions ourchive_app/frontend/templates/work_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<button id="work-form-prevent-default-hidden" type="submit" disabled style="display: none" aria-hidden="true"></button>
<input id="work-form-submit-top" class="uk-align-right uk-button uk-form-width-small uk-button-primary" onclick="this.form.submitted=this.value;" type="submit" value="Submit"/>
<input id="work-form-cancel-top" class="uk-button uk-form-width-small uk-button-secondary uk-align-right" onclick="history.back()" value="Cancel" />

</div>
</div>
<hr id="work-form-title-content-divider"/>
Expand Down Expand Up @@ -87,7 +86,12 @@
</div>

</div>

<hr id="work-attributes-hr"/>
{% include "object_attributes_form.html" with object='Work' attribute_types=work.attribute_types %}
<hr/>
{% include "edit_tags.html" with object='work' object_friendly='Work' %}
<hr/>
<h3 id="obj-attrs-form-header">Work Details</h3>
<div class="uk-margin" id="work-form-summary-parent">
<label id="work-form-summary-label" class="uk-form-label" for="form-horizontal-text">Summary</label>
<div id="work-form-summary-controls" class="uk-form-controls">
Expand All @@ -98,8 +102,8 @@
tinymce.init({
selector: '#summaryEditor',
width: '100%',
height: 450,
autoresize_min_height: 450,
height: 200,
autoresize_min_height: 150,
autoresize_max_height: 800,
plugins: [
'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak',
Expand All @@ -110,7 +114,6 @@
'bullist numlist outdent indent | link image | print preview media fullscreen | ' +
'forecolor backcolor emoticons | help | code',
menubar: '',
content_css: 'css/content.css',
init_instance_callback : function(editor) {
var workSummary = document.getElementById('summary').value;
if (workSummary === "None") {
Expand All @@ -134,8 +137,8 @@
tinymce.init({
selector: '#notesEditor',
width: '100%',
height: 450,
autoresize_min_height: 450,
height: 200,
autoresize_min_height: 150,
autoresize_max_height: 800,
plugins: [
'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak',
Expand All @@ -146,7 +149,6 @@
'bullist numlist outdent indent | link image | print preview media fullscreen | ' +
'forecolor backcolor emoticons | help',
menubar: '',
content_css: 'css/content.css',
init_instance_callback : function(editor) {
var workNotes = document.getElementById('notes').value;
if (workNotes === "None") {
Expand All @@ -159,26 +161,7 @@
</div>
</div>
</div>

<div class="uk-margin" id="work-form-complete-parent">
<label id="work-form-complete-label" class="uk-form-label" for="form-horizontal-text">Complete?</label>
<div id="work-form-complete-controls" class="uk-form-controls">
<div id="work-form-complete-inline" class="uk-inline">
<label id="work-form-complete-switch-label" class="switch"><input class="uk-checkbox" id="work-form-complete-checkbox" type="checkbox" name="is_complete" {% if work.is_complete %} checked {% endif %}> <span id="work-form-complete-slider" class="slider round"></span> </label>
</div>
</div>
</div>

<div class="uk-margin" id="work-form-draft-parent">
<label id="work-form-draft-label" class="uk-form-label" for="form-horizontal-text">Draft?</label>
<div id="work-form-draft-controls" class="uk-form-controls">
<div id="work-form-draft-inline" class="uk-inline">
<label id="work-form-draft-switch" class="switch"><input class="uk-checkbox" id="work-form-draft-checkbox" type="checkbox" name="draft" {% if work.draft %} checked {% endif %}> <span id="work-form-draft-slider" class="slider round"></span></label>
</div>
</div>
</div>

<div class="uk-margin" id="work-form-cover-parent">
<div class="uk-margin" id="work-form-cover-parent">
<label id="work-form-cover-label" class="uk-form-label" for="form-horizontal-text">Cover</label>
{% if work.cover_url %}
<img id="work-form-cover-img" src="{{ work.cover_url }}"/>
Expand All @@ -194,13 +177,29 @@
<label id="work-form-cover-alt-label" class="uk-form-label" for="form-horizontal-text">Cover Alt Text</label>
<div id="work-form-cover-alt-controls" class="uk-form-controls">
<div id="work-form-cover-alt-inline" class="uk-inline">
<input id="work-form-cover-alt-input" class="uk-input uk-form-width-large" type="text" name="cover_alt_text" value="{{ work.cover_alt_text|default_if_none:'' }}">
<input id="work-form-cover-alt-input" class="uk-input uk-form-width-large" placeholder="Add a description for your cover image" type="text" name="cover_alt_text" value="{{ work.cover_alt_text|default_if_none:'' }}">
</div>
</div>
</div>
<hr/>
<h3 id="obj-attrs-form-header">Work Settings</h3>
<div class="uk-margin" id="work-form-complete-parent">
<label id="work-form-complete-label" class="uk-form-label" for="form-horizontal-text">Complete?</label>
<div id="work-form-complete-controls" class="uk-form-controls">
<div id="work-form-complete-inline" class="uk-inline">
<label id="work-form-complete-switch-label" class="switch"><input class="uk-checkbox" id="work-form-complete-checkbox" type="checkbox" name="is_complete" {% if work.is_complete %} checked {% endif %}> <span id="work-form-complete-slider" class="slider round"></span> </label>
</div>
</div>
</div>

<div class="uk-margin" id="work-form-draft-parent">
<label id="work-form-draft-label" class="uk-form-label" for="form-horizontal-text">Draft?</label>
<div id="work-form-draft-controls" class="uk-form-controls">
<div id="work-form-draft-inline" class="uk-inline">
<label id="work-form-draft-switch" class="switch"><input class="uk-checkbox" id="work-form-draft-checkbox" type="checkbox" name="draft" {% if work.draft %} checked {% endif %}> <span id="work-form-draft-slider" class="slider round"></span></label>
</div>
</div>
</div>
<hr id="work-attributes-hr"/>
{% include "object_attributes_form.html" with object='Work' attribute_types=work.attribute_types %}
<hr id="work-comments-hr"/>
<div class="uk-margin" id="work-form-allow-comments-parent">
<label id="work-form-allow-comments-label" class="uk-form-label" for="form-horizontal-text">Allow Comments?</label>
<div id="work-form-allow-comments-controls" class="uk-form-controls">
Expand All @@ -212,7 +211,6 @@
</select>
</div>
</div>
{% include "edit_tags.html" with object='work' %}
</li>
<li id="chapters_toc">
<script>
Expand Down Expand Up @@ -257,6 +255,14 @@
</li>
</ul>
</div>
<hr/>
<div id="work-form-bottom-controls-parent" class="uk-grid uk-align-right" uk-grid>
<div class="uk-align-right uk-width-1-1@m uk-width-1-1@s uk-margin-remove-left uk-margin-remove-right uk-margin-remove-bottom uk-padding-remove-vertical" id="work-form-bottom-buttons-group">
<button id="work-form-bottom-prevent-default-hidden" type="submit" disabled style="display: none" aria-hidden="true"></button>
<input id="work-form-submit-bottom" class="uk-align-right uk-button uk-form-width-small uk-button-primary" onclick="this.form.submitted=this.value;" type="submit" value="Submit"/>
<input id="work-form-cancel-bottom" class="uk-button uk-form-width-small uk-button-secondary uk-align-right" onclick="history.back()" value="Cancel" />
</div>
</div>
</form>
</div>
{% endblock %}

0 comments on commit 85838f6

Please sign in to comment.