Bugzilla – Attachment 144742 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), 4.95 KB, created by
Owen Leonard
on 2022-12-20 16:51:51 UTC
(
hide
)
Description:
Bug 32507: Use template wrapper to build breadcrumb navigation
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-12-20 16:51:51 UTC
Size:
4.95 KB
patch
obsolete
>From 1f3a3ddf9444d252e0f5daf4eb334e2f7733c57a 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 >--- > .../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 52d645f255..1d974c8bfa 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 f78cd0f819..b71bcd2f72 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.20.1
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