mirror of https://github.com/doccano/doccano.git
Hironsan
6 years ago
7 changed files with 107 additions and 12 deletions
Split View
Diff Options
-
BINdoccano/app/db.sqlite3
-
3doccano/app/server/admin.py
-
16doccano/app/server/models.py
-
74doccano/app/server/templates/project_list.html
-
9doccano/app/server/tests.py
-
3doccano/app/server/urls.py
-
14doccano/app/server/views.py
@ -1,7 +1,8 @@ |
|||
from django.contrib import admin |
|||
|
|||
from .models import Annotation, Label, RawData |
|||
from .models import Annotation, Label, RawData, Project |
|||
|
|||
admin.site.register(Annotation) |
|||
admin.site.register(Label) |
|||
admin.site.register(RawData) |
|||
admin.site.register(Project) |
@ -0,0 +1,74 @@ |
|||
{% extends "base.html" %} |
|||
{% load static %} |
|||
{% block content %} |
|||
<section class="container" id="root"> |
|||
<div class="columns"> |
|||
|
|||
<div class="column is-9"> |
|||
<div class="box content"> |
|||
{% for project in object_list %} |
|||
<article class="post"> |
|||
<h4>{{ project.name }}</h4> |
|||
<div class="media"> |
|||
<div class="media-left"> |
|||
<p class="image is-32x32"> |
|||
<img src="http://bulma.io/images/placeholders/128x128.png"> |
|||
</p> |
|||
</div> |
|||
<div class="media-content"> |
|||
<div class="content"> |
|||
<p>{{ project.description|truncatechars:200 }}</p> |
|||
<p> |
|||
<a href="#">@jsmith</a> created at {{ project.created_at|date }} |
|||
<span class="tag">Question</span> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
<div class="media-right"> |
|||
<span class="has-text-grey-light"> |
|||
<i class="fa fa-comments"></i> 1</span> |
|||
</div> |
|||
</div> |
|||
</article> |
|||
{% empty %} |
|||
No projects yet. |
|||
{% endfor %} |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="column is-3"> |
|||
<a class="button is-primary is-block is-alt is-large" href="#">New Project</a> |
|||
<aside class="menu"> |
|||
<p class="menu-label"> |
|||
Tags |
|||
</p> |
|||
<ul class="menu-list"> |
|||
<li> |
|||
<span class="tag is-primary is-medium ">Dashboard</span> |
|||
</li> |
|||
<li> |
|||
<span class="tag is-link is-medium ">Customers</span> |
|||
</li> |
|||
<li> |
|||
<span class="tag is-light is-danger is-medium ">Authentication</span> |
|||
</li> |
|||
<li> |
|||
<span class="tag is-dark is-medium ">Payments</span> |
|||
</li> |
|||
<li> |
|||
<span class="tag is-success is-medium ">Transfers</span> |
|||
</li> |
|||
<li> |
|||
<span class="tag is-warning is-medium ">Balance</span> |
|||
</li> |
|||
<li> |
|||
<span class="tag is-medium ">Question</span> |
|||
</li> |
|||
</ul> |
|||
</aside> |
|||
</div> |
|||
|
|||
</div> |
|||
</section> |
|||
{% endblock %} |
@ -1,3 +1,10 @@ |
|||
from django.test import TestCase |
|||
|
|||
# Create your tests here. |
|||
from .models import Project |
|||
|
|||
|
|||
class ProjectModelTest(TestCase): |
|||
|
|||
def test_string_representation(self): |
|||
project = Project(name='my project', description='my description') |
|||
self.assertEqual(str(project), project.name) |
Write
Preview
Loading…
Cancel
Save