Commits

Anonymous committed 950c27c

верстка тут и там. комменты выглядят более или менее сносно

Comments (0)

Files changed (9)

bsproj/templates/brainstill/idea_detail.html

   </p>
   <p class="description">{{ idea.description|linebreaksbr }}</p>
 
-  {% get_comment_count for idea as comment_count %}
-  {% ifequal comment_count 0 %}
-    <p class="info">{% trans "No comments." %}</p>
-  {% else %}
-    <p class="info">
-      {% blocktrans count comment_count as count %}{{ count }} comment.{% plural %}{{ count }} comments.{% endblocktrans %}
-    </p>
-  {% endifequal %}
+  <a name="comments"></a>
 
-  {% render_comment_list for idea %}
+  {% get_comment_list for idea as comment_list %}
+  {% for comment in comment_list %}
+    {% if forloop.first %}<ul class="comments">{% endif %}
+    <li id="c{{ forloop.counter }}">
+      <address>
+        <a href="#c{{ forloop.counter }}" class="anchor">#{{ forloop.counter }}</a>
+        {% ifequal comment.user idea.author %}
+          {% blocktrans with comment.user as author and comment.submit_date|date:"SHORT_DATETIME_FORMAT" as date_posted %}<span class="author">{{ author }} (idea author)</span> @ <span class="date-posted">{{ date_posted }}</span>{% endblocktrans %}
+        {% else %}
+          {% blocktrans with comment.user as author and comment.submit_date|date:"SHORT_DATETIME_FORMAT" as date_posted %}<span class="author">{{ author }}</span> @ <span class="date-posted">{{ date_posted }}</span>{% endblocktrans %}
+        {% endifequal %}
+      </address>
+      <p class="comment">{{ comment.comment|linebreaksbr }}</p>
+    </li>
+  {% endfor %}
 
   {% with idea.get_absolute_url as next %}
     {% render_comment_form for idea %}

bsproj/templates/brainstill/idea_new.html

       </dd>
       {% endfor %}
       <dt>&nbsp;</dt>
-      <dd>
+      <dd class="submit-row">
         <button class="submit" type="submit" name="action"
                 value="submit">{% trans "Submit" %}</button>
         <a href="{{ project.get_absolute_url }}">{% trans "Cancel" %}</a>

bsproj/templates/brainstill/project_detail.html

     <li class="idea">
       <a name="{{ idea.pk }}"></a>
       <h2>
-        <span class="idea-number">#{{ idea.pk }} </span>
+        <span class="idea-number"><a href="{{ idea.project.get_absolute_url }}#{{ idea.pk }}" class="anchor">#{{ idea.pk }}</a></span>
         <span class="idea-title"><a href="{{ idea.get_absolute_url }}">{{ idea }}</a></span>
         {% ranks_and_votes idea %}
       </h2>
       </p>
       <p class="description">{{ idea.description|linebreaksbr }}</p>
       {% get_comment_count for idea as comment_count %}
-      {% ifequal comment_count 0 %}
-        <p class="info">{% trans "No comments." %}</p>
-      {% else %}
-        <p class="info">
-          {% blocktrans count comment_count as count %}{{ count }} comment.{% plural %}{{ count }} comments.{% endblocktrans %}
-        </p>
-      {% endifequal %}
+      <p class="comments-info"><a href="{{ idea.get_absolute_url }}#comments">{% spaceless %}
+        {% ifequal comment_count 0 %}
+          {% trans "Post first comment &rarr;" %}
+        {% else %}
+          {% blocktrans count comment_count as count %}Read {{ count }} comment &rarr;{% plural %}Read {{ count }} comments &rarr;{% endblocktrans %}
+        {% endifequal %}
+      {% endspaceless %}</a></p>
     </li>
     {% if forloop.last %}</ul>{% endif %}
   {% empty %}

bsproj/templates/brainstill/project_list.html

 {% extends "layout0.html" %}
 {% load i18n %}
 
+{% block to_project_list %}{% endblock %}
+
 {% block content %}
   <h1>{% trans "All projects" %}</h1>
   <p class="info">

bsproj/templates/comments/form.html

       </p>
     {% endif %}
   {% endfor %}
-  <p><button class="submit" type="submit" name="post">{% trans "Post" %}</button></p>
+  <p class="submit-row"><button class="submit" type="submit" name="post">{% trans "Post" %}</button></p>
 </form>

bsproj/templates/layout0.html

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <title>{% block title %}brainstill: share an ideas!{% endblock %}</title>
+  <title>{% block title %}{% trans "brainstill: share an ideas!" %}{% endblock %}</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link href="{{ MEDIA_URL }}style.css" rel="stylesheet" type="text/css" />
 </head>
 {% endblock header %}
 
   <div id="nav-menu">
+    {% block to_project_list %}<div id="to-project-list">
+      <p>
+        <a href="{% url brainstill_project_list %}">{% trans "&larr; to project list" %}</a>
+      </p>
+    </div>{% endblock %}
     <div id="account">
       {% if user.is_authenticated %}
         <p class="authenticated">

bsproj/templates/registration/login.html

       </dd>
       {% endfor %}
       <dt>&nbsp;</dt>
-      <dd>
+      <dd class="submit-row">
         <button class="submit" type="submit">{% trans "Log in" %}</button>
         <a href="{% url registration_register %}">{% trans "Register" %}</a>
       </dd>

bsproj/templates/registration/registration_form.html

       </dd>
       {% endfor %}
       <dt>&nbsp;</dt>
-      <dd>
+      <dd class="submit-row">
         <button class="submit" type="submit">{% trans "Register" %}</button>
       </dd>
     </dl>
 
 body, html {
   width: 100%;
-  color: #2e3436;
+  color: black;
   background-color: #ffffff;
   font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
   font-size: 11pt;
   text-decoration: none;
   border-bottom: 1px dotted #8ae234;
 }
+a.anchor {
+  text-decoration: none;
+  color: #888a85;
+}
+a.anchor:hover { text-decoration: underline; }
 
 strong { font-weight: bold; }
 
 }
 
 
-div#nav-menu { font-size: 75%; }
+div#nav-menu {
+  opacity: 0.6;
+  font-size: 75%;
+}
 div#nav-menu ul, div#nav-menu ul li, div#nav-menu div {
   display: inline;
   margin-right: 1.3ex;
   text-align: right;
   text-transform: lowercase;
 }
+div#nav-menu #to-project-list { float: left; }
 
 #content, #nav-menu, #footer { max-width: 1100px; }
 
 
-p.info {
+p.info, p.comments-info {
   font-size: 75%;
   color: #888a85;
 }
 p.description {
-  margin: 1em 0 3em 0;
+  margin: 1em 0;
   line-height: 130%;
 }
 
 ul#project-list h2, ul#idea-list h2 {
   font-size: 140%;
   line-height: 150%;
-  margin: 1.5em 0 0.5em 0;
+  margin: 1.8em 0 0.5em 0;
 }
 h2 .idea-number, h1 .idea-number { color: #888a85; }
 h2 .idea-title, h1 .idea-title { margin-right: 0.8ex; }
 .idea-ranks a {
   font-size: 65%;
   text-decoration: none;
+  margin-right: 1ex;
 }
 .idea-ranks .rank-buttons a:hover { text-decoration: underline; }
 .idea-ranks .rank-buttons .vote-demote { color: #ef2929; }
 .idea-ranks .rank-buttons .vote-promote { color: #4e9a06; }
 
 
-ul#idea-list p.comments {
-  margin: 1em 0;
-  font-size: 75%;
-}
-
 form dl {
   margin: 1em 0;
   width: 670px;
   font-size: 75%;
 }
 
+form .submit-row { font-size: 75%; }
+
 form.new-idea input, form.new-idea textarea, form.comment textarea { width: 450px; }
+
+ul.comments, form.comment {
+  margin-top: 3ex;
+  border-top: 1px solid #DADCD5;
+}
+form.comment { padding-top: 3ex; }
+ul.comments li {
+  margin-top: 3ex;
+  margin-bottom: 4ex;
+}
+ul.comments address {
+  font-size: 75%;
+  color: #888a85;
+}
+ul.comments p { margin: 0.8ex 3ex; }