adding main menu to the base template
authorLincoln de Sousa <lincoln@minaslivre.org>
Tue, 1 Jul 2008 01:45:24 +0000 (22:45 -0300)
committerLincoln de Sousa <lincoln@minaslivre.org>
Tue, 1 Jul 2008 01:45:24 +0000 (22:45 -0300)
templates/base.html

index 4479cee..5e7dc13 100644 (file)
@@ -9,6 +9,45 @@
   <body>
     <h1>Gerenciador de eventos</h1>
     <em>Livre para aprimorar</em>
+
+    {% if not user.is_authenticated %}
+
+    <form id="login-form" action="/login/" method="post">
+      <div class="field login">
+        <label for="login">Usuário</label>
+        <input type="text" name="username" id="login" />
+      </div>
+      <div class="field password">
+        <label for="password">Senha</label>
+        <input type="password" name="password" id="password" />
+      </div>
+      <div class="field submit">
+        <input type="submit" value="Ok" />
+      </div>
+    </form>
+    {% endif %}
+
+    <ul id="main-menu">
+      {% if user.is_authenticated %}
+
+      {% if user.palestrante_set.all %}
+      <li><a href="/editar-dados">Edite seus dados</a></li>
+      <li><a href="/enviar-trabalho">Enviar trabalho</a></li>
+      <li><a href="/trabalhos-cadastrados">Ver trabalhos cadastrados</a></li>
+      {% endif %}
+
+      {% if user.participante_set.all %}
+      <li><a href="/gerar-boleto">Gerar Boleto</a></li>
+      {% endif %}
+
+      <li><a href="/logout">Sair</a></li>
+
+      {% else %}
+      <li><a href="/cadastro-palestrante">Cadastre-se para enviar trabalhos</a></li>
+      <li><a href="/cadastro-participante">Cadastre-se para participar</a></li>
+      {% endif %}
+    </ul>
+
     {% block content %}
     {% endblock %}
   </body>