Bugzilla – Attachment 146400 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), 6.06 KB, created by
Owen Leonard
on 2023-02-08 16:48:18 UTC
(
hide
)
Description:
Bug 32507: Use template wrapper to build breadcrumb navigation
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-02-08 16:48:18 UTC
Size:
6.06 KB
patch
obsolete
>From 591dd978bf84e1268b24cb7075943b4e9cfa126c 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 | 60 +++++++++++++++++++ > .../prog/en/modules/admin/cities.tt | 58 ++++++++---------- > 2 files changed, 84 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 7ea0a2bc0f..faed2b2e34 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -400,3 +400,63 @@ > [% content| $raw %] > </div> > [% END %] >+ >+[%# BOOTSTRAP BREADCRUMBS WRAPPER USAGE >+ [ WRAPPER breadcrumbs ] >+ [ Home breadcrumb automatically included ] >+ [ WRAPPER breadcrumb_item ] >+ <a href="/cgi-bin/koha/module/module-home.pl"> Module </a> >+ [ END ] >+ >+ [ IF op == 'add_form' ] >+ [ WRAPPER breadcrumb_item ] >+ <a href="/cgi-bin/koha/module/page.pl"> Module page </a> >+ [ END ] >+ [ WRAPPER breadcrumb_item active = 1 ] >+ Add form >+ [ END ] >+ >+ [ ELSIF op == 'delete_confirm' ] >+ [ WRAPPER breadcrumb_item ] >+ <a href="/cgi-bin/koha/module/page.pl"> Module page </a> >+ [ END ] >+ [ WRAPPER breadcrumb_item active = 1 ] >+ Confirm deletion >+ [ END ] >+ >+ [ ELSE ] >+ [ WRAPPER breadcrumb_item active = 1 ] >+ Module page >+ [ END ] >+ [ END #/IF op = add_form ] >+ >+ [ END #/ WRAPPER breadcrumbs ] >+ %] >+ >+[%# 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.30.2
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