diff options
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 316f25c..9aaef17 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1845,6 +1845,32 @@ def action_repo_delete(): return render_template('actions/delete_repo.html', form=form, repos_resp=responses) + +@app.route('/action/repo/info', methods=['GET']) +@login_required +def action_repo_info(): + form = RepoForm() + params = request.args.to_dict() + repos = parse_elements(params) + if not validate_elements(repos, max_len=1): + return redirect(url_for('manage_repos')) + repo_id = repos.pop() + if not repo_id: + flash(_('Please, select a repo'), category='error') + return redirect(url_for('manage_repos')) + repo_id = int(repo_id) + server_ip_port = params.get('repos-server') + server = get_server_from_ip_port(server_ip_port) + repository = get_repository(repo_id, server) + form.name.data = repository['name'] + form.name.render_kw = {'readonly': True} + form.ip.data = repository['ip'] + form.ip.render_kw = {'readonly': True} + form.submit.render_kw = {"style": "visibility:hidden;"} + responses = multi_request('get', '/repositories') + return render_template('actions/repo_details.html', form=form, + repos_resp=responses) + @app.route('/servers/', methods=['GET']) @login_required def manage_servers(): |