]> git.agnieray.net Git - galette.git/commitdiff
Change version icon in footer on new release
authorGuillaume AGNIERAY <dev@agnieray.net>
Mon, 19 Feb 2024 23:45:16 +0000 (00:45 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Tue, 20 Feb 2024 06:34:18 +0000 (07:34 +0100)
refs #1785

galette/lib/Galette/Core/Galette.php
galette/templates/default/elements/footer.html.twig
ui/semantic/galette/globals/site.overrides

index 2775f8775795819c3d198aec39ebb4d04d31d54b..66cc8ff5c48f3871d0318e3f1bb15c5e335535af 100644 (file)
@@ -23,6 +23,7 @@ namespace Galette\Core;
 
 use Analog\Analog;
 use Galette\Entity\Adherent;
+use Galette\Util\Release;
 use RuntimeException;
 
 /**
@@ -71,6 +72,20 @@ class Galette
         return $galette_version;
     }
 
+    /**
+     * Get Galette new release
+     *
+     * @return array<string, string|array<string,mixed>>
+     */
+    public static function getNewRelease(): array
+    {
+        $release = new Release();
+        return [
+            'new' => $release->checkNewRelease(),
+            'version' => $release->getLatestRelease()
+        ];
+    }
+
     /**
      * Get all menus
      *
index 9bb434d0a9c99798abde2910cc8b2ed2750f26c7..3b41af80ab3f802dffbcfdac1ac4ad40bbad12dd 100644 (file)
@@ -18,6 +18,7 @@
  * along with Galette. If not, see <http://www.gnu.org/licenses/>.
  */
 #}
+{% set new_release = callstatic('\\Galette\\Core\\Galette', 'getNewRelease') %}
     <footer class="page-footer{% if login.getCompactMenu() %} extended"{% endif %}">
         <div class="ui center aligned basic padded segment footer-wrapper">
             <div class="row">
             </div>
             <div class="row">
                 <div class="ui horizontal bulleted link list">
-                    <a id="copyright" href="https://galette.eu/" class="item">
+                    <a id="copyright" href="https://galette.eu/" class="item{% if new_release.new %} tooltip" data-title="{{ _T("A new Galette release is available.") }}" data-content="{{ _T("You currently use Galette %1$s, and %2$s is available.")|replace({"%1$s": constant('GALETTE_DISPLAY_VERSION'), "%2$s": new_release.version}) }}"{% else %}"{% endif %}>
+{% if new_release.new and login.isLogged() and (login.isAdmin() or login.isStaff()) %}
+                        <div class="ui transition looping pulsating blue circular horizontal icon label">
+                            <i class="arrow alternate circle up icon" aria-hidden="true"></i>
+                            <span class="visually-hidden">{{ _T("A new Galette release is available.") }}</span>
+                        </div>
+{% else %}
                         <i class="icon cookie bite" aria-hidden="true"></i>
+{% endif %}
                         Galette {{ constant('GALETTE_DISPLAY_VERSION') }}
                     </a>
 {% if login.isLogged() and (login.isAdmin() or login.isStaff()) %}
index 14c9a9403f790983318741c826a5b0179c9c73c0..9974b2b336198893cf28e20b61ebf832b4578696 100644 (file)
@@ -187,6 +187,10 @@ footer .ui.horizontal.list > .item{
 footer.page-footer {
   position: relative;
   background-color: @pageBackground;
+
+  #copyright .pulsating.label i {
+    margin-right: 0;
+  }
 }
 main.pusher ~ footer.page-footer {
   transition: transform .5s ease;