Skip to content

Commit

Permalink
edits to package display
Browse files Browse the repository at this point in the history
  • Loading branch information
kra3 committed Mar 10, 2011
1 parent 8ec47f3 commit 38278f7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
1 change: 1 addition & 0 deletions py3k/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ def packages(page=1):
no_comments_packages = db.session.query(Distribution).outerjoin(Comment).filter(Comment.distribution_id==None).limit(5)
return render_template('show_package.html',
no_comments_packages=no_comments_packages,
captcha_key=get_captcha_key(),
page_obj=result)
22 changes: 11 additions & 11 deletions py3k/templates/search_package.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
{% block body %}

{% macro render_pagination(pagination, endpoint) %}
<div class=pagination style="font-size: 14pt;text-align:center">
{%- for page in pagination.iter_pages() %}
{% if page %}
{% if page != pagination.page %}
<a href="{{ url_for(endpoint, name=searchname, page=page) }}">{{ page }}</a>
<div class=pagination style="font-size: 14pt;text-align:center">
{%- for page in pagination.iter_pages() %}
{% if page %}
{% if page != pagination.page %}
<a href="{{ url_for(endpoint, name=searchname, page=page) }}">{{ page }}</a>
{% else %}
<strong>{{ page }}</strong>
{% endif %}
{% else %}
<strong>{{ page }}</strong>
<span class=ellipsis>...</span>
{% endif %}
{% else %}
<span class=ellipsis>...</span>
{% endif %}
{%- endfor %}
</div>
{%- endfor %}
</div>
{% endmacro %}

{{ render_pagination(page_obj, 'search_package') }}
Expand Down
30 changes: 29 additions & 1 deletion py3k/templates/show_package.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
{% else %}
<span class=ellipsis>...</span>
{% endif %}

{%- endfor %}
</div>
{% endmacro %}
Expand Down Expand Up @@ -51,3 +50,32 @@
</li>
</ul>
{% endblock %}

{% block newprj %}
<form action="{{ url_for('save_new_project') }}" method=post>
<p>
<label for="prjname">Project Name</label>
<input id="prjname" name='projectname' placeholder="Project name">
</p>
<p>
<label for="homepg">Homepage</label>
<input id="homepg" type='url' name='home_page' placeholder="http://">
</p>
<p>
<label for="auth">Authors</label>
<input id="auth" name='author' placeholder="Author(s)">
</p>
<p>
<label for="summary">Summary</label>
<textarea id="summary" name='summary' placeholder="Some cool information about your wonderful project..." rows="6" cols="60"></textarea>
</p>
<p>
<label for="cap">Enter the letters here:</label>
<input id="cap" name='captchavalue'>
<img src="{{ url_for('captcha', key=captcha_key) }}" />
</p>
<input type=hidden name=captchakey value={{ captcha_key }}>
<p><input value="Submit" type="submit"></p>
</form>
{% endblock %}

0 comments on commit 38278f7

Please sign in to comment.