adding the new layout proposed by Lucas
authorLincoln de Sousa <lincoln@minaslivre.org>
Tue, 22 Jul 2008 02:41:55 +0000 (23:41 -0300)
committerLincoln de Sousa <lincoln@minaslivre.org>
Tue, 22 Jul 2008 02:41:55 +0000 (23:41 -0300)
eventos/templates/eventos/speaker-add.html
eventos/templates/eventos/speaker-details.html
eventos/templates/eventos/talk-add.html
eventos/templates/eventos/talk-details.html
eventos/templates/eventos/talk-list.html
media/css/geral.css
media/css/reset.css [new file with mode: 0755]
templates/base.html
templates/diario/entry_list.html
urls.py

index 8f98678..a6c5a0b 100644 (file)
@@ -1,6 +1,8 @@
 {% extends "base.html" %}
 
 {% block content %}
+<h2>Cadastrar-se como palestrante</h2>
+
 <form id="speaker-details" method="post" action="./">
   {{ uform.as_p }}
 
index 48320c4..1f1909f 100644 (file)
@@ -1,6 +1,8 @@
 {% extends "base.html" %}
 
 {% block content %}
+<h2>Editar dados pessoais</h2>
+
 <form id="speaker-details" method="post" action="./">
   {{ form.as_p }}
   <input type="submit" value="Ok" />
index 333adff..cf256b2 100644 (file)
@@ -1,6 +1,8 @@
 {% extends "base.html" %}
 
 {% block content %}
+<h2>Cadastrar trabalho</h2>
+
 <form id="talk-add" method="post" action="./">
   {{ form.as_p }}
   <input type="submit" value="Ok" />
index 093b991..3a8879b 100644 (file)
@@ -1,6 +1,8 @@
 {% extends "base.html" %}
 
 {% block content %}
+<h2>Detalhes do trabalho</h2>
+
 <form id="talk-details" method="post" action="./">
   {{ form.as_p }}
   <input type="submit" value="Ok" />
index 8a094e1..ae17a40 100644 (file)
@@ -9,6 +9,7 @@
       <th>Título</th>
       <th>Tipo</th>
       <th>Evento</th>
+      <th>&nbsp;</th>
     </tr>
   </thead>
   <tbody>
index 57dc4f2..a3457f6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- coding: utf-8 -*-
  *
- * Copyright (C) 2008 Lincoln de Sousa <lincoln@minaslivre.org>
+ * Copyright (C) 2008 Lucas Petes da Costa <lucas@milk-it.net>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
+@charset "UTF-8";
+/* CSS Document */
+
 body {
-    margin: 10px 114px 10px 10px;
-    font: normal 10pt verdana;
+background-color:#FFF;
+font-family:Arial, Helvetica, sans-serif;
+font-size:small;
+margin:0; padding:0;
+font-size:12px;
+}
+
+h1 {
+padding:35px 0 25px 18px;
+}
+
+div#esquerda {
+width:333px;
+float:left;
+}
+
+div#direita {
+margin-left:333px;
+}
+
+ul#menu {
+list-style:none;
+text-align:right;
+text-transform:uppercase;
 }
 
-h1.title {
-    background: url(/imgs/logo.png) no-repeat;
-    overflow: hidden;
-    height: 114px;
-    width: 300px;
+ul#menu li {
+height:46px;
+margin-bottom:-22px;
 }
 
-h1.title a {
-    display: block;
-    padding-top: 114px;
+ul#menu li a:hover, ul#menu li a.current {
+background:url(/imgs/li_menu.png);
+color:#F6D4D4;
 }
 
-#top {
-    margin-bottom: 20px;
+ul#menu li a {
+color:black;
+font-weight:bold;
+display:block;
+height:31px;
+padding:15px 21px 0 0;
+text-decoration:none;
+}
+
+div#top-right {
+height:99px;
+background:url(/imgs/el_border_top.png) no-repeat;
+padding-left:19px;
+}
+
+div#top-right form {
+padding-top:70px;
+margin-bottom:-35px;
+font-size:13px;
+}
+
+div#top-right input {
+font-size:14px;
+}
+
+div#top-right label {padding:0 10px;}
+
+ul#menu_usuario {
+list-style:none;
+padding-top:75px;
 }
 
-#top em {
-    font-size: 12pt;
-    margin-left: 114px;
+ul#menu_usuario li {
+display:inline;
+padding-right:5px;
+font-size:13px;
 }
 
-#login-form {
-    position: absolute;
-    top: 10px;
-    right: 114px;
+ul#menu_usuario a {
+color:#333;
+text-decoration:none;
+border-bottom:1px solid #f00;
 }
 
-#login-form h2 {
-    margin: 0px 0px 10px 0px;
+div#content {
+border-left:1px solid #777;
+background:url(/imgs/h2_left.png) no-repeat;
+padding:19px 30px 30px 30px;
 }
 
-ul#main-menu {
-    padding: 0px;
-    list-style: none;
-    margin-left: 114px;
+div#content h2 {
+margin-left:-8px;
+color:#FFF;
+font-size:22px;
+font-weight:bold;
+background:url(/imgs/h2_right.png) right no-repeat #222;
+padding-top:6px;
+margin-right:-30px;
+margin-bottom:35px;
 }
 
-ul#main-menu li {
-    display: inline;
-    margin-right: 10px;
+div#content h2 a {
+text-decoration: none;
+color: #FFF;
 }
 
-ul#main-menu li a {
-    text-decoration: none;
-    color: #666;
+div#content p {
+line-height:150%;
+margin-top:15px;
+text-align:justify;
 }
 
-ul#main-menu li a:hover {
-    text-decoration: underline;
-    color: red;
+div#content ul {
+list-style:url(/imgs/bullet.gif) inside;
+line-height:170%;
+margin-top:15px;
 }
 
-#content h3 a {
-    text-decoration: none;
-    color: #cc0000;
+div#content ol {
+list-style:inside decimal-leading-zero none;
+line-height:170%;
+margin-top:15px;
 }
 
-#content {
-    padding-left: 114px;
+/* Forms */
+
+input, textarea, select {
+color:#222;
+border:1px solid #c8c8c8;
+font-size:12px;
+}
+
+select { padding:0 0 0 1px;}
+
+form ul {
+list-style:none;
+margin:6px 0 10px 0;
+clear:none;
+float:left;
+width:100%;
+list-style:none !important;
+text-align:left;
+}
+
+form li {
+clear:both;
+float:left;
+padding: 5px 0 5px 0;
+width:100%;
+background:none;
+line-height:normal;
+margin:0;
+}
+
+form li div li {float:none;border:none;}
+form li div ul {float:none;margin:none;border:0;}
+form li div input {margin-right:10px;}
+
+form label {
+float:left;
+display:block;
+width:170px;
+}
+
+form label.inline {
+display:inline !important;
+float:none !important;
+margin-top:-2px;
+width:auto;
+padding-right:5px;
+}
+
+form li div {
+float:left;
+}
+
+form li div div { margin-left:0 !important; float:none !important; }
+
+div.button {margin-top:6px; padding-left:170px;}
+div.button input, input.button { color:#F6D4D4 !important; font-weight:bold; background: #CA0000; border:2px solid #9F0F0B !important; padding-left:10px; padding-right:10px; }
+input.button {font-size:13px !important; margin-left:6px;}
+div.button input.imagem { background:none !important; border:0 !important;}
+
+/* Tabelas */
+
+table {margin:auto; width:100%; margin-top:15px;}
+th {font-weight:bold; font-size:12px; color:#222; text-transform:uppercase; border-bottom:2px solid #dfdfdf !important;}
+th,td {
+padding:3px;
+border-bottom:1px solid #dfdfdf;
 }
\ No newline at end of file
diff --git a/media/css/reset.css b/media/css/reset.css
new file mode 100755 (executable)
index 0000000..cb05582
--- /dev/null
@@ -0,0 +1,39 @@
+/* -------------------------------------------------------------- \r
+  \r
+   reset.css\r
+   * Resets default browser CSS.\r
+   \r
+   Based on work by Eric Meyer:\r
+   * meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/\r
+   \r
+-------------------------------------------------------------- */\r
+\r
+html, body, div, span, object, iframe,\r
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,\r
+a, abbr, acronym, address, code,\r
+del, dfn, em, img, q, dl, dt, dd, ol, ul, li,\r
+fieldset, form, label, legend,\r
+table, caption, tbody, tfoot, thead, tr, th, td {\r
+       margin: 0;\r
+       padding: 0;\r
+       border: 0;\r
+       font-weight: inherit;\r
+       font-style: inherit;\r
+       font-size: 100%;\r
+       font-family: inherit;\r
+       vertical-align: baseline;\r
+}\r
+\r
+\r
+body { line-height: 1.5; background: #fff; margin:1.5em 0; }\r
+\r
+/* Tables still need 'cellspacing="0"' in the markup. */\r
+table { border-collapse: separate; border-spacing: 0; }\r
+caption, th, td { text-align: left; font-weight:400; }\r
+\r
+/* Remove possible quote marks (") from <q>, <blockquote>. */\r
+blockquote:before, blockquote:after, q:before, q:after { content: ""; }\r
+blockquote, q { quotes: "" ""; }\r
+\r
+a img { border: none; }\r
+\r
index f043e3f..15e0742 100644 (file)
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt_BR" lang="pt_BR">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <link href="/css/reset.css" type="text/css" rel="stylesheet" />
     <link href="/css/geral.css" rel="stylesheet" type="text/css" />
     <title>Gerenciador de eventos</title>
   </head>
   <body>
-    <div id="top">
-      <h1 class="title"><a href="/">Gerenciador de eventos</a></h1>
-      <em>"Livre para aprimorar"</em>
+    <div id="esquerda">
+      <h1><a href="/"><img src="/imgs/emsl.png" alt="EMSL - Encontro Mineiro de Software Livre" /></a></h1>
+      <ul id="menu">
+        <li><a href="/">Início</a></li>
+        {% for i in menus %}
+        <li><a href="{{ i.entry.get_absolute_url }}">{{ i }}</a></li>
+        {% endfor %}
+      </ul>
     </div>
 
-    {% if not user.is_authenticated %}
+    <div id="direita">
+      <div id="top-right">
 
-    <form id="login-form" action="/login/" method="post">
-      <h2>Autenticação</h2>
-      <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 %}
+        {% if not user.is_authenticated %}
+
+        <form id="login-form" action="/login/" method="post">
+          <label for="login" class="inline">usuário</label>
+          <input type="text" id="login" name="username" size="16" />
+          <label for="passwd" class="inline">senha</label>
+          <input type="password" id="passwd" name="password" size="16" />
+          <input type="submit" value="ENTRAR" class="button" />
+        </form>
 
-    <ul id="main-menu">
-      {% if user.is_authenticated %}
+        {% else %}
 
-      {% if user.palestrante_set.all %}
-      <li><a href="/speaker/{{ user.palestrante_set.get.id }}/">Editar dados pessoais</a></li>
-      <li><a href="/talks/add/">Enviar trabalho</a></li>
-      <li><a href="/speaker/{{ user.palestrante_set.get.id }}/talks/">Ver trabalhos cadastrados</a></li>
-      {% endif %}
+        <ul id="menu_usuario">
 
-      {% if user.participante_set.all %}
-      <li><a href="/gerar-boleto">Gerar Boleto</a></li>
-      {% endif %}
+          {% if user.palestrante_set.all %}
+          <li><a href="/speaker/{{ user.palestrante_set.get.id }}/">Editar dados pessoais</a></li>
+          <li><a href="/talks/add/">Enviar trabalho</a></li>
+          <li><a href="/speaker/{{ user.palestrante_set.get.id }}/talks/">Ver trabalhos cadastrados</a></li>
+          {% endif %}
 
-      {% if user.is_staff %}
-      <li><a href="/admin">Administrar o conteúdo</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>
+          {% if user.is_staff %}
+          <li><a href="/admin">Administrar o conteúdo</a></li>
+          {% endif %}
 
-      {% else %}
-      <li><a href="/speaker/add/">Cadastre-se para enviar trabalhos</a></li>
-      <!--<li><a href="/cadastro-participante">Cadastre-se para participar</a></li>-->
-      {% endif %}
-    </ul>
+          <li><a href="/logout">Sair</a></li>
+
+        </ul>
+
+        {% endif %}
+      </div>
 
     <div id="content">
       {% block content %}
+
       {% endblock %}
     </div>
   </body>
index c38748c..280a382 100644 (file)
@@ -3,7 +3,7 @@
 {% block content %}
 
 {% for entry in entry_list %}
-  <h3><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h3>
+  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
   {{ entry.body|safe }}  
   <p>Posted on {{ entry.pub_date|date:"F j, Y" }}</p>
 {% endfor %}
diff --git a/urls.py b/urls.py
index 6a1d60c..22476cb 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -1,12 +1,60 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2008 Lincoln de Sousa <lincoln@minaslivre.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
 from django.conf.urls.defaults import *
 from django.conf import settings
+from diario.settings import DIARIO_NUM_LATEST
+from diario.models import Entry
+from contents.models import Menu
 
 MEDIA = {'document_root': settings.INSTANCE('media')}
 
+# the only difference between info_dict and info_dict_full is that the
+# full version contains all entries and the other has just entries
+# without menus.
+
+hasmenu = [x.entry.id for x in Menu.objects.all()]
+info_dict = {
+    'queryset': Entry.published_on_site.exclude(id__in=hasmenu),
+    'template_object_name': 'entry',
+    'extra_context': {'menus': Menu.objects.all()},
+}
+
+info_dict_full = {
+    'queryset': Entry.published_on_site.all(),
+    'template_object_name': 'entry',
+    'extra_context': {'menus': Menu.objects.all()},
+}
+
 urlpatterns = patterns('',
     (r'^admin/', include('django.contrib.admin.urls')),
+
+    url(regex='^$',
+        view='django.views.generic.list_detail.object_list',
+        kwargs=dict(info_dict, paginate_by=DIARIO_NUM_LATEST),
+        name='index'),
+
+    url(regex='^(?P<year>\d{4})/(?P<month>[0-9]{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
+        view='diario.views.entries.entry_detail',
+        kwargs=dict(info_dict_full, slug_field='slug', month_format='%m',
+                    date_field='pub_date'),
+        name='diario-entry'),
+
     (r'^', include('ema.eventos.urls')),
-    (r'^', include('diario.urls.entries')),
 
     # static media
     (r'^(?P<path>imgs/.*)$', 'django.views.static.serve', MEDIA),