From 2846da2d0cb7c8954fe1145c076cb3e12386f13a Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Thu, 12 Nov 2020 21:15:41 +0100 Subject: [PATCH] #41 - minor fixes --- api/blueprints/RoadmapAPI.py | 10 +++++----- client/blueprints/Roadmaps.py | 5 ++--- client/templates/admin/roadmaps/edit.html | 20 +++++++++++--------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/api/blueprints/RoadmapAPI.py b/api/blueprints/RoadmapAPI.py index 36fc8db..e6ab3f1 100644 --- a/api/blueprints/RoadmapAPI.py +++ b/api/blueprints/RoadmapAPI.py @@ -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']: diff --git a/client/blueprints/Roadmaps.py b/client/blueprints/Roadmaps.py index e311cd7..9887439 100644 --- a/client/blueprints/Roadmaps.py +++ b/client/blueprints/Roadmaps.py @@ -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 diff --git a/client/templates/admin/roadmaps/edit.html b/client/templates/admin/roadmaps/edit.html index de6e8ee..1af9e28 100644 --- a/client/templates/admin/roadmaps/edit.html +++ b/client/templates/admin/roadmaps/edit.html @@ -19,15 +19,17 @@ <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> - <label> - <input id="Hidden" name="Hidden" type="checkbox" - {% if roadmap and roadmap["Hidden"] %} checked="checked" {% endif %}/> - <span>Hidden</span> - </label> - </p> + + <div class="col s12 m8 offset-m2 l6 offset-l3"> + <div class="input-field col s12"> + <p> + <label> + <input id="Hidden" name="Hidden" type="checkbox" + {% if roadmap and roadmap["Hidden"] %} checked="checked" {% endif %}/> + <span>Hidden</span> + </label> + </p> + </div> </div> </div> <div class="row center-align margin-top"> -- GitLab