Merge pull request #105 from eReuse/#104-page-explaining-stamp

#104 page explaining stamp
This commit is contained in:
cayop 2021-01-18 12:59:01 +01:00 committed by GitHub
commit 55a67cfd2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 0 deletions

View File

@ -231,6 +231,15 @@ class CheckView(View):
return jsonify(result) 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): class DocumentDef(Resource):
__type__ = 'Document' __type__ = 'Document'
SCHEMA = None SCHEMA = None
@ -283,6 +292,9 @@ class DocumentDef(Resource):
check_view = CheckView.as_view('CheckView', definition=self, auth=app.auth) check_view = CheckView.as_view('CheckView', definition=self, auth=app.auth)
self.add_url_rule('/check/', defaults={}, view_func=check_view, methods=get) 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', actions_view = ActionsDocumentView.as_view('ActionsDocumentView',
definition=self, definition=self,
auth=app.auth) auth=app.auth)

View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="https://stackpath.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-+ENW/yibaokMnme+vBLnHMphUYxHs34h9lpdbSLuAwGkOKFRl4C34WkjazBtb7eT"
crossorigin="anonymous">
<script src="https://use.fontawesome.com/7553aecc27.js"></script>
<title>Devicehub | Stamp create and Stamp verify</title>
<style>
/*Sticky footer*/
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px; /* Margin bottom by footer height */
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 6em;
}
</style>
</head>
<body>
<nav class="navbar navbar-default" style="background-color: gainsboro; margin: 0 !important">
<div class="container-fluid">
<a href="https://www.usody.com/" target="_blank">
<h1 align="center">Usody</h1>
</a>
</div>
</nav>
<div class="container-fluid">
<div class="page-header col-md-6 col-md-offset-3">
<div class="row">
<a href="http://dlt.ereuse.org/stamps/create?url=https://api.testing.usody.com/usodybeta/documents/check" target="_blank">Add one new check in your csv</a>
</div>
<div class="row">
<a href="http://dlt.ereuse.org/stamps/check?url=https://api.testing.usody.com/usodybeta/documents/check" target="_blank">Verify a CSV file in here.</a>
</div>
</div>
</div>
</body>
</html>

View File

@ -55,6 +55,7 @@ def test_api_docs(client: Client):
'/documents/static/{filename}', '/documents/static/{filename}',
'/documents/stock/', '/documents/stock/',
'/documents/check/', '/documents/check/',
'/documents/stamps/',
'/drills/{dev1_id}/merge/{dev2_id}', '/drills/{dev1_id}/merge/{dev2_id}',
'/graphic-cards/{dev1_id}/merge/{dev2_id}', '/graphic-cards/{dev1_id}/merge/{dev2_id}',
'/hard-drives/{dev1_id}/merge/{dev2_id}', '/hard-drives/{dev1_id}/merge/{dev2_id}',