3
0
Fork 0

Compare commits

..

No commits in common. "e9d59062ca45fa03dd633adbd7fb0317aeb335d5" and "8bcb556abba723a61e582f692977a96d37448c69" have entirely different histories.

3 changed files with 38 additions and 66 deletions

View file

@ -124,11 +124,9 @@
} }
% endif % endif
## nb. this refers to the "home link" app title, next to small ## nb. this refers to the "menu-sized" app title in far left of main menu
## header logo in top left of screen
#navbar-brand-title { #navbar-brand-title {
font-weight: bold; font-weight: bold;
margin-left: 0.3rem;
} }
#header-index-title { #header-index-title {
@ -151,12 +149,6 @@
white-space: nowrap; white-space: nowrap;
} }
.wutta-form-wrapper {
margin-left: 5rem;
margin-top: 2rem;
width: 50%;
}
</style> </style>
</%def> </%def>
@ -307,7 +299,7 @@
<%def name="render_navbar_brand()"> <%def name="render_navbar_brand()">
<div class="navbar-brand"> <div class="navbar-brand">
<a class="navbar-item" href="${url('home')}"> <a class="navbar-item" href="${url('home')}">
<div style="display: flex; align-items: center;"> <div style="display: flex; gap: 0.3rem; align-items: center;">
${base_meta.header_logo()} ${base_meta.header_logo()}
<div id="navbar-brand-title"> <div id="navbar-brand-title">
${base_meta.global_title()} ${base_meta.global_title()}
@ -488,46 +480,38 @@
<%def name="render_crud_header_buttons()"> <%def name="render_crud_header_buttons()">
% if master: % if master:
% if master.viewing: % if master.viewing:
% if instance_editable and master.has_perm('edit'):
<wutta-button once <wutta-button once
tag="a" href="${master.get_action_url('edit', instance)}" tag="a" href="${master.get_action_url('edit', instance)}"
icon-left="edit" icon-left="edit"
label="Edit This" /> label="Edit This" />
% endif % if instance_deletable:
% if instance_deletable and master.has_perm('delete'):
<wutta-button once type="is-danger" <wutta-button once type="is-danger"
tag="a" href="${master.get_action_url('delete', instance)}" tag="a" href="${master.get_action_url('delete', instance)}"
icon-left="trash" icon-left="trash"
label="Delete This" /> label="Delete This" />
% endif % endif
% elif master.editing: % elif master.editing:
% if instance_viewable and master.has_perm('view'):
<wutta-button once <wutta-button once
tag="a" href="${master.get_action_url('view', instance)}" tag="a" href="${master.get_action_url('view', instance)}"
icon-left="eye" icon-left="eye"
label="View This" /> label="View This" />
% endif % if instance_deletable:
% if instance_deletable and master.has_perm('delete'):
<wutta-button once type="is-danger" <wutta-button once type="is-danger"
tag="a" href="${master.get_action_url('delete', instance)}" tag="a" href="${master.get_action_url('delete', instance)}"
icon-left="trash" icon-left="trash"
label="Delete This" /> label="Delete This" />
% endif % endif
% elif master.deleting: % elif master.deleting:
% if instance_viewable and master.has_perm('view'):
<wutta-button once <wutta-button once
tag="a" href="${master.get_action_url('view', instance)}" tag="a" href="${master.get_action_url('view', instance)}"
icon-left="eye" icon-left="eye"
label="View This" /> label="View This" />
% endif
% if instance_editable and master.has_perm('edit'):
<wutta-button once <wutta-button once
tag="a" href="${master.get_action_url('edit', instance)}" tag="a" href="${master.get_action_url('edit', instance)}"
icon-left="edit" icon-left="edit"
label="Edit This" /> label="Edit This" />
% endif % endif
% endif % endif
% endif
</%def> </%def>
<%def name="render_prevnext_header_buttons()"></%def> <%def name="render_prevnext_header_buttons()"></%def>

View file

@ -9,9 +9,7 @@
${h.form(request.current_route_url(), enctype='multipart/form-data', ref='saveSettingsForm', **{'@submit': 'saveSettingsFormSubmit'})} ${h.form(request.current_route_url(), enctype='multipart/form-data', ref='saveSettingsForm', **{'@submit': 'saveSettingsFormSubmit'})}
${h.csrf_token(request)} ${h.csrf_token(request)}
<div class="wutta-form-wrapper">
${self.form_content()} ${self.form_content()}
</div>
${h.end_form()} ${h.end_form()}
<b-modal has-modal-card <b-modal has-modal-card
@ -150,18 +148,8 @@
ThisPageData.settingsNeedSaved = false ThisPageData.settingsNeedSaved = false
ThisPageData.undoChanges = false ThisPageData.undoChanges = false
ThisPageData.savingSettings = false ThisPageData.savingSettings = false
ThisPageData.validators = []
ThisPage.methods.saveSettings = function() { ThisPage.methods.saveSettings = function() {
for (let validator of this.validators) {
let msg = validator.call(this)
if (msg) {
alert(msg)
return
}
}
this.savingSettings = true this.savingSettings = true
this.$refs.saveSettingsForm.submit() this.$refs.saveSettingsForm.submit()
} }

View file

@ -2,11 +2,11 @@
<%inherit file="/page.mako" /> <%inherit file="/page.mako" />
<%def name="page_content()"> <%def name="page_content()">
<div style="margin-top: 2rem; width: 50%;">
% if form is not Undefined: % if form is not Undefined:
<div class="wutta-form-wrapper">
${form.render_vue_tag()} ${form.render_vue_tag()}
</div>
% endif % endif
</div>
</%def> </%def>
<%def name="render_vue_templates()"> <%def name="render_vue_templates()">