[Rt-commit] rt branch 5.0/smaller-filter-icon created. rt-5.0.3-346-gb6c94a1c36

BPS Git Server git at git.bestpractical.com
Thu Mar 30 17:52:56 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/smaller-filter-icon has been created
        at  b6c94a1c36dc568c2fef995f783788f67cadee79 (commit)

- Log -----------------------------------------------------------------
commit b6c94a1c36dc568c2fef995f783788f67cadee79
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Mar 30 13:51:25 2023 -0400

    Show solid funnel if the header is a filter in the search
    
    This gives a visual of which columns are being used to
    filter the current search.

diff --git a/share/html/Elements/CollectionAsTable/Header b/share/html/Elements/CollectionAsTable/Header
index b8ba86ea0f..80f5f139e8 100644
--- a/share/html/Elements/CollectionAsTable/Header
+++ b/share/html/Elements/CollectionAsTable/Header
@@ -231,7 +231,14 @@ foreach my $col ( @Format ) {
             $field = "CustomField.{$name}";
         }
 
-        if ( $field ) {
+        if ( $field && $field eq 'Subject' ) {
+            my $tooltip = loc( 'Filter on [_1]', loc($field) );
+            $m->out(
+                qq{ <a href="javascript:void(0)" class="btn btn-primary button search-filter"><img src="/static/images/funnel-fill.svg" data-toggle="tooltip" data-placement="bottom" data-original-title="$tooltip"></span></a>}
+            );
+            $m->out( $m->scomp( '/Elements/SearchFilter', Attribute => $field, %ARGS ) );
+        }
+        elsif ( $field ) {
             my $tooltip = loc( 'Filter on [_1]', loc($field) );
             $m->out(
                 qq{ <a href="javascript:void(0)" class="btn btn-primary button search-filter"><img src="/static/images/funnel.svg" role="img" data-toggle="tooltip" data-placement="bottom" data-original-title="$tooltip"></span></a>}

commit f41291d7c328774a2b864ac6a4ac1510dafef5ba
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Mar 30 13:34:40 2023 -0400

    Replace fontawesome funnel icon with bootstrap version
    
    We wanted a version of the funnel icon with just the outline
    and no fill, and that icon is not in the fontawesome free
    collection, so switch to the MIT licensed bootstrap version
    which provides both the solid and outline funnels.
    
    The color is set directly in the svg files by changing "fill"
    from the default bootstrap version.
    
    This update also makes the icon a bit smaller.

diff --git a/devel/third-party/README b/devel/third-party/README
index e870e5c568..0a50816487 100644
--- a/devel/third-party/README
+++ b/devel/third-party/README
@@ -19,6 +19,12 @@ Description: modern select with intuitive multiselection, searching, and much mo
 Origin: https://github.com/snapappointments/bootstrap-select
 License: MIT
 
+* bootstrap-icons-1.10.3
+Description: Official open source SVG icon library for Bootstrap with over 1,900 icons
+Origin: https://github.com/twbs/icons
+License: MIT
+Note: Various individual svg icon files pulled directly into share/static/images
+
 * Chart-2.9.4
 Description: HTML5 Charts using the <canvas> tag
 Origin: https://github.com/chartjs/Chart.js
diff --git a/share/html/Elements/CollectionAsTable/Header b/share/html/Elements/CollectionAsTable/Header
index 51e7f60b0f..b8ba86ea0f 100644
--- a/share/html/Elements/CollectionAsTable/Header
+++ b/share/html/Elements/CollectionAsTable/Header
@@ -234,7 +234,7 @@ foreach my $col ( @Format ) {
         if ( $field ) {
             my $tooltip = loc( 'Filter on [_1]', loc($field) );
             $m->out(
-                qq{ <a href="javascript:void(0)" class="search-filter" class="btn btn-primary button"><span class="fas fa-filter" data-toggle="tooltip" data-placement="bottom" data-original-title="$tooltip"></span></a>}
+                qq{ <a href="javascript:void(0)" class="btn btn-primary button search-filter"><img src="/static/images/funnel.svg" role="img" data-toggle="tooltip" data-placement="bottom" data-original-title="$tooltip"></span></a>}
             );
             $m->out( $m->scomp( '/Elements/SearchFilter', Attribute => $field, %ARGS ) );
         }
diff --git a/share/static/css/elevator-light/ticket-search.css b/share/static/css/elevator-light/ticket-search.css
index 01470c1700..4354ac8aeb 100644
--- a/share/static/css/elevator-light/ticket-search.css
+++ b/share/static/css/elevator-light/ticket-search.css
@@ -9,3 +9,23 @@
 #pick-criteria .value .form-row {
     margin-top: 0;
 }
+
+/* The below mostly clears default button styles from the special
+   case filter (funnel) icons */
+
+table.collection-as-table th.collection-as-table a.search-filter {
+    font-size: .3em;
+    background-color: unset;
+    vertical-align: left;
+    padding-left: 0em;
+    color: unset;
+}
+
+a.button:hover, a.btn-primary:focus, a.button:focus {
+    background: unset;
+    border-color: unset;
+}
+
+a.btn, a.btn:hover, a.btn:focus {
+    border: unset;
+}
diff --git a/share/static/images/funnel-fill.svg b/share/static/images/funnel-fill.svg
new file mode 100644
index 0000000000..e34633496e
--- /dev/null
+++ b/share/static/images/funnel-fill.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#3858a3" class="bi bi-funnel-fill" viewBox="0 0 16 16">
+  <path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z"/>
+</svg>
\ No newline at end of file
diff --git a/share/static/images/funnel.svg b/share/static/images/funnel.svg
new file mode 100644
index 0000000000..95a147a1bd
--- /dev/null
+++ b/share/static/images/funnel.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#3858a3" class="bi bi-funnel" viewBox="0 0 16 16">
+  <path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2zm1 .5v1.308l4.372 4.858A.5.5 0 0 1 7 8.5v5.306l2-.666V8.5a.5.5 0 0 1 .128-.334L13.5 3.308V2h-11z"/>
+</svg>
\ No newline at end of file

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list