Bugzilla – Attachment 145147 Details for
Bug 32507
Use template wrapper to build breadcrumb navigation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32507: Use template wrapper to build breadcrumb navigation
Bug-32507-Use-template-wrapper-to-build-breadcrumb.patch (text/plain), 5.07 KB, created by
Martin Renvoize (ashimema)
on 2023-01-09 14:53:45 UTC
(
hide
)
Description:
Bug 32507: Use template wrapper to build breadcrumb navigation
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-01-09 14:53:45 UTC
Size:
5.07 KB
patch
obsolete
>From 494f53641e94e997a551cec6dd56a976156ba30a Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 20 Dec 2022 16:20:51 +0000 >Subject: [PATCH] Bug 32507: Use template wrapper to build breadcrumb > navigation > >This patch lays the groundwork for updating the way we build breadcrumb >navigation on each page, and implements it on the cities administration >page as a proof of concept. > >The page creates two blocks, 'breadcrumbs' and 'breadcrumb_item' > >'breadcrumbs' builds the outer structure of the menu, currently: > > <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> > <ol class="breadcrumb"> > >It automatically adds the "Home" link which appears on all pages. > >The 'breadcrumb_item' block builds the list item which contains the >individual link. > >To test, apply the patch and go to Administration -> Cities & towns. On >each variation of the page, check the breadcrumbs menu: > > - On the initial summary view it should be: > Home -> Administration -> Cities > - Click "New city" and the menu should be: > Home -> Administration -> Cities -> New city > - When you edit a city: > Home -> Administration -> Cities -> Modify city > - When you delete a city: > Home -> Administration -> Cities -> Confirm deletion of city > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/includes/html_helpers.inc | 28 +++++++++ > .../prog/en/modules/admin/cities.tt | 58 ++++++++----------- > 2 files changed, 52 insertions(+), 34 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index 52d645f255a..1d974c8bfa6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -341,3 +341,31 @@ > </table> <!-- /#itemst --> > </div> > [% END %] >+ >+[%# Used to build breadcrumb navigation nav %] >+[% BLOCK breadcrumbs %] >+ <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> >+ <ol> >+ [%# Include the Home link every time %] >+ [% WRAPPER breadcrumb_item %] >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ [% END %] >+ [% content | $raw %] >+ </ol> >+ </nav> >+[% END %] >+ >+[%# Used to build individual breadcrumb items in the breadcrumb nav %] >+[% BLOCK breadcrumb_item %] >+ [% IF ( active ) %] >+ <li> >+ <a href="#" aria-current="page"> >+ [% content | $raw %] >+ </a> >+ </li> >+ [% ELSE %] >+ <li> >+ [% content | $raw %] >+ </li> >+ [% END %] >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt >index f78cd0f8199..b71bcd2f722 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt >@@ -24,49 +24,39 @@ > [% END %] > > [% WRAPPER 'sub-header.inc' %] >-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> >- <ol> >- <li> >- <a href="/cgi-bin/koha/mainpage.pl">Home</a> >- </li> >- <li> >+ [% WRAPPER breadcrumbs %] >+ [% WRAPPER breadcrumb_item %] > <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> >- </li> >+ [% END %] > > [% IF op == 'add_form' %] >- <li> >+ [% WRAPPER breadcrumb_item %] > <a href="/cgi-bin/koha/admin/cities.pl">Cities</a> >- </li> >- <li> >- <a href="#" aria-current="page"> >- [% IF city.cityid %] >- <span>Modify city</span> >- [% ELSE %] >- <span>New city</span> >- [% END %] >- </a> >- </li> >+ [% END %] >+ [% WRAPPER breadcrumb_item active = 1 %] >+ [% IF city.cityid %] >+ <span>Modify city</span> >+ [% ELSE %] >+ <span>New city</span> >+ [% END %] >+ [% END %] > > [% ELSIF op == 'delete_confirm' %] >- <li> >+ [% WRAPPER breadcrumb_item %] > <a href="/cgi-bin/koha/admin/cities.pl">Cities</a> >- </li> >- <li> >- <a href="#" aria-current="page"> >- Confirm deletion of city >- </a> >- </li> >+ [% END %] >+ [% WRAPPER breadcrumb_item active = 1 %] >+ Confirm deletion of city >+ [% END %] > > [% ELSE %] >- <li> >- <a href="#" aria-current="page"> >- Cities >- </a> >- </li> >- [% END %] >- </ol> >-</nav> >-[% END %] >+ [% WRAPPER breadcrumb_item active = 1 %] >+ Cities >+ [% END %] >+ [% END #/IF op = add_form %] >+ >+ [% END #/ WRAPPER breadcrumbs %] >+[% END #/ WRAPPER sub-header.inc %] > > <div class="main container-fluid"> > <div class="row"> >-- >2.39.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32507
:
144742
|
144754
|
145070
|
145147
|
145148
|
146400
|
146401