diff --git a/doccano/app/server/templates/project_detail.html b/doccano/app/server/templates/project_detail.html new file mode 100644 index 00000000..0cd55011 --- /dev/null +++ b/doccano/app/server/templates/project_detail.html @@ -0,0 +1,70 @@ +{% extends "base.html" %} +{% load static %} +{% block content %} +
+
+ +
+
+
+

{{ object.name }}

+
+
+

+ +

+
+
+
+

{{ object.description|truncatechars:200 }}

+

+ @jsmith created at {{ object.created_at|date }}   + Question +

+
+
+
+ + 1 +
+
+
+
+
+ + +
+ New Project + +
+ +
+
+{% endblock %} \ No newline at end of file diff --git a/doccano/app/server/urls.py b/doccano/app/server/urls.py index 11aa055c..ac1e7a27 100644 --- a/doccano/app/server/urls.py +++ b/doccano/app/server/urls.py @@ -1,9 +1,11 @@ from django.urls import path -from .views import AnnotationView, AnnotationAPIView, MetaInfoAPI, SearchAPI, ProjectListView +from .views import AnnotationView, AnnotationAPIView, MetaInfoAPI, SearchAPI +from .views import ProjectListView, ProjectDetailView urlpatterns = [ path('', ProjectListView.as_view(), name='project-list'), + path('/', ProjectDetailView.as_view(), name='project-detail'), path('/docs', AnnotationView.as_view()), path('/apis/data', AnnotationAPIView.as_view()), path('/apis/label', MetaInfoAPI.as_view()), diff --git a/doccano/app/server/views.py b/doccano/app/server/views.py index 7fd5538b..870521b6 100644 --- a/doccano/app/server/views.py +++ b/doccano/app/server/views.py @@ -4,6 +4,7 @@ from django.http import JsonResponse from django.shortcuts import render from django.views import View from django.views.generic.list import ListView +from django.views.generic.detail import DetailView from .models import Annotation, Label, RawData, Project @@ -84,3 +85,13 @@ class ProjectListView(ListView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) return context + + +class ProjectDetailView(DetailView): + + model = Project + template_name = 'project_detail.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + return context