Add some standard CRUD buttons for buefy themes
finally! also disable the permalink "feature" since it seems not useful
This commit is contained in:
parent
30f95e2f08
commit
31dff0d353
|
@ -51,14 +51,9 @@ header .navbar-item.nested {
|
|||
padding-left: 2.5rem;
|
||||
}
|
||||
|
||||
header .level #current-context,
|
||||
header .level-left #current-context {
|
||||
header span.header-text {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
header .level #current-context span,
|
||||
header .level-left #current-context span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
% if master.editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
<li>${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% if master.creates_multiple:
|
||||
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||
% else:
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<li>${h.link_to("View this {}".format(model_title), action_url('view', instance))}</li>
|
||||
% endif
|
||||
${self.context_menu_item_delete()}
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% if master.creates_multiple:
|
||||
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||
% else:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<%inherit file="/form.mako" />
|
||||
|
||||
<%def name="context_menu_item_delete()">
|
||||
% if master.deletable and instance_deletable and request.has_perm('{}.delete'.format(permission_prefix)):
|
||||
% if not use_buefy and master.deletable and instance_deletable and master.has_perm('delete'):
|
||||
% if master.delete_confirm == 'simple':
|
||||
<li>
|
||||
## note, the `ref` here is for buefy only
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
% if master.results_downloadable_xlsx and request.has_perm('{}.results_xlsx'.format(permission_prefix)):
|
||||
<li>${h.link_to("Download results as XLSX", url('{}.results_xlsx'.format(route_prefix)))}</li>
|
||||
% endif
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% if master.creates_multiple:
|
||||
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||
% else:
|
||||
|
|
|
@ -48,22 +48,24 @@
|
|||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Permalink for this {}".format(model_title), action_url('view', instance))}</li>
|
||||
## TODO: either make this configurable, or just lose it.
|
||||
## nobody seems to ever find it useful in practice.
|
||||
## <li>${h.link_to("Permalink for this {}".format(model_title), action_url('view', instance))}</li>
|
||||
% if master.has_versions and request.rattail_config.versioning_enabled() and request.has_perm('{}.versions'.format(permission_prefix)):
|
||||
<li>${h.link_to("Version History", action_url('versions', instance))}</li>
|
||||
% endif
|
||||
% if master.editable and instance_editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
% if not use_buefy and master.editable and instance_editable and master.has_perm('edit'):
|
||||
<li>${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
${self.context_menu_item_delete()}
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% if master.creates_multiple:
|
||||
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||
% else:
|
||||
<li>${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}</li>
|
||||
% endif
|
||||
% endif
|
||||
% if master.cloneable and request.has_perm('{}.clone'.format(permission_prefix)):
|
||||
% if not use_buefy and master.cloneable and master.has_perm('clone'):
|
||||
<li>${h.link_to("Clone this as new {}".format(model_title), url('{}.clone'.format(route_prefix), uuid=instance.uuid))}</li>
|
||||
% endif
|
||||
% if master.touchable and request.has_perm('{}.touch'.format(permission_prefix)):
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
% if master.rows_editable and instance_editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
<li>${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
% if instance_deletable and master.has_perm('delete_row'):
|
||||
% if not use_buefy and instance_deletable and master.has_perm('delete_row'):
|
||||
<li>${h.link_to("Delete this {}".format(model_title), action_url('delete', instance))}</li>
|
||||
% endif
|
||||
% if rows_creatable and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
|
|
|
@ -274,24 +274,48 @@
|
|||
<div id="current-context" class="level-item">
|
||||
% if master:
|
||||
% if master.listing:
|
||||
<span>${index_title}</span>
|
||||
<span class="header-text">
|
||||
${index_title}
|
||||
</span>
|
||||
% if use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
<once-button type="is-primary"
|
||||
tag="a" href="${url('{}.create'.format(route_prefix))}"
|
||||
icon-left="plus"
|
||||
style="margin-left: 1rem;"
|
||||
text="Create New">
|
||||
</once-button>
|
||||
% endif
|
||||
% elif index_url:
|
||||
<span class="header-text">
|
||||
${h.link_to(index_title, index_url)}
|
||||
</span>
|
||||
% if parent_url is not Undefined:
|
||||
<span> »</span>
|
||||
<span class="header-text">
|
||||
»
|
||||
</span>
|
||||
<span class="header-text">
|
||||
${h.link_to(parent_title, parent_url)}
|
||||
</span>
|
||||
% elif instance_url is not Undefined:
|
||||
<span> »</span>
|
||||
<span class="header-text">
|
||||
»
|
||||
</span>
|
||||
<span class="header-text">
|
||||
${h.link_to(instance_title, instance_url)}
|
||||
</span>
|
||||
% endif
|
||||
% if master.viewing and grid_index:
|
||||
${grid_index_nav()}
|
||||
% endif
|
||||
% else:
|
||||
<span>${index_title}</span>
|
||||
<span class="header-text">
|
||||
${index_title}
|
||||
</span>
|
||||
% endif
|
||||
% elif index_title:
|
||||
<span>${index_title}</span>
|
||||
<span class="header-text">
|
||||
${index_title}
|
||||
</span>
|
||||
% endif
|
||||
</div>
|
||||
|
||||
|
@ -384,8 +408,49 @@
|
|||
<h1 class="title" v-html="contentTitleHTML"></h1>
|
||||
</div>
|
||||
</div>
|
||||
% if show_prev_next is not Undefined and show_prev_next:
|
||||
<div class="level-right">
|
||||
% if use_buefy and master and master.viewing:
|
||||
## TODO: is there a better way to check if viewing parent?
|
||||
% if parent_instance is Undefined:
|
||||
% if master.editable and instance_editable and master.has_perm('edit'):
|
||||
<div class="level-item">
|
||||
<once-button tag="a" href="${action_url('edit', instance)}"
|
||||
icon-left="edit"
|
||||
text="Edit This">
|
||||
</once-button>
|
||||
</div>
|
||||
% endif
|
||||
% if master.cloneable and master.has_perm('clone'):
|
||||
<div class="level-item">
|
||||
<once-button tag="a" href="${action_url('clone', instance)}"
|
||||
icon-left="object-ungroup"
|
||||
text="Clone This">
|
||||
</once-button>
|
||||
</div>
|
||||
% endif
|
||||
% if master.deletable and instance_deletable and master.has_perm('delete'):
|
||||
<div class="level-item">
|
||||
<once-button tag="a" href="${action_url('delete', instance)}"
|
||||
type="is-danger"
|
||||
icon-left="trash"
|
||||
text="Delete This">
|
||||
</once-button>
|
||||
</div>
|
||||
% endif
|
||||
% else:
|
||||
## viewing row
|
||||
% if instance_deletable and master.has_perm('delete_row'):
|
||||
<div class="level-item">
|
||||
<once-button tag="a" href="${action_url('delete', instance)}"
|
||||
type="is-danger"
|
||||
icon-left="trash"
|
||||
text="Delete This">
|
||||
</once-button>
|
||||
</div>
|
||||
% endif
|
||||
% endif
|
||||
% endif
|
||||
% if show_prev_next is not Undefined and show_prev_next:
|
||||
% if prev_url:
|
||||
<div class="level-item">
|
||||
${h.link_to(u"« Older", prev_url, class_='button autodisable')}
|
||||
|
@ -404,9 +469,9 @@
|
|||
${h.link_to(u"Newer »", '#', class_='button', disabled='disabled')}
|
||||
</div>
|
||||
% endif
|
||||
</div>
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
% endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue