Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Table display styled. Some UX enhancements with search field.

  • Loading branch information...
commit f0b36ece5eac9d2cb52ab483374d65521eb3e871 1 parent 8a6d688
@kra3 kra3 authored
View
1  py3k/packages.py
@@ -118,6 +118,7 @@ def add_comment(name):
@app.route('/search/<name>/+<int:page>')
def search_package(name, page=1):
result = Distribution.query.filter(Distribution.name.like("%%%s%%"%name)).paginate(page)
+ no_comments_packages = db.session.query(Distribution).outerjoin(Comment).filter(Comment.distribution_id==None).limit(5)
return render_template('search_package.html',
page_obj=result,
end_point='search_package',
View
18 py3k/static/css/style.css
@@ -87,6 +87,8 @@ button { width: auto; overflow: visible; }
.works{color:#647e02;}
.fails{color:red;}
+.odd{background: #F4F9F9;}
+.even{background:#F4F4F2;}
input[type="search"] { -webkit-appearance: textfield;}
input, #dwnld {
border-radius:5px;
@@ -289,6 +291,22 @@ section form p input[type="submit"]{
margin-left: 110px;
margin-top: 5px;
}
+table#myTable{
+ width: 90%;
+ text-align: left;
+ margin: 0px 5%;
+}
+table#myTable thead{
+ border-bottom: 2px inset black;
+ color:white;
+ background-color:#A4A4A2;
+}
+table#myTable td, table#myTable th{
+ padding:10px;
+}
+table#myTable td{
+ border-bottom: 1px outset gray;
+}
footer{
background: #e6e6e6;
position:relative;
View
2  py3k/templates/layout.html
@@ -37,7 +37,7 @@
<p>Find out all the third party libraries supported by Python 3! You can also submit feedback about its compatibility with Python 3.</p>
</section> <br style="clear: both;">
<form action="{{ url_for('packages') }}" method="post">
- <input id="search" type="search" name='pkgname' placeholder="Search Distros" autofocus required>
+ <input id="search" type="search" name='pkgname' placeholder="Search Distros" autofocus required {% if searchname %} value={{ searchname }} {% endif %}>
<input value="Search" type="submit">
<a href="{{ url_for('packages') }}">Browse All</a>
</form>
View
6 py3k/templates/search_package.html
@@ -23,8 +23,8 @@
<table id="myTable">
<thead>
<tr>
- <th>Distribution</th>
- <th>Description</th>
+ <th scope="col">Distribution</th>
+ <th scope="col">Description</th>
</tr>
</thead>
<tbody>
@@ -37,6 +37,8 @@
<tbody>
</table>
+ {{ render_pagination(page_obj, end_point) }}
+
{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.