]> git.ipfire.org Git - ipfire.org.git/blobdiff - src/templates/base.html
wiki: Only match usernames when a word starts with @
[ipfire.org.git] / src / templates / base.html
index 3711e2d6c27d8d387217274bfaff49c5cf109715..87f7242f4261eb42d2d2c4369030664e1f681365 100644 (file)
                {% block head %}{% end block %}
        </head>
 
-       <body>
-               {% block container_large %}
-                       <nav class="navbar" role="navigation" aria-label="main navigation">
-                               <div class="container">
-                                       <div class="navbar-brand">
+       <body class="is-flex is-flex-direction-column">
+               <nav class="navbar" role="navigation" aria-label="main navigation">
+                       <div class="container">
+                               <div class="navbar-brand is-size-4">
+                                       {% if request.path.startswith("/location") %}
+                                               <a class="navbar-item" href="/location">
+                                                       {% module IPFireLogo("Location") %}
+                                               </a>
+                                       {% else %}
                                                <a class="navbar-item" href="/">
-                                                       {% if hostname.startswith("fireinfo.") %}
-                                                               <span class="is-size-4 has-text-weight-bold">IPFire</span><span class="has-text-primary is-size-4 has-text-weight-bold">_</span><span class="is-size-4 has-text-weight-bold">Fireinfo</span>
+                                                       {% if request.path.startswith("/fireinfo") %}
+                                                               {% module IPFireLogo("Fireinfo") %}
                                                        {% elif hostname.startswith("nopaste.") %}
-                                                               <span class="is-size-4 has-text-weight-bold">IPFire</span><span class="has-text-primary is-size-4 has-text-weight-bold">_</span><span class="is-size-4 has-text-weight-bold">Nopaste</span>
-                                                       {% elif hostname.startswith("people.") %}
-                                                               <span class="is-size-4 has-text-weight-bold">IPFire</span><span class="has-text-primary is-size-4 has-text-weight-bold">_</span><span class="is-size-4 has-text-weight-bold">People</span>
+                                                               {% module IPFireLogo("NoPaste") %}
                                                        {% else %}
-                                                               <span class="is-size-4 has-text-weight-bold">IPFire</span><span class="has-text-primary is-size-4 has-text-weight-bold">_</span>
+                                                               {% module IPFireLogo() %}
                                                        {% end %}
-
-                                                       {% if hostname.startswith("location.") %}
-                                                               {{ _("Location") }}
-                                                       {% elif hostname.startswith("wiki.") %}
-                                                               {{ _("Wiki") }}
-                                                       {% end %}
-                                               </a>
-                                               <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarMainMenu">
-                                                       <span aria-hidden="true"></span>
-                                                       <span aria-hidden="true"></span>
-                                                       <span aria-hidden="true"></span>
                                                </a>
-                                       </div>
-                                       <div class="navbar-menu" id="navbarMainMenu">
-                                               {% block menu %}
-                                                       {% if hostname.startswith("www.") or hostname.startswith("dev.") %}
+                                       {% end %}
 
-                                                               <div class="navbar-end">
-                                                                       <div class="navbar-item">
-                                                                               <a class="nav-link {% if request.path == "/features" %}active{% end %}" href="/features">{{ _("Features") }}</a>
-                                                                       </div>
+                                       <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarMainMenu">
+                                               <span aria-hidden="true"></span>
+                                               <span aria-hidden="true"></span>
+                                               <span aria-hidden="true"></span>
+                                       </a>
+                               </div>
+                               <div class="navbar-menu" id="navbarMainMenu">
+                                       {% block menu %}
+                                               {% if hostname.startswith("www.") or hostname.startswith("dev.") %}
+                                                       <div class="navbar-end">
+                                                               {# Show a search bar for blog #}
+                                                               {% if request.path.startswith("/blog") %}
+                                                                       {# Navigation for Blog Authors #}
+                                                                       {% if current_user and current_user.is_blog_author() %}
+                                                                               <a class="navbar-item is-tab {% if request.path == "/blog/drafts" %}is-active{% end %}" href="/blog/drafts">
+                                                                                       {{ _("My Drafts") }}
+                                                                               </a>
+                                                                       {% end %}
 
                                                                        <div class="navbar-item">
-                                                                               <a class="nav-link {% if request.path == "/support" %}active{% end %}" href="/support">{{ _("Support") }}</a>
+                                                                               <form action="/blog" method="GET">
+                                                                                       <div class="field">
+                                                                                               <div class="control has-icons-left">
+                                                                                                       <input class="input" type="text"
+                                                                                                               name="q" {% if q %}value="{{ q }}"{% end %}
+                                                                                                               placeholder="{{ _("Search Blog...") }}">
+                                                                                                       <span class="icon is-small is-left">
+                                                                                                               <i class="fas fa-search"></i>
+                                                                                                       </span>
+                                                                                               </div>
+                                                                                       </div>
+                                                                               </form>
                                                                        </div>
-
+                                                               {# Show a search bar for docs #}
+                                                               {% elif request.path.startswith("/docs") %}
                                                                        <div class="navbar-item">
-                                                                               <a class="nav-link {% if request.path.startswith("/blog") %}active{% end %}" href="/blog">{{ _("Blog") }}</a>
+                                                                               <form action="/docs/search" method="GET">
+                                                                                       <div class="field">
+                                                                                               <div class="control has-icons-left">
+                                                                                                       <input class="input" type="text"
+                                                                                                               name="q" {% if q %}value="{{ q }}"{% end %}
+                                                                                                               placeholder="{{ _("Search Documentation...") }}">
+                                                                                                       <span class="icon is-small is-left">
+                                                                                                               <i class="fas fa-search"></i>
+                                                                                                       </span>
+                                                                                               </div>
+                                                                                       </div>
+                                                                               </form>
                                                                        </div>
+                                                               {% end %}
 
-                                                                       <div class="navbar-item">
-                                                                               <a class="nav-link {% if request.path == "/community" %}active{% end %}" href="/community">{{ _("Community") }}</a>
-                                                                       </div>
+                                                               {# Location #}
+                                                               {% if request.path.startswith("/location") %}
+                                                                       <a class="navbar-item is-tab
+                                                                                       {% if request.path.startswith("/location/how-to-use") %}is-active{% end %}"
+                                                                                       href="/location/how-to-use">
+                                                                               {{ _("How To Use?") }}
+                                                                       </a>
 
-                                                                       <div class="navbar-item">
-                                                                               <a class="nav-link {% if request.path.startswith("/download") %}active{% end %}" href="/download">{{ _("Download") }}</a>
-                                                                       </div>
+                                                                       <a class="navbar-item is-tab
+                                                                                       {% if request.path == "/location/install" %}is-active{% end %}"
+                                                                                       href="/location/install">
+                                                                               {{ _("Install") }}
+                                                                       </a>
 
-                                                                       <div class="navbar-item">
-                                                                               <button class="button is-primary" href="https://www.ipfire.org/donate">
-                                                                                       <p class="has-text-centered has-text-weight-bold is-uppercase">
-                                                                                               {{ _("Donate") }}
-                                                                                       </p>
-                                                                               </button>
-                                                                       </div>
-                                                               </div>
+                                                                       <a class="navbar-item is-tab
+                                                                                       {% if request.path == "/location/report-a-problem" %}is-active{% end %}"
+                                                                                       href="/location/report-a-problem">
+                                                                               {{ _("Report A Problem") }}
+                                                                       </a>
 
+                                                               {# Main #}
+                                                               {% else %}
+                                                                       <a class="navbar-item is-tab {% if request.path == "/about" %}is-active{% end %}" href="/about">{{ _("About") }}</a>
 
+                                                                       <a class="navbar-item is-tab {% if request.path.startswith("/docs") %}is-active{% end %}" href="/docs">{{ _("Documentation") }}</a>
 
-                                                               </div>
-                                                       {% elif hostname == "fireinfo.ipfire.org" %}
-                                                               <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
-                                                                               aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
-                                                                       <span class="fas fa-bars"></span>
-                                                               </button>
-
-                                                               <div class="collapse navbar-collapse" id="navbar">
-                                                                       <ul class="navbar-nav ml-auto">
-                                                                               {% if current_user and current_user.is_staff() %}
-                                                                                       <li class="nav-item">
-                                                                                               <a class="nav-link {% if request.path.startswith("/admin") %}active{% end %}" href="/admin">
-                                                                                                       {{ _("Admin") }}
-                                                                                               </a>
-                                                                                       </li>
-                                                                               {% end %}
-
-                                                                               <li class="nav-item">
-                                                                                       <a class="nav-link {% if request.path.startswith("/vendors") %}active{% end %}" href="/vendors">
-                                                                                               {{ _("Vendors") }}
-                                                                                       </a>
-                                                                               </li>
-                                                                       </ul>
-                                                               </div>
-                                                       {% elif hostname == "location.ipfire.org" %}
-                                                               <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
-                                                                               aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
-                                                                       <span class="fas fa-bars"></span>
-                                                               </button>
-
-                                                               <div class="collapse navbar-collapse" id="navbar">
-                                                                       <ul class="navbar-nav ml-auto">
-                                                                               <li class="nav-item">
-                                                                                       <a class="nav-link {% if request.path == "/how-to-use" %}active{% end %}" href="/how-to-use">
-                                                                                               {{ _("How To Use") }}
-                                                                                       </a>
-                                                                               </li>
+                                                                       <a class="navbar-item is-tab {% if request.path.startswith("/download") %}is-active{% end %}" href="/download">{{ _("Download") }}</a>
 
-                                                                               <li class="nav-item">
-                                                                                       <a class="nav-link {% if request.path == "/download" %}active{% end %}" href="/download">
-                                                                                               {{ _("Download") }}
-                                                                                       </a>
-                                                                               </li>
-                                                                       </ul>
+                                                                       <a class="navbar-item is-tab {% if request.path.startswith("/blog") %}is-active{% end %}" href="/blog">{{ _("Blog") }}</a>
 
-                                                                       <a class="btn btn-primary ml-lg-2" href="https://www.ipfire.org/donate">
-                                                                               {{ _("Donate") }}
+                                                                       <a class="navbar-item is-tab {% if request.path == "/help" %}is-active{% end %}" href="/help">{{ _("Help") }}</a>
+                                                               {% end %}
+
+                                                               <div class="navbar-item">
+                                                                       <a class="button is-lwl has-text-weight-bold is-uppercase"
+                                                                                       href="https://store.lightningwirelabs.com/?utm_source={{ hostname }}&amp;utm_medium=navigation">
+                                                                               {{ _("Buy") }}
                                                                        </a>
                                                                </div>
-                                                       {% elif hostname == "nopaste.ipfire.org" %}
-                                                               <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
-                                                                               aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
-                                                                       <span class="fas fa-bars"></span>
-                                                               </button>
-
-                                                               <div class="collapse navbar-collapse" id="navbar">
-                                                                       <ul class="navbar-nav ml-auto">
-                                                                               <li class="nav-item">
-                                                                                       <a class="nav-link" href="/?mode=upload">{{ _("Upload File") }}</a>
-                                                                               </li>
-                                                                       </ul>
+
+                                                               <div class="navbar-item">
+                                                                       <a class="button is-primary has-text-weight-bold is-uppercase"
+                                                                                       href="/donate">
+                                                                               {{ _("Donate") }}
+                                                                       </a>
                                                                </div>
-                                                       {% elif hostname == "people.ipfire.org" %}
+
                                                                {% if current_user %}
-                                                                       <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
-                                                                                       aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
-                                                                               <span class="fas fa-bars"></span>
-                                                                       </button>
-
-                                                                       <div class="collapse navbar-collapse" id="navbar">
-                                                                               <ul class="navbar-nav ml-auto mr-3">
-                                                                                       <li class="nav-item">
-                                                                                               <a class="nav-link {% if request.path == "/users/%s" % current_user.uid %}active{% end %}" href="/users/{{ current_user.uid }}">
-                                                                                                       {{ _("My Profile") }}
-                                                                                               </a>
-                                                                                       </li>
-
-                                                                                       {% if current_user.is_staff() %}
-                                                                                               <li class="nav-item">
-                                                                                                       <a class="nav-link {% if request.path == "/users" %}active{% end %}" href="/users">
-                                                                                                               {{ _("Users") }}
-                                                                                                       </a>
-                                                                                               </li>
-
-                                                                                               <li class="nav-item">
-                                                                                                       <a class="nav-link {% if request.path.startswith("/groups") %}active{% end %}" href="/groups">
-                                                                                                               {{ _("Groups") }}
-                                                                                                       </a>
-                                                                                               </li>
-
-                                                                                               <li class="nav-item">
-                                                                                                       <a class="nav-link {% if request.path == "/stats" %}active{% end %}" href="/stats">
-                                                                                                               {{ _("Stats") }}
-                                                                                                       </a>
-                                                                                               </li>
-                                                                                       {% end %}
-
-                                                                                       {% if current_user.has_sip() %}
-                                                                                               <li class="nav-item">
-                                                                                                       <a class="nav-link {% if request.path.startswith("/conferences") %}active{% end %}" href="/conferences">
-                                                                                                               {{ _("Conferences") }}
-                                                                                                       </a>
-                                                                                               </li>
-                                                                                       {% end %}
-                                                                               </ul>
-
-                                                                               <form class="my-2 my-lg-0" action="/search" method="GET">
-                                                                                       <input class="form-control form-control-sm mr-sm-2" type="search" name="q"
-                                                                                               placeholder="{{ _("Search") }}" aria-label="{{ _("Search") }}" value="{% try %}{{ q }}{% except %}{% end %}">
-                                                                               </form>
+                                                                       <div class="navbar-item has-dropdown is-hoverable">
+                                                                               <a class="navbar-link is-arrowless" href="/users/{{ current_user.uid }}">
+                                                                                       <figure class="image">
+                                                                                               <img class="is-rounded" style="width: auto" src="{{ current_user.avatar_url(128) }}">
+                                                                                       </figure>
+                                                                               </a>
+
+                                                                               <div class="navbar-dropdown">
+                                                                                       <a class="navbar-item" href="/users/{{ current_user.uid }}/passwd">
+                                                                                               {{ _("Change Password") }}
+                                                                                       </a>
+
+                                                                                       <hr class="navbar-divider">
+
+                                                                                       <a class="navbar-item" href="/logout">
+                                                                                               {{ _("Logout")}}
+                                                                                       </a>
+                                                                               </div>
                                                                        </div>
+                                                               {% else %}
+                                                                       <a class="navbar-item is-tab" href="/login?next={{ request.path }}">
+                                                                               <i class="fas fa-right-to-bracket" title="{{ _("Login") }}"></i>
+                                                                       </a>
                                                                {% end %}
-                                                       {% elif hostname == "wiki.ipfire.org" %}
-                                                               <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
-                                                                               aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
-                                                                       <span class="fas fa-bars"></span>
-                                                               </button>
-
-                                                               <div class="collapse navbar-collapse" id="navbar">
-                                                                       <form class=" ml-auto my-2 my-lg-0" action="/search" method="GET">
-                                                                               <input class="form-control form-control-sm" type="search" name="q"
-                                                                                       placeholder="{{ _("Search...") }}" aria-label="{{ _("Search") }}" value="{% try %}{{ q }}{% except %}{% end %}">
-                                                                       </form>
-
-                                                                       <a class="btn btn-primary ml-lg-2" href="https://www.ipfire.org/donate">
-                                                                               {{ _("Donate") }}
+                                                       </div>
+                                               {% elif request.path.startswith("/fireinfo") %}
+                                                       <div class="navbar-end">
+                                                               {% if current_user and current_user.is_staff() %}
+                                                                       <a class="navbar-item is-tab {% if request.path.startswith("/admin") %}is-active{% end %}" href="/admin">
+                                                                               {{ _("Admin") }}
                                                                        </a>
-                                                               </div>
-                                                       {% end %}
-                                               {% end block %}
-                                       </div>
+                                                               {% end %}
+
+                                                               <a class="navbar-item is-tab {% if request.path.startswith("/vendors") %}is-active{% end %}" href="/vendors">
+                                                                       {{ _("Vendors") }}
+                                                               </a>
+                                                       </div>
+                                               {% elif hostname.startswith("nopaste.") %}
+                                                       <div class="navbar-end">
+                                                               <a class="navbar-item is-tab {% if request.path == "/" %}is-active{% end %}" href="/">
+                                                                       {{ _("Paste") }}
+                                                               </a>
+
+                                                               <a class="navbar-item is-tab {% if request.path == "/upload" %}is-active{% end %}" href="/upload">
+                                                                       {{ _("Upload") }}
+                                                               </a>
+                                                       </div>
+                                               {% end %}
+                                       {% end block %}
                                </div>
-                       </nav>
+                       </div>
+               </nav>
 
+               <div class="is-flex-grow-1 is-flex-shrink-0">
                        {% block container %}
                                <div class="container">
                                        {% block content %}{% end block %}
                                </div>
                        {% end block %}
-               {% end block %}
+               </div>
 
                {% block footer %}
-                       <footer>
-                               <div class="content">
-                                       <div class="container">
-                                               <div class="columns">
-                                                       <div class="column is-two-fifths">
-                                                               <section class="section">
-                                                                       <p class="is-size-4">
-                                                                               <span class="has-text-weight-bold">IPFire</span><span class="has-text-primary has-text-weight-bold">_</span>People
-                                                                       </p>
-                                                                       <p>
-                                                                               Join the community and sign up for our newsletter
-                                                                       </p>
-
-                                                                       <button class="button is-primary is-outlined is-medium"><span class="has-text-black has-text-weight-bold">JOIN NOW</span></button>
-
-                                                               </section>
-                                                       </div>
-                                                       <section class="section">
-                                                               <div class="column is-one-fifth">
-                                                                               <button class="button is-ghost">
-                                                                                               <a href="/about"><span class="is-underlined">{{ _("About") }}</span></a>
-                                                                               </button>
-                                                                               <br>
-                                                                               <button class="button is-ghost">
-                                                                                               <a  href="https://wiki.ipfire.org"><span class="is-underlined">{{ _("Wiki") }}</span></a>
-                                                                               </button>
-                                                                               <br>
-                                                                               <button class="button is-ghost">
-                                                                                               <a  href="/support"><span class="is-underlined">{{ _("Support") }}</span></a>
-                                                                               </button>
-                                                                               <br>
-                                                                               <button class="button is-ghost">
-                                                                                               <a  href="https://wiki.ipfire.org/devel"><span class="is-underlined">{{ _("Development") }}</span></a>
-                                                                               </button>
+                       <footer class="footer is-flex-shrink-0">
+                               <div class="container">
+                                       {% if request.path == "/docs" %}
+                                               <div class="level">
+                                                       <div class="level-left">
+                                                               <div class="level-item">
+                                                                       <a href="/docs/recent-changes">
+                                                                               {{ _("Recent Changes") }}
+                                                                       </a>
                                                                </div>
-                                                       </section>
-                                                       <section class="section">
-                                                               <div class="column is-one-fifth">
-                                                                       <button class="button is-ghost">
-                                                                               <a href="/download"><span class="is-underlined">{{ _("Download") }}</span></a>
-                                                                       </button>
-                                                                       <br>
-                                                                       <button class="button is-ghost">
-                                                                               <a href="/blog"><span class="is-underlined">{{ _("Blog") }}</span></a>
-                                                                       </button>
-                                                                       <br>
-                                                                       <button class="button is-ghost">
-                                                                               <a href="https://community.ipfire.org/"><span class="is-underlined">{{ _("Community") }}</span></a>
-                                                                       </button>
-                                                                       <br>
-                                                                       <button class="button is-ghost">
-                                                                               <a href="/legal"><span class="is-underlined">{{ _("Legal") }}</span></a>
-                                                                       </button>
+
+                                                               {% if current_user %}
+                                                                       <div class="level-item">
+                                                                               <a href="/docs/watchlist">
+                                                                                       {{ _("My Watchlist") }}
+                                                                               </a>
+                                                                       </div>
+                                                               {% end %}
+
+                                                               <div class="level-item">
+                                                                       <a href="/docs/tree">
+                                                                               {{ _("Tree") }}
+                                                                       </a>
+                                                               </div>
+                                                       </div>
+                                               </div>
+                                       {% end %}
+
+                                       <div class="level">
+                                               <div class="level-left">
+                                                       <div class="level-item">
+                                                               <div class="level is-mobile">
+                                                                       <div class="level-item">
+                                                                               {{ year }} &copy; IPFire.org
+                                                                       </div>
+
+                                                                       <div class="level-item">
+                                                                               <a href="/legal">{{ _("Legal") }}</a>
+                                                                       </div>
+
+                                                                       {% if current_user and current_user.is_admin() %}
+                                                                               <div class="level-item">
+                                                                                       <a href="/analytics">{{ _("Analytics") }}</a>
+                                                                               </div>
+                                                                       {% end %}
+
+                                                                       <div class="level-item">
+                                                                               <a href="/sitemap">{{ _("Sitemap") }}</a>
+                                                                       </div>
                                                                </div>
-                                                       </section>
-                                                       <section class="section">
-                                                               <div class="column is-one-fifth">
-
-                                                                       <button class="button is-ghost">
-                                                                               <a  href="https://twitter.com/ipfire"><span class="is-underlined">{{ _("Twitter") }}</span></a>
-                                                                       </button>
-                                                                       <br>
-                                                                       <button class="button is-ghost">
-                                                                               <a  href="https://de.linkedin.com/company/ipfire"><span class="is-underlined">{{ _("LinkedIn") }}</span></a>
-                                                                       </button>
-                                                                       <br>
-                                                                       <button class="button is-primary is-medium" href="https://www.ipfire.org/donate">
-                                                                               <p class="has-text-centered has-text-weight-bold is-uppercase">
-                                                                                       {{ _("Donate") }}
-                                                                               </p>
-                                                                       </button>
+                                                       </div>
+                                               </div>
 
+                                               <div class="level-right">
+                                                       <div class="level-item">
+                                                               <div class="level is-mobile">
+                                                                       <div class="level-item">
+                                                                               <a href="https://social.ipfire.org/@news" title="{{ _("Mastodon") }}">
+                                                                                       <i class="fa-brands fa-mastodon px-2"></i>
+                                                                               </a>
+                                                                       </div>
+                                                                       <div class="level-item">
+                                                                               <a href="https://x.com/ipfire" title="{{ _("X") }}">
+                                                                                       <i class="fa-brands fa-x-twitter px-2"></i>
+                                                                               </a>
+                                                                       </div>
+                                                                       <div class="level-item">
+                                                                               <a href="https://linkedin.com/company/ipfire" title="{{ _("LinkedIn") }}">
+                                                                                       <i class="fa-brands fa-linkedin-in px-2"></i>
+                                                                               </a>
+                                                                       </div>
+                                                                       <div class="level-item">
+                                                                               <a href="https://www.facebook.com/IPFire.org/" title="{{ _("Facebook") }}">
+                                                                                       <i class="fa-brands fa-facebook-f px-2"></i>
+                                                                               </a>
+                                                                       </div>
                                                                </div>
                                                        </div>
-                                                       </section>
                                                </div>
                                        </div>
                                </div>