Skip to content
This repository has been archived by the owner on Oct 25, 2018. It is now read-only.

Commit

Permalink
Urgent bugfix due to personal stupidity.
Browse files Browse the repository at this point in the history
Note to self:
If you change any parameter names, you need to fix the templates that
contain any "url_for" calls. That took me entirely too long to figure out!!
Also, added a simple-debug.py for quick debugging. Derp, derp.
  • Loading branch information
hellerbarde committed May 31, 2012
1 parent a6573b7 commit 8b347ba
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions simple-debug.py
@@ -0,0 +1,4 @@
#!/usr/bin/env python2
import simple
simple.app.debug = True
simple.app.run()
10 changes: 5 additions & 5 deletions templates/admin.html
Expand Up @@ -15,9 +15,9 @@ <h1>Drafts <a href="{{ url_for('new_post') }}" class="button">New draft</a></h1>
{% for draft in drafts %}
<li id="post-{{ draft.id }}">
<h3>
<a href="{{ url_for('edit', id=draft.id) }}">{{ draft.title }}</a>
<a href="{{ url_for('edit', post_id=draft.id) }}">{{ draft.title }}</a>
<span class="links">
<a href="{{ url_for('delete', id=draft.id) }}" class="admin-delete" data-confirm="Are you sure?" rel="nofollow">x</a>
<a href="{{ url_for('delete', post_id=draft.id) }}" class="admin-delete" data-confirm="Are you sure?" rel="nofollow">x</a>
</span>
</h3>
</li>
Expand All @@ -31,15 +31,15 @@ <h2>Published <a href="{{ url_for('index') }}" class="button">Home</a></h2>
{% for post in posts %}
<li id="post-{{ post.id }}">
<h3>
<a href="{{ url_for('edit', id=post.id) }}">{{ post.title }}</a>
<a href="{{ url_for('edit', post_id=post.id) }}">{{ post.title }}</a>
<span class="links">
<a href="{{ url_for('view_post_slug', slug=post.slug) }}" class="admin-view">view</a>
<a href="{{ url_for('delete', id=post.id) }}" class="admin-delete" data-confirm="Are you sure?"
<a href="{{ url_for('delete', post_id=post.id) }}" class="admin-delete" data-confirm="Are you sure?"
data-method="delete" rel="nofollow">x</a>
</span>
</h3>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% endblock %}
4 changes: 2 additions & 2 deletions templates/edit.html
Expand Up @@ -27,7 +27,7 @@
<form accept-charset="UTF-8" action="" class="edit_post" id="edit_post" method="post">
<div class="sidebar-nav-fixed">
<p><a class="btn btn-inverse" href="{{ url_for("admin") }}">Admin</a></p>
<p><a class="btn btn-inverse" href="{{ url_for('delete', id=post.id, next="admin") }}">Delete</a> </p>
<p><a class="btn btn-inverse" href="{{ url_for('delete', post_id=post.id, next="admin") }}">Delete</a> </p>
<p>
<label for="post_draft">Draft</label>
<input name="post_draft" type="hidden" value="0" /><input id="post_draft" name="post_draft" type="checkbox" value="1" {% if post.draft %}checked{% endif %} />
Expand Down Expand Up @@ -80,7 +80,7 @@
<a href="{{ url_for('admin') }}">Admin</a>
</div>
<div>
<a href="{{ url_for('delete', id=post.id, next="admin" ) }}" class="delete-bar" data-confirm="Are you sure?" rel="nofollow">Delete</a>
<a href="{{ url_for('delete', post_id=post.id, next="admin" ) }}" class="delete-bar" data-confirm="Are you sure?" rel="nofollow">Delete</a>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/post_preview.html
Expand Up @@ -22,4 +22,4 @@ <h1>{{ post.title }}</h1>
</div>
</div>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions templates/view.html
Expand Up @@ -7,7 +7,7 @@
<br />
<li>
<p>
<a href="{{ url_for('edit', id=post.id) }}">Edit post</a>
<a href="{{ url_for('edit', post_id=post.id) }}">Edit post</a>
</p>
</li>
{% endif %}
Expand All @@ -32,4 +32,4 @@ <h1>{{ post.title }}</h1>
<a class="btn btn-inverse" href="{{ url_for('index', page=pid) }}">Back to Blog</a>
</div>
</section>
{% endblock %}
{% endblock %}

0 comments on commit 8b347ba

Please sign in to comment.