~chipaca/unity-lens-video/custom-user-agent

« back to all changes in this revision

Viewing changes to templates/main/elements/oneliner.html

  • Committer: Janos Gyerik
  • Date: 2012-04-03 20:38:05 UTC
  • Revision ID: janos@axiom-20120403203805-d2e6j78xee1dhttx
renamed "main" module to "oneliners"

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{% load markup %}
 
2
{% load comments %}
 
3
 
 
4
    <div class="oneliner well oneliner-{{oneliner.pk}}">
 
5
        <h3 class="summary">
 
6
            <a href="{% url oneliners.views.oneliner oneliner.pk %}">{{ oneliner.summary|capfirst }}</a>
 
7
            {% if user == oneliner.user %}
 
8
            <a class="btn" href="{% url oneliners.views.oneliner_edit oneliner.pk %}"><i class="icon-pencil"></i>{% if not oneliner.is_published %}<span class="draft">(Not published!)</span>{% endif %}</a>
 
9
            {% endif %}
 
10
        </h3>
 
11
 
 
12
        <pre><span class="add-on">bash$ </span>{{ oneliner.line }}</pre>
 
13
 
 
14
        <p class="author"><small>
 
15
        &mdash; by <a href="{% url oneliners.views.profile oneliner.user.pk %}"><span>{{ oneliner.user.hackerprofile.get_display_name }}</span></a>
 
16
            on <span>{{ oneliner.created_dt }}</span>
 
17
        </small></p>
 
18
 
 
19
        <div class="explanation">
 
20
            <h4>Explanation</h4>
 
21
            {{ oneliner.explanation|markdown:"safe" }}
 
22
        </div>
 
23
 
 
24
        {% if oneliner.limitations %}
 
25
        <div class="limitations">
 
26
            <h4>Limitations</h4>
 
27
            {{ oneliner.limitations|markdown:"safe" }}
 
28
        </div>
 
29
        {% endif %}
 
30
 
 
31
        {% if user == question.user and not question.is_answered %}
 
32
        <p><a href="{% url oneliners.ajax.question_answered question.pk oneliner.pk %}" class="btn btn-primary question-answered" data-parent="question-{{ question.pk }}">Accept this answer</a></p>
 
33
        {% endif %}
 
34
 
 
35
        {% if user.is_authenticated and not nobuttons %}
 
36
        <p>
 
37
            <a href="{% url oneliners.views.oneliner_alternative oneliner.pk %}" class="btn">Post an alternative one-liner</a>
 
38
            <a href="{% url oneliners.views.oneliner_comment oneliner.pk %}" class="btn"><i class="icon-comment"></i> Post a comment on this one-liner</a>
 
39
        </p>
 
40
        {% endif %}
 
41
 
 
42
        {% block related %}
 
43
        {% endblock %}
 
44
 
 
45
        {% get_comment_count for oneliner as comment_count %}
 
46
        {% if comment_count > 0 %}
 
47
        <div class="related">
 
48
            <h3 class="comments-toggle {{ comments_expanded }}"><img/>Comments ({{ comment_count }})</h3>
 
49
            <div class="well comments {{ comments_expanded }}">
 
50
            {% render_comment_list for oneliner %}
 
51
            {% if user.is_authenticated and not nobuttons %}
 
52
            <p><a href="{% url oneliners.views.oneliner_comment oneliner.pk %}" class="btn"><i class="icon-comment"></i> Post a comment on this one-liner</a></p>
 
53
            {% endif %}
 
54
            </div>
 
55
        </div>
 
56
        {% endif %}
 
57
 
 
58
    </div>