aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models.py1
-rw-r--r--app/static/style.css29
-rw-r--r--app/templates/package_details.html33
-rw-r--r--app/views/__init__.py5
4 files changed, 60 insertions, 8 deletions
diff --git a/app/models.py b/app/models.py
index c5ce4b6..cfe1931 100644
--- a/app/models.py
+++ b/app/models.py
@@ -89,6 +89,7 @@ class Package(db.Model):
author_id = db.Column(db.Integer, db.ForeignKey('user.id'))
name = db.Column(db.String(100), nullable=False)
title = db.Column(db.String(100), nullable=False)
+ shortDesc = db.Column(db.Text, nullable=True)
desc = db.Column(db.Text, nullable=True)
type = db.Column(db.Enum(PackageType))
diff --git a/app/static/style.css b/app/static/style.css
index c9c28d6..551cc74 100644
--- a/app/static/style.css
+++ b/app/static/style.css
@@ -80,7 +80,6 @@ a:hover {
text-align: center;
color: #ddd;
text-decoration: none;
- margin: 5px 0 !important;
}
.buttonset li a:hover {
@@ -96,6 +95,24 @@ a:hover {
background: #474 !important;
}
+.linedbuttonset a {
+ border: 1px solid #eee;
+ border-radius: 3px;
+ padding: 4px 10px;
+ margin: 0;
+ display: block;
+}
+
+.linedbuttonset {
+ display: block;
+ margin: 0;
+}
+
+.linedbuttonset li {
+ display: inline-block;
+ margin: 10px 10px 0 0;
+}
+
/* Alerts */
#alerts {
@@ -196,6 +213,12 @@ footer a {
color: #666;
}
+.asideright {
+ float: right;
+ margin: 0 0 0 15px;
+ max-width: 300px;
+}
+
/* Mod */
@@ -243,3 +266,7 @@ footer a {
.sidebar_container .right > *:first-child, .sidebar_container .left > *:first-child {
margin-top: 0;
}
+
+.package-short-large {
+ font-size: 120%;
+}
diff --git a/app/templates/package_details.html b/app/templates/package_details.html
index c52cd62..b75be24 100644
--- a/app/templates/package_details.html
+++ b/app/templates/package_details.html
@@ -1,14 +1,33 @@
{% extends "base.html" %}
{% block title %}
-{{ package.title }}
+ {{ package.title }}
{% endblock %}
{% block content %}
- {{ package.title }}
- {{ package.author.display_name }}
- {{ package.name }}
- {{ package.desc }}
- <a href="{{ package.repo }}">VCS Repo</a>
- <a href="{{ package.issueTracker }}">Report Issue</a>
+ <h1>{{ package.title }} by {{ package.author.display_name }}</h1>
+
+ <aside class="asideright box box_grey">
+ <table>
+ <tr>
+ <td>Name</td>
+ <td>{{ package.name }}</td>
+ </tr>
+ <tr>
+ <td>Type</td>
+ <td>{{ package.type.getTitle() }}</td>
+ </tr>
+ </table>
+
+ <ul class="buttonset linedbuttonset">
+ {% if package.repo %}<li><a href="{{ package.repo }}">View Source</a></li>{% endif %}
+ {% if package.forums %}<li><a href="{{ package.forums }}">Forums</a></li>{% endif %}
+ {% if package.issueTracker %}<li><a href="{{ package.issueTracker }}">Issue Tracker</a></li>{% endif %}
+ {% if package.website %}<li><a href="{{ package.website }}">Website</a></li>{% endif %}
+ </ul>
+ </aside>
+
+ <p class="package-short-large">{{ package.shortDesc }}</p>
+
+ {{ package.desc | markdown }}
{% endblock %}
diff --git a/app/views/__init__.py b/app/views/__init__.py
index ed90875..9423453 100644
--- a/app/views/__init__.py
+++ b/app/views/__init__.py
@@ -7,8 +7,13 @@ import flask_menu as menu
from flask.ext import markdown
from sqlalchemy import func
from werkzeug.contrib.cache import SimpleCache
+from urllib.parse import urlparse
cache = SimpleCache()
+@app.template_filter()
+def domain(url):
+ return urlparse(url).netloc
+
# TODO: remove on production!
@app.route('/static/<path:path>')
def send_static(path):