From be8bd24a8a24e75ac00a362c022836378d9b3c38 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 28 Apr 2025 11:22:45 -0500 Subject: Provide UI for publication creation. --- uploader/publications/views.py | 11 +- .../templates/publications/create-publication.html | 169 +++++++++++++++++++++ uploader/templates/publications/index.html | 6 + 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 uploader/templates/publications/create-publication.html diff --git a/uploader/publications/views.py b/uploader/publications/views.py index dc5b42b..ca4bfcb 100644 --- a/uploader/publications/views.py +++ b/uploader/publications/views.py @@ -2,7 +2,7 @@ import json from gn_libs.mysqldb import database_connection -from flask import Blueprint, render_template, current_app as app +from flask import request, Blueprint, render_template, current_app as app from uploader.authorisation import require_login @@ -47,3 +47,12 @@ def view_publication(publication_id: int): publication=fetch_publication_by_id(conn, publication_id), linked_phenotypes=tuple(fetch_publication_phenotypes( conn, publication_id))) + + +@pubbp.route("/create", methods=["GET", "POST"]) +@require_login +def create_publication(): + """Create a new publication.""" + if(request.method == "GET"): + return render_template("publications/create-publication.html") + return "Not Implemented" diff --git a/uploader/templates/publications/create-publication.html b/uploader/templates/publications/create-publication.html new file mode 100644 index 0000000..4ddff0a --- /dev/null +++ b/uploader/templates/publications/create-publication.html @@ -0,0 +1,169 @@ +{%extends "publications/base.html"%} +{%from "flash_messages.html" import flash_all_messages%} + +{%block title%}View Publication{%endblock%} + +{%block pagetitle%}View Publication{%endblock%} + + +{%block contents%} +{{flash_all_messages()}} + +
+
+ +
+ +
+
+ +
+ +
+
+ This is the publication's ID on + NCBI's Pubmed Service + +
+
+ +
+ +
+ + Provide the publication's title here. +
+
+ +
+ +
+ + + A publication MUST have an author. You must + provide a value for the authors field. + +
+
+ +
+ +
+ + Provide the name journal where the + publication was done, here. +
+
+ +
+ +
+ + Month of publication +
+ + +
+ + Year of publication +
+
+ +
+ +
+ + Journal volume +
+ + +
+ + Journal pages for the publication +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +{%endblock%} + + +{%block javascript%} + +{%endblock%} diff --git a/uploader/templates/publications/index.html b/uploader/templates/publications/index.html index 9a30c59..f846d54 100644 --- a/uploader/templates/publications/index.html +++ b/uploader/templates/publications/index.html @@ -9,6 +9,12 @@ {%block contents%} {{flash_all_messages()}} +
+ + add new publication +
+
-- cgit v1.2.3