Burathar
4 years ago
10 changed files with 108 additions and 7 deletions
@ -1,3 +1,4 @@ |
|||||||
from .project import Project |
from .project import Project |
||||||
from .user import User |
from .user import User |
||||||
from .yaml_serializable import YamlSerializable |
from .yaml_serializable import YamlSerializable |
||||||
|
from .utils import * |
||||||
|
@ -0,0 +1,6 @@ |
|||||||
|
def to_bool(value): |
||||||
|
if isinstance(value, bool): |
||||||
|
return value |
||||||
|
if isinstance(value, int): |
||||||
|
return value >= 1 |
||||||
|
return value.lower() in ['true', '1', 't', 'y', 'yes'] |
@ -0,0 +1,15 @@ |
|||||||
|
{% extends "base.html" %} |
||||||
|
{% import 'bootstrap/wtf.html' as wtf %} |
||||||
|
|
||||||
|
{% block app_content %} |
||||||
|
|
||||||
|
<div class="row"> |
||||||
|
<div class="col-xs-0 col-md-1"></div> |
||||||
|
<div class="col-xs-8 col-md-4"> |
||||||
|
<h1>Add Project</h1> |
||||||
|
<br> |
||||||
|
{{ wtf.quick_form(form, button_map={'submit': 'primary'}) }} |
||||||
|
</div> |
||||||
|
<div class="col-xs-0 col-md-7"></div> |
||||||
|
</div> |
||||||
|
{% endblock %} |
@ -0,0 +1,27 @@ |
|||||||
|
{% extends "base.html" %} |
||||||
|
|
||||||
|
{% block app_content %} |
||||||
|
<div class="col-lg-12"> |
||||||
|
<h2 id="typography">Public Projects</h2> |
||||||
|
</div> |
||||||
|
<div class="table-responsive"> |
||||||
|
<table class="table table-hover"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th scope="col">Name</th> |
||||||
|
<th scope="col">Access</th> |
||||||
|
<th scope="col">State</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
{% for project in projects %} |
||||||
|
<tr> |
||||||
|
<td><a href="{{ url_for('project_dashboard', project_name = project.name) }}">{{ project.name }}</a></td> |
||||||
|
<td>{{ project.user_access(current_user) or 'None' }}</td> |
||||||
|
<td>{{ project.state or '-' }}</td> |
||||||
|
</tr> |
||||||
|
{% endfor %} |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
{% endblock %} |
Loading…
Reference in new issue