Skip to content

Commit

Permalink
Check if the wiki page already exists before try to add any attachmen…
Browse files Browse the repository at this point in the history
…ts to it.

Signed-off-by: James Tauber <jtauber@jtauber.com>
  • Loading branch information
bartTC authored and jtauber committed May 8, 2009
1 parent 297f633 commit 00da6f3
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions cpc_project/templates/wiki/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,27 @@ <h2><a href="{% url wiki_article article.title %}" rel="bookmark">{{ article.tit

{% show_tags_for article %}

{% get_attachments_for article %}
{% if attachments %}
<h2>{% trans "Attachments" %}</h2>

<ul>
{% for attachment in attachments %}
<li>
<img src="{{ MEDIA_URL }}pinax/images/silk/icons/attach.png" alt="" class="inline-icon"/>
<a href="{{ attachment.attachment_file.url }}">{{ attachment.filename }}</a>
- <span class="lighter">{{ attachment.created|date:_("DATETIME_FORMAT") }}</span>
{% attachment_delete_link attachment %}
</li>
{% endfor %}
</ul>
{% endif %}
{% if article.id %}

{% get_attachments_for article %}
{% if attachments %}
<h2>{% trans "Attachments" %}</h2>

<ul>
{% for attachment in attachments %}
<li>
<img src="{{ MEDIA_URL }}pinax/images/silk/icons/attach.png" alt="" class="inline-icon"/>
<a href="{{ attachment.attachment_file.url }}">{{ attachment.filename }}</a>
- <span class="lighter">{{ attachment.created|date:_("DATETIME_FORMAT") }}</span>
{% attachment_delete_link attachment %}
</li>
{% endfor %}
</ul>
{% endif %}

{% attachment_form article %}
{% attachment_form article %}

{% endif %}

{% if article.id and can_observe %}
{% if is_observing %}
Expand Down

0 comments on commit 00da6f3

Please sign in to comment.