Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't require a url in poweredby page

There are cases (applications) where just a link to source code is
available and in that case printing both the source and the url twice
looks silly
  • Loading branch information...
commit 3f6e20290d8fa4bf23d77ef2f16d7b855bad5e6f 1 parent 56a6adf
@wilsaj authored
View
3  flask_website/listings/projects.py
@@ -13,7 +13,8 @@ def __init__(self, name, url, description, source=None):
@property
def host(self):
- return urlparse(self.url)[1]
+ if self.url is not None:
+ return urlparse(self.url)[1]
@property
def sourcehost(self):
View
13 flask_website/templates/community/poweredby.html
@@ -1,15 +1,24 @@
{% extends "community/layout.html" %}
{% block title %}Powered By Flask{% endblock %}
+{% macro project_url(project) %}
+{%- if project.url -%}
+ {{ project.url }}
+ {%- elif project.source -%}
+ {{ project.source }}
+{%- endif -%}
+{% endmacro %}
{% macro render_projects(kind) %}
{% for project in projects[kind] %}
<div class=project>
- <h4><a href="{{ project.url }}">{{ project.name }}</a></h4>
+ <h4><a href="{{ project_url(project) }}">{{ project.name }}</a></h4>
<div class=description>
{{ project.description }}
</div>
<dl>
+ {% if project.url %}
<dt>URL:
<dd><a href="{{ project.url }}">{{ project.host }}</a>
+ {% endif %}
{% if project.source %}
<dt>Sourcecode:
<dd><a href="{{ project.source }}">{{ project.sourcehost }}</a>
@@ -23,7 +32,7 @@
<p>
This is a list of websites and projects that disclosed that they
are running on Flask. If you want your own website or project
- listed here,
+ listed here,
<a href=mailto:armin.ronacher@active-4.com>send me a mail</a>
with the URL, name and description of the website.
<h3>Websites</h3>
Please sign in to comment.
Something went wrong with that request. Please try again.