Skip to content

Commit

Permalink
Fix admin action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-gardener committed Jan 11, 2024
1 parent 00ea9cb commit 990dcaa
Show file tree
Hide file tree
Showing 32 changed files with 78 additions and 80 deletions.
2 changes: 1 addition & 1 deletion public/css/mvm.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/mvm.css.map

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions public/sass/components/_breadcrumb.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.breadcrumbs, .breadcrumbs2 {
list-style: none;
.breadcrumbs, .breadcrumbs2 {
list-style: none;
overflow:hidden;
font-weight: 300;
padding: 0;
Expand All @@ -16,8 +16,8 @@

.breadcrumbs li > * {
color:black;
text-decoration: none;
position: relative;
text-decoration: none;
position: relative;
display: block;
padding:0.5em 0 0.5em 4em;

Expand All @@ -31,42 +31,42 @@
*/
.breadcrumbs li > *:before,
.breadcrumbs li > *:after{
content: " ";
display: block;
width: 0;
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
position: absolute;
top: 50%;
margin-top: -50px;
margin-top: -50px;
left: 100%;
border-left-width: 30px;
border-left-style:solid;
}

.breadcrumbs li:not(:last-child) > *:before {
.breadcrumbs li:not(:last-child) > *:before {
/*This should be the colour
you want the arrow*/
border-left-color: #E7E7E7;
/*The margin left here dictates the width of the arrow*/
margin-left: 3px;
/*And make sure the zindex is 1*/
z-index: 1;
}
z-index: 1;
}

.breadcrumbs li > *:after {
.breadcrumbs li > *:after {
/*BORDER LEFT should be the
same as the background colour*/
border-left-color: white;

/*Z index should be 2 to overlap*/
z-index: 2;
}
z-index: 2;
}



/*Now small, project specific
/*Now small, project specific
paddings etc*/
.breadcrumbs li:first-child > * {
padding-left: 1rem;
Expand Down Expand Up @@ -114,4 +114,3 @@ paddings etc*/
content: unset;
}


2 changes: 1 addition & 1 deletion templates/archive/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
with {'index': archives, 'label': 'archives'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'archive_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/archive/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% include 'partial/term-index.html.twig' with {'term': archive} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'id': archive.id, edit: 'archive_edit', 'delete': 'archive_delete'} %}
{% endblock %}

Expand Down
15 changes: 10 additions & 5 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@
{% endblock %}
<article class="container mx-auto {{ bornDigital ? 'born-digital' : '' }}">
<nav class="body-nav">
{% block breadcrumb %}
{% endblock %}
{% if is_granted('ROLE_CONTENT_ADMIN') %}
{% block admin %}
<ul class="breadcrumbs">
{% block breadcrumb %}
{% endblock %}
{% endif %}
</ul>

<div class="btn-toolbar">
<div class="btn-group ms-auto">
{% block action_buttons %}
{% endblock %}
</div>
</div>
</nav>
{% if block('pageheader') is defined %}
<header>
Expand Down
2 changes: 1 addition & 1 deletion templates/bundles/NinesBlogBundle/page/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h1>About</h1>
{% endblock %}

{% block admin %}
{% block action_buttons %}
<div class='btn-toolbar'>
<div class='btn-group ms-auto'>

Expand Down
2 changes: 1 addition & 1 deletion templates/bundles/NinesBlogBundle/page/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index_path': path('nines_blog_page_index'), 'index_label': 'About', 'show': page} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
<div class="btn-toolbar">
<div class="btn-group ms-auto">
<a href="{{ path('nines_blog_page_index') }}" class="btn btn-light">
Expand Down
2 changes: 1 addition & 1 deletion templates/content/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'content', 'index_label': 'Poems'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'content_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/content/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block title %}{{ content.firstLine }}{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit': 'content_edit', 'delete': 'content_delete', 'id': content.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/content_role/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'content_role', 'index_label': 'Poem Roles'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'content_role_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/content_role/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'content_role', 'index_label': 'Poem Roles', 'show': contentRole} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit': 'content_role_edit', 'delete': 'content_role_delete', 'id': contentRole.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/coterie/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'coterie'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'coterie_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/coterie/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block title %}{{ coterie.label }} {% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit': 'coterie_edit', 'delete': 'coterie_delete', 'id': coterie.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/feature/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endblock %}


{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'feature_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/feature/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'feature', 'show': feature} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}

{% include 'partial/toolbar.html.twig' with {'edit': 'feature_edit', 'delete': 'feature_delete', 'id': feature.id} %}

Expand Down
2 changes: 1 addition & 1 deletion templates/manuscript/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include 'partial/count.html.twig' with {'index': manuscripts, 'label': 'manuscripts'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'manuscript_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/manuscript/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h1>{{ manuscript.callNumber }}</h1>
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit': 'manuscript_edit', 'delete': 'manuscript_delete', 'id': manuscript.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/manuscript_role/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'manuscript_role', 'index_label': 'Manuscript Roles'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'manuscript_role_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/manuscript_role/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% endblock %}


{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit': 'manuscript_role_edit', 'delete': 'manuscript_role_delete', 'id': manuscriptRole.id} %}
{% endblock %}

Expand Down
17 changes: 7 additions & 10 deletions templates/partial/breadcrumb.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
{% endif %}
{% endset %}


<ul class="breadcrumbs">
<li><a href="{{ path('homepage') }}">Home</a></li>
{% if show is defined %}
<li><a href="{{ path }}">{{ label }}</a></li>
<li><span class="current">{{ show }}</span></li>
{% else %}
<li><span class="current">{{ label }}</span></li>
{% endif %}
</ul>
<li><a href="{{ path('homepage') }}">Home</a></li>
{% if show is defined %}
<li><a href="{{ path }}">{{ label }}</a></li>
<li><span class="current">{{ show }}</span></li>
{% else %}
<li><span class="current">{{ label }}</span></li>
{% endif %}
37 changes: 17 additions & 20 deletions templates/partial/toolbar.html.twig
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<div class="btn-toolbar">
<div class="btn-group ms-auto">
{% if is_granted('ROLE_CONTENT_ADMIN') %}
{% if new is defined %}
<a href="{{ path(new) }}" class="btn btn-light">
<i class="bi bi-plus-lg"></i> New
</a>
{% endif %}

{% if new is defined %}
<a href="{{ path(new) }}" class="btn btn-light">
<i class="bi bi-plus-lg"></i> New
</a>
{% endif %}
{% if edit is defined %}
<a href="{{ path(edit, {'id': id}) }}" class="btn btn-light">
<i class="bi bi-pencil-square"></i> Edit
</a>
{% endif %}

{% if edit is defined %}
<a href="{{ path(edit, {'id': id}) }}" class="btn btn-light">
<i class="bi bi-pencil-square"></i> Edit
</a>
{% endif %}

{% if delete is defined %}
<a href="{{ path(delete, {'id': id}) }}" class="btn btn-light" data-confirm="Are you sure you want to delete this record?">
<i class="bi bi-trash"></i> Delete
</a>
{% endif %}
</div>
</div>
{% if delete is defined %}
<a href="{{ path(delete, {'id': id}) }}" class="btn btn-light" data-confirm="Are you sure you want to delete this record?">
<i class="bi bi-trash"></i> Delete
</a>
{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion templates/period/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% include 'partial/count.html.twig' with {'index': periods, 'label': 'periods'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'period_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/period/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'period', 'show': period.label} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit':'period_edit', 'delete': 'period_delete', 'id': period.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/person/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include 'partial/count.html.twig' with {'index': people, 'label': 'people'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'person_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/person/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% include 'partial/term-index.html.twig' with {'term': person} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit':'person_edit', 'delete': 'person_delete', 'id': person.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/print_source/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include 'partial/count.html.twig' with {'index': printSources, 'label': 'print sources'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'print_source_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/print_source/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'print_source', 'index_label': 'Print Sources', 'show': printSource.label} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit': 'print_source_edit', 'delete': 'print_source_delete', 'id': printSource.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/region/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include 'partial/count.html.twig' with {'index': regions, 'label': 'regions'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'region_new'} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/region/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endblock %}


{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'edit': 'region_edit', 'delete': 'region_delete', 'id': region.id} %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion templates/theme/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include 'partial/breadcrumb.html.twig' with {'index': 'theme'} %}
{% endblock %}

{% block admin %}
{% block action_buttons %}
{% include 'partial/toolbar.html.twig' with {'new': 'theme_new'} %}
{% endblock %}

Expand Down
Loading

0 comments on commit 990dcaa

Please sign in to comment.