diff options
-rw-r--r-- | static/testreporter/main.js | 3 | ||||
-rw-r--r-- | static/testreporter/public.js | 14 | ||||
-rw-r--r-- | static/testreporter/templates/report.html | 24 | ||||
-rw-r--r-- | static/testreporter/templates/report_private.html | 24 | ||||
-rw-r--r-- | static/testreporter/templates/report_public.html | 15 | ||||
-rw-r--r-- | templates/testreporter/private.html | 11 | ||||
-rw-r--r-- | templates/testreporter/public.html | 11 | ||||
-rw-r--r-- | testmanager/testreporter/urls.py | 2 | ||||
-rw-r--r-- | testmanager/testreporter/views.py | 6 |
9 files changed, 83 insertions, 27 deletions
diff --git a/static/testreporter/main.js b/static/testreporter/main.js index bac5b41..5432e17 100644 --- a/static/testreporter/main.js +++ b/static/testreporter/main.js @@ -9,10 +9,9 @@ APP.config(['$routeProvider', function($routeProvider) { controller: 'New' }) .when('/:id', { - templateUrl: '/static/testreporter/templates/report.html', + templateUrl: '/static/testreporter/templates/report_private.html', controller: 'Report' }); - }]); diff --git a/static/testreporter/public.js b/static/testreporter/public.js new file mode 100644 index 0000000..a59ffb4 --- /dev/null +++ b/static/testreporter/public.js @@ -0,0 +1,14 @@ +APP.config(['$routeProvider', function($routeProvider) { + $routeProvider + .when('/:id', { + templateUrl: '/static/testreporter/templates/report_public.html', + controller: 'Report' + }); + }]); + +function Report($scope, $window, $routeParams, $http, Tag) { + $scope.tag = Tag.get({id:$routeParams.id}) + $http.get('/testreporter/report/'+ $routeParams.id +'/').success(function(data) { + $scope.data = data; + }); +} diff --git a/static/testreporter/templates/report.html b/static/testreporter/templates/report.html index ad8d9c8..46206c1 100644 --- a/static/testreporter/templates/report.html +++ b/static/testreporter/templates/report.html @@ -1,29 +1,6 @@ <div class="row"> <div class="col-lg-12"> - <div class="page-header"> - <h1>Report: <small>"//data.tag.name//"</small></h1> - </div> - - <form role="form" ng-submit="submit()" > - - <div class="form-group" ng-class="{'has-error':error.description}"> - <label>Description:</label> - <span class="help-inline" ng-bind="error.description"></span> - <textarea class="form-control" ng-model="tag.description" rows="3"></textarea> - </div> - - <button type="submit" class="btn btn-default btn-sm input-sm pull-right"> - Save - </button> - </form> - - </div> -</div> - -<div class="row"> - <div class="col-lg-12"> - <h2>Builds</h2> <table class="table"> @@ -94,4 +71,3 @@ </div> </div> - diff --git a/static/testreporter/templates/report_private.html b/static/testreporter/templates/report_private.html new file mode 100644 index 0000000..5db2cd9 --- /dev/null +++ b/static/testreporter/templates/report_private.html @@ -0,0 +1,24 @@ +<div class="row"> + <div class="col-lg-12"> + + <div class="page-header"> + <h1>Report: <small>"//data.tag.name//"</small></h1> + </div> + + <form role="form" ng-submit="submit()" > + + <div class="form-group" ng-class="{'has-error':error.description}"> + <label>Description:</label> + <span class="help-inline" ng-bind="error.description"></span> + <textarea class="form-control" ng-model="tag.description" rows="3"></textarea> + </div> + + <button type="submit" class="btn btn-default btn-sm input-sm pull-right"> + Save + </button> + </form> + + </div> +</div> + +<div ng-include="'/static/testreporter/templates/report.html'"></div> diff --git a/static/testreporter/templates/report_public.html b/static/testreporter/templates/report_public.html new file mode 100644 index 0000000..b9c3be8 --- /dev/null +++ b/static/testreporter/templates/report_public.html @@ -0,0 +1,15 @@ +<div class="row"> + <div class="col-lg-12"> + + <div class="page-header"> + <h1>Report: <small>"//data.tag.name//"</small></h1> + </div> + + <p class="lead"> + //data.tag.description// + </p> + + </div> +</div> + +<div ng-include="'/static/testreporter/templates/report.html'"></div> diff --git a/templates/testreporter/private.html b/templates/testreporter/private.html new file mode 100644 index 0000000..70bed90 --- /dev/null +++ b/templates/testreporter/private.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} + +{% block js_include %} + {{ block.super }} + + <script type="text/javascript" src="{{ STATIC_URL }}testreporter/main.js"></script> +{% endblock %} + +{% block maincontent %} + <div id="testreporter" ng-view></div> +{% endblock %} diff --git a/templates/testreporter/public.html b/templates/testreporter/public.html new file mode 100644 index 0000000..d19087e --- /dev/null +++ b/templates/testreporter/public.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} + +{% block js_include %} + {{ block.super }} + + <script type="text/javascript" src="{{ STATIC_URL }}testreporter/public.js"></script> +{% endblock %} + +{% block maincontent %} + <div id="testreporter" ng-view></div> +{% endblock %} diff --git a/testmanager/testreporter/urls.py b/testmanager/testreporter/urls.py index 81b6326..8a724d0 100644 --- a/testmanager/testreporter/urls.py +++ b/testmanager/testreporter/urls.py @@ -5,5 +5,7 @@ from testmanager.testreporter import views urlpatterns = [ url(r'^$', views.Base.as_view()), + url(r'^public/$', views.Public.as_view()), + url(r'^report/(?P<tag_id>[0-9]+)/$', views.Report_View.as_view()), ] diff --git a/testmanager/testreporter/views.py b/testmanager/testreporter/views.py index 91b6f0f..91f2639 100644 --- a/testmanager/testreporter/views.py +++ b/testmanager/testreporter/views.py @@ -31,8 +31,11 @@ from testmanager.testmanualrunner.serializers import TestRunSerializer class Base(LoginRequiredMixin, TemplateView): template_name='testreporter/base.html' +class Public(TemplateView): + template_name='testreporter/public.html' -class Report_View(LoginRequiredMixin, APIView): + +class Report_View(APIView): def get(self, request, tag_id, format=None): @@ -47,3 +50,4 @@ class Report_View(LoginRequiredMixin, APIView): "lava_jobs": LavaJobSerializer(lava_jobs).data, "testruns": TestRunSerializer(testruns).data, }) + |