From 80970c9270c3ddb63b491ce85e7673d34939247b Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Fri, 22 Jul 2016 12:09:14 +0200 Subject: [PATCH] MT#7247 add uuid panel Change-Id: I5b0f76cabf249540badf33b202571f90f81e9253 --- panel/static/panel/js/panel.js | 11 +++++++- panel/templates/panel/project.html | 8 +++--- panel/templates/panel/project_uuid.html | 37 +++++++++++++++++++++++++ panel/templates/panel/release.html | 1 + panel/urls.py | 2 ++ panel/views.py | 18 +++++++++++- repoapi/models/jbi.py | 24 +++++++++++++--- 7 files changed, 91 insertions(+), 10 deletions(-) create mode 100644 panel/templates/panel/project_uuid.html diff --git a/panel/static/panel/js/panel.js b/panel/static/panel/js/panel.js index a6bdbde..9b4143d 100644 --- a/panel/static/panel/js/panel.js +++ b/panel/static/panel/js/panel.js @@ -219,6 +219,7 @@ function create_new_job_div(project, uuid, job) { function create_new_uuid_panel(project, uuid) { var id = project + '-' + uuid; var div_uuid = $('#' + project +' > .panel-body .uuid-clone').clone(); + var uuid_url; div_uuid.removeClass('hidden'); div_uuid.attr('id', id).removeClass('uuid-clone').addClass('uuid'); @@ -228,7 +229,15 @@ function create_new_uuid_panel(project, uuid) { var div_title = $('.panel-heading > .panel-title', div_uuid); var div_uuid_name = $('.uuid-name', div_title).attr('id', id + '-name').removeClass('uuid-name'); - div_uuid_name.attr('name', id).html(uuid); + if ($.panel == 'project_uuid') { + uuid_url = '#'; + } else if ($.panel == 'release') { + uuid_url = project + '/' + uuid; + } else { + uuid_url = uuid; + } + div_uuid_name.attr('name', id).html( + '' + uuid + ''); var div_uuid_date = $('.uuid-date', div_title).attr('id', id + '-date').removeClass('uuid-date'); div_uuid_date.html('date'); var div_uuid_badge = $('.uuid-badge', div_title).attr('id', id + '-badge').removeClass('uuid-badge'); diff --git a/panel/templates/panel/project.html b/panel/templates/panel/project.html index aaf15ef..7770be4 100644 --- a/panel/templates/panel/project.html +++ b/panel/templates/panel/project.html @@ -18,16 +18,16 @@ {% endblock %} diff --git a/panel/templates/panel/project_uuid.html b/panel/templates/panel/project_uuid.html new file mode 100644 index 0000000..5f1f8b0 --- /dev/null +++ b/panel/templates/panel/project_uuid.html @@ -0,0 +1,37 @@ +{% extends "panel/base.html" %} +{% load jsonify %} +{% block title %}{{ project }}{% endblock %} +{% block navlist %} + +
  • {{ release }}
  • +
  • {{ project }}
  • +
  • {{ uuid }}
  • +{% endblock %} +{% block content %} +
    + +
    +
    +{% endblock %} + +{% block extrajs %} + +{% endblock %} diff --git a/panel/templates/panel/release.html b/panel/templates/panel/release.html index 908d3c9..0f3e205 100644 --- a/panel/templates/panel/release.html +++ b/panel/templates/panel/release.html @@ -19,6 +19,7 @@ {% block extrajs %}