Skip to content

Commit

Permalink
wip admin record
Browse files Browse the repository at this point in the history
  • Loading branch information
moogoo78 committed Oct 8, 2024
1 parent b2b0887 commit 0f45e46
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
22 changes: 21 additions & 1 deletion app/templates/admin/inc_record-form2.tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,27 @@ $( document ).ready(function() {
}
});
});
document.getElementById('submit-button').onclick = (e) => {
document.getElementById('delete-button').onclick = (e) => {
e.preventDefault();
let postData = {};
values.__editable_fields__.forEach( field => {
let elem = document.getElementById(`${field}-id`);
postData[field] = elem.value;
});
console.log('post', postData);
console.log(relatedValues);
};
document.getElementById('save-cont-button').onclick = (e) => {
e.preventDefault();
let postData = {};
values.__editable_fields__.forEach( field => {
let elem = document.getElementById(`${field}-id`);
postData[field] = elem.value;
});
console.log('post', postData);
console.log(relatedValues);
};
document.getElementById('save-button').onclick = (e) => {
e.preventDefault();
let postData = {};
values.__editable_fields__.forEach( field => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,6 @@
<td><button class="uk-button uk-button-secondary" id="unit-x-delete-unit" data-index=${index}>{{ _('刪除') }}</button></td>
</tr>
</template>
{#
<template id="template-unit-card">
<div class="unit-wrapper">
<div class="uk-card uk-card-default uk-card-body uk-card-small">
<div class="uk-card-badge uk-label unit-pub-status">Badge</div>
<div class="uk-grid-small uk-flex-middle" uk-grid>
<div class="uk-width-auto">
<img class="uk-border-rounded unit-image" width="40" height="40" src="" alt="">
</div>
<div class="uk-width-expand">
<h3 class="uk-card-title uk-margin-remove-bottom unit-title">Title</h3>
<p class="uk-text-meta uk-margin-remove-top unit-meta">April 01, 2016</p>
</div>
</div>
<p><a class="uk-link unit-frontend-link" target="_blank">{{ _('前台頁面') }}</a></p>
<div class="uk-flex uk-flex-between uk-flex-middle uk-">
<a href="#" class="uk-button uk-button-text unit-delete">{{ _('刪除') }}</a>
<a href="#modal-unit-detail" class="uk-button uk-button-primary unit-modal-open" uk-toggle>{{ _('編輯') }}</a>
</div>
</div>
</div>
</template>
#}

<div id="modal-unit-detail" class="uk-flex-top" uk-modal>
<div class="uk-modal-dialog uk-width-auto uk-margin-auto-vertical">
Expand Down
17 changes: 10 additions & 7 deletions app/templates/admin/record-form2-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,18 @@
<div class="uk-grid-small ndb-tab-view uk-hidden" data-tab="identifications" uk-grid>
<h3 class="uk-heading-bullet">鑑定 <button class="uk-button uk-button-small" type="button" id="identification-add-button">+</button></h3>
<div id="identification-container"></div>
</div>{# end of identifications #}
</form>
</div>{# end of nav identifications #}

<div class="uk-width-1-1 uk-margin">
<hr>
<button class="uk-button uk-button-primary" id="submit-button">{{ _('送出') }}</button>
</div>
<div class="uk-flex uk-flex-between">
<div><button class="uk-button uk-button-danger" id="delete-button">{{ _('刪除') }}</button></div>
<div class="uk-flex uk-flex-right">
<div class="uk-margin-left"><button class="uk-button uk-button-secordary" id="save-cont-button">{{ _('儲存並繼續編輯') }}</button></div>
<div class="uk-margin-left"><button class="uk-button uk-button-primary" id="save-button">{{ _('儲存並回到藏品列表') }}</button></div>
</div>
</div>
</form>

{% include "admin/inc_template-modal.tpl.html" %}
{% include "admin/inc_record_template-modal.tpl.html" %}

{% endblock %}

Expand Down

0 comments on commit 0f45e46

Please sign in to comment.