<commit_before>{% extends "blog/base.html" %}

{% load i18n %}
{% load wiki %}
{% load markup %}
{% load switchcase %}
{% load tagging_tags %}
{% load restructuredtext %}

{% block head_title %}{% blocktrans %}Your Blog Posts{% endblocktrans %}{% endblock %}

{% block extra_head %}
    <link rel="alternate" type="application/atom+xml" title="Blog Post Feed for All Users" href="/feeds/posts/all/" />
    <link rel="alternate" type="application/atom+xml" title="Blog Post Feed for User {{ user.username }}" href="/feeds/posts/only/{{ user.username }}/" />
{% endblock %}

{% block body %}
    <p><span class="warning">Note</span>: this is an <b>experimental</b> feature that is subject to massive change at any time.</p>
    
    <h1>{% trans "Your Posts" %}</h1>
    
    {% if blogs %}
        <table cellpadding="5" cellspacing="0" border="0" class="blog-list" width="100%">
            <th>Title</th>
            <th>Published On</th>
            <th>Status</th>
            <th></th>
            {% for post in blogs %}
                <tr class="{% cycle odd,even %}">
                    <td><b><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></b><br />
                        {% with post.tease|truncatewords:"50" as body %}
                            {% switch post.markup %}
                                {% case 'rst' %}{{ body|restructuredtext|wikiwords|safe }}{% endcase %}
                                {% case 'mrk' %}{{ body|force_escape|markdown|wikiwords }}{% endcase %}
                                {% case 'txl' %}{{ body|force_escape|textile|wikiwords }}{% endcase %}
                                {% case '' %}{{ body|force_escape|wikiwords|linebreaks|safe }}{% endcase %}
                            {% endswitch %}
                        {% endwith %}
                    </td>
                    <td nowrap>{{ post.publish|date }}</td>
                    <td>
                        {% with post.status as status %}
                            {% switch status %}
                                {% case 2 %}Published{% endcase %}
                                {% case 1 %}Draft{% endcase %}
                            {% endswitch %}
                        {% endwith %}
                    </td>
                    <td width="50px" align="center">
                        <form action="{% url blog_edit post.id %}" method="GET">
                            <input type="image" src="/site_media/pencil.png" border="0" title="{% trans "Edit Post" %}" />
                        </form>
                    </td>
                    <td align="right">
                        <form action="{% url blog_destroy post.id %}" method="POST">
                            <input type="image" src="/site_media/delete.png" border="0" title="{% trans "Delete Post" %}" />
                            <input type="hidden" name="action" value="delete"/>
                       </form>
                    </td>
                </tr>
            {% endfor %}<commit_msg>added back teaser, fixed problem with use of case for None case<commit_after>{% extends "blog/base.html" %}

{% load i18n %}
{% load wiki %}
{% load markup %}
{% load switchcase %}
{% load tagging_tags %}
{% load restructuredtext %}

{% block head_title %}{% blocktrans %}Your Blog Posts{% endblocktrans %}{% endblock %}

{% block extra_head %}
    <link rel="alternate" type="application/atom+xml" title="Blog Post Feed for All Users" href="/feeds/posts/all/" />
    <link rel="alternate" type="application/atom+xml" title="Blog Post Feed for User {{ user.username }}" href="/feeds/posts/only/{{ user.username }}/" />
{% endblock %}

{% block body %}
    <p><span class="warning">Note</span>: this is an <b>experimental</b> feature that is subject to massive change at any time.</p>
    
    <h1>{% trans "Your Posts" %}</h1>
    
    {% if blogs %}
        <table cellpadding="5" cellspacing="0" border="0" class="blog-list" width="100%">
            <th>Title</th>
            <th>Published On</th>
            <th>Status</th>
            <th></th>
            {% for post in blogs %}
                <tr class="{% cycle odd,even %}">
                    <td><b><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></b><br />
                        {% with post.tease|truncatewords:"50" as body %}
                            {% if post.markup %}
                                {% switch post.markup %}
                                    {% case 'rst' %}{{ body|restructuredtext|wikiwords|safe }}{% endcase %}
                                    {% case 'mrk' %}{{ body|force_escape|markdown|wikiwords }}{% endcase %}
                                    {% case 'txl' %}{{ body|force_escape|textile|wikiwords }}{% endcase %}
                                {% endswitch %}
                            {% else %}
                                {{ body|force_escape|wikiwords|linebreaks|safe }}
                            {% endif %}
                        {% endwith %}
                    </td>
                    <td nowrap>{{ post.publish|date }}</td>
                    <td>
                        {% with post.status as status %}
                            {% switch status %}
                                {% case 2 %}Published{% endcase %}
                                {% case 1 %}Draft{% endcase %}
                            {% endswitch %}
                        {% endwith %}
                    </td>
                    <td width="50px" align="center">
                        <form action="{% url blog_edit post.id %}" method="GET">
                            <input type="image" src="/site_media/pencil.png" border="0" title="{% trans "Edit Post" %}" />
                        </form>
                    </td>
                    <td align="right">
                        <form action="{% url blog_destroy post.id %}" method="POST">
                            <input type="image" src="/site_media/delete.png" border="0" title="{% trans "Delete Post" %}" />
                            <input type="hidden" name="action" value="delete"/>
                       </form>
                    </td>
                </tr>
            {% endfor %}
{'fraction_non_alphanumeric': 0.15978050355067785, 'fraction_numerical': 0.005810200129115558, 'mean_word_length': 1.411284046692607, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6523120', 'n_tokens_mistral': 1833, 'n_tokens_neox': 1589, 'n_words': 383}