Guest User

navbar.html

a guest
Jun 24th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.91 KB | None | 0 0
  1. <!-- get the error message from wtf forms -->  
  2. {% from "_formhelpers.html" import render_field %}
  3. <header>
  4.     <h1> somewebsite.com</h1>
  5.    
  6.     <p> A website for stuff and other things...</p>
  7.     <nav>
  8.         <ul>
  9.             <!-- beginning of links -->
  10.             <li>
  11.                 <a href="{{ url_for ('payment.donations') }}">Donations</a>
  12.             </li>
  13.             <li>
  14.                 <a href="{{ url_for ('main.home') }}">Home</a>
  15.             </li>    
  16.             <li>
  17.                 <a href="{{ url_for ('main.about') }}">About</a>
  18.             </li>
  19.             <!-- if the current user is logged in the code activates -->
  20.             {% if current_user.is_authenticated %}
  21.                 <li>              
  22.                     <a href="{{ url_for ('auth.logoff') }}">Logoff</a>
  23.                 </li>
  24.                 <li>
  25.                     <a href="{{ url_for ('postinfo.new_post')}}">New Posts</a>
  26.                 </li>
  27.                 <li>
  28.                     <a href="{{ url_for ('main.profile', username = current_user.username) }}"> Profile </a>
  29.                 </li>
  30.             <!-- if the current user is not logged in the code activates -->
  31.             {% else %}
  32.                 <li>
  33.                     <a href="{{ url_for ('auth.login') }}">Login</a>
  34.                 </li>
  35.                 <li>
  36.                     <a href="{{ url_for ('auth.register') }}">Register</a>
  37.                 </li>
  38.             {% endif %}
  39.             <li>  
  40.                 <!-- redirected to /search when I fill out the form -->
  41.                 <form class="searchform" method="POST" action="{{ url_for('main.search') }}">
  42.                         {{ searchform.csrf_token }}
  43.                         {{ searchform.search_input(placeholder='search') }}
  44.                         <input type=submit value=search>
  45.                 </form>
  46.             </li>    
  47.         </ul>
  48.     </nav>
  49. </header>
Advertisement
Add Comment
Please, Sign In to add comment