From 3b2f09a37c761063412b9a32bf3d7b836cb325a8 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 18 Jan 2021 10:54:50 +0100 Subject: [PATCH 1/3] static page for stamps --- .../documents/templates/documents/stamp.html | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ereuse_devicehub/resources/documents/templates/documents/stamp.html diff --git a/ereuse_devicehub/resources/documents/templates/documents/stamp.html b/ereuse_devicehub/resources/documents/templates/documents/stamp.html new file mode 100644 index 00000000..61c72172 --- /dev/null +++ b/ereuse_devicehub/resources/documents/templates/documents/stamp.html @@ -0,0 +1,50 @@ + + + + + + + + Devicehub | Tower hp compaq 8100 elite sff + + + + +
+ +
+ + From 1ec1eb39bfc9984883e1bdab723bae7424bb82f7 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 18 Jan 2021 12:40:31 +0100 Subject: [PATCH 2/3] fixing test base --- ereuse_devicehub/resources/documents/documents.py | 12 ++++++++++++ tests/test_basic.py | 1 + 2 files changed, 13 insertions(+) diff --git a/ereuse_devicehub/resources/documents/documents.py b/ereuse_devicehub/resources/documents/documents.py index f1da06a6..14588b2b 100644 --- a/ereuse_devicehub/resources/documents/documents.py +++ b/ereuse_devicehub/resources/documents/documents.py @@ -231,6 +231,15 @@ class CheckView(View): return jsonify(result) +class StampsView(View): + """ + This view render one public ans static page for see the links for to do the check + of one csv file + """ + def get(self): + return flask.render_template('documents/stamp.html') + + class DocumentDef(Resource): __type__ = 'Document' SCHEMA = None @@ -283,6 +292,9 @@ class DocumentDef(Resource): check_view = CheckView.as_view('CheckView', definition=self, auth=app.auth) self.add_url_rule('/check/', defaults={}, view_func=check_view, methods=get) + stamps_view = StampsView.as_view('StampsView', definition=self, auth=app.auth) + self.add_url_rule('/stamps/', defaults={}, view_func=stamps_view, methods=get) + actions_view = ActionsDocumentView.as_view('ActionsDocumentView', definition=self, auth=app.auth) diff --git a/tests/test_basic.py b/tests/test_basic.py index 31208608..53cda3c4 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -55,6 +55,7 @@ def test_api_docs(client: Client): '/documents/static/{filename}', '/documents/stock/', '/documents/check/', + '/documents/stamps/', '/drills/{dev1_id}/merge/{dev2_id}', '/graphic-cards/{dev1_id}/merge/{dev2_id}', '/hard-drives/{dev1_id}/merge/{dev2_id}', From 0273021d50139304993e9f1a0cbdebcc300326df Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 18 Jan 2021 12:48:54 +0100 Subject: [PATCH 3/3] fixing title page --- .../resources/documents/templates/documents/stamp.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/documents/templates/documents/stamp.html b/ereuse_devicehub/resources/documents/templates/documents/stamp.html index 61c72172..7ccec63a 100644 --- a/ereuse_devicehub/resources/documents/templates/documents/stamp.html +++ b/ereuse_devicehub/resources/documents/templates/documents/stamp.html @@ -8,7 +8,7 @@ integrity="sha384-+ENW/yibaokMnme+vBLnHMphUYxHs34h9lpdbSLuAwGkOKFRl4C34WkjazBtb7eT" crossorigin="anonymous"> - Devicehub | Tower hp compaq 8100 elite sff + Devicehub | Stamp create and Stamp verify