Skip to content
Snippets Groups Projects
Commit 2846da2d authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#41 - minor fixes

parent e442a4f0
No related branches found
No related tags found
1 merge request!1Fixed #41 - Add option to hide roadmap
......@@ -20,10 +20,10 @@ def construct_blueprint(database):
@jwt_optional
def get_visible_roadmaps():
user = get_jwt_identity()
if user is not None:
return jsonify(database.get_roadmaps())
else:
if user is None:
return jsonify(database.get_visible_roadmaps())
else:
return jsonify(database.get_roadmaps())
@roadmap_api.route('/roadmap/<int:roadmapID>', methods=['GET'])
@jwt_optional
......@@ -32,7 +32,7 @@ def construct_blueprint(database):
user = get_jwt_identity()
if roadmap['Hidden'] and user is None:
return jsonify({'success': False, 'msg': 'A roadmap with this id not exists'}), 404
return jsonify({'success': False, 'msg': 'A roadmap with this id not exist'}), 404
return jsonify(roadmap)
@roadmap_api.route('/roadmap/<int:roadmapID>/full', methods=['GET'])
......@@ -43,7 +43,7 @@ def construct_blueprint(database):
user = get_jwt_identity()
if roadmap['Hidden'] and user is None:
return jsonify({'success': False, 'msg': 'A roadmap with this id not exists'}), 404
return jsonify({'success': False, 'msg': 'A roadmap with this id not exist'}), 404
numberOfOpenMilestones = 0
for milestone in roadmap['milestones']:
......
......@@ -12,9 +12,8 @@ def construct_blueprint(urlBuilder):
@roadmaps.route('/admin/roadmaps/overview', methods=['GET'])
@require_api_token
def overview():
_, roadmaps = ApiRequest.send_api_request(urlBuilder.build_url('roadmaps'), requests.get, {}, [])
print(roadmaps)
return render_template('admin/roadmaps/overview.html', roadmaps=roadmaps)
_, roadmapsData = ApiRequest.send_api_request(urlBuilder.build_url('roadmaps'), requests.get, {}, [])
return render_template('admin/roadmaps/overview.html', roadmaps=roadmapsData)
@roadmaps.route('/admin/roadmaps/add', methods=['GET'])
@require_api_token
......
......@@ -19,6 +19,7 @@
<label for="project-name">Project Name</label>
</div>
</div>
<div class="col s12 m8 offset-m2 l6 offset-l3">
<div class="input-field col s12">
<p>
......@@ -30,6 +31,7 @@
</p>
</div>
</div>
</div>
<div class="row center-align margin-top">
<div class="col s12 m8 offset-m2 l6 offset-l3">
<a class="waves-effect waves-light btn blue darken-3" href="{{ url_for("admin_roadmaps.overview") }}"><i class="material-icons left">arrow_back</i>Back</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment