error-report-web
cover error-report-web
The following changes since commit 4be8e30cecedd36819b0cf14db16b5b8cb275b31:
README: add info on the git repo and contributing (2014-08-24 16:39:11 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib roxana/YB6537
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=roxana/YB6537
Roxana Ciobanu (1):
error-report-tool: apply changes to the landing page
Post/static/css/custom.css | 9 +- Post/views.py | 15 +- project/urls.py | 4 +- templates/base.html | 6 +- templates/error-page.html | 27 ++- templates/home.html | 442 ++++++++++++++++++++++-------------------- templates/latest-errors.html | 239 +++++++++++++++++++++++ templates/search-details.html | 2 +- 8 files changed, 527 insertions(+), 217 deletions(-) create mode 100644 templates/latest-errors.html
Signature · 1 line
1.9.1
PATCH 1/1 error-report-tool: apply changes to the landing page
* Reduce the time range from the last month to the last week
* Provide a list of the latest errors
* Provide a link to the list of errors generated by the autobuilder
[YOCTO #YB6537]
Signed-off-by Roxana Ciobanu <[email protected]>
--- Post/static/css/custom.css | 9 +- Post/views.py | 15 +- project/urls.py | 4 +- templates/base.html | 6 +- templates/error-page.html | 27 ++- templates/home.html | 442 ++++++++++++++++++++++-------------------- templates/latest-errors.html | 239 +++++++++++++++++++++++ templates/search-details.html | 2 +- 8 files changed, 527 insertions(+), 217 deletions(-) create mode 100644 templates/latest-errors.html
Post/static/css/custom.css +7 -2
@@ -6,8 +6,9 @@ */ body { - padding:50px; + padding: 70px 40px; } + .logo img { height: 25px; width: auto !important;
@@ -56,7 +57,11 @@ td a:visited { margin: 10px 0 0; } -.navbar-inner form { +.navbar-inner .navbar-search { + margin-top: 7px; +} + +.navbar-inner form, .pagination form { margin: 5px 0 0; }
Post/views.py +14 -1
@@ -58,13 +58,26 @@ def search(request, template_name, items = None, page = None, query = None): page = request.GET.get('page', '') query = request.GET.get('query', '') items = request.GET.get('items', '') + + latest = False + + if "latest" in query: + latest = True + query = query.replace("_latest", "") + if query == "" or query.isspace(): query = "all" elems = Info().getSearchResult(query.strip()) elems.sort(key=lambda r : r.BUILD.DATE, reverse=True) no = len(elems) if no == 0: - return render_to_response("error-page.html", {"query" : query}, RequestContext(request)) + return render_to_response("error-page.html", {"latest" : latest, "query" : query}, RequestContext(request)) + + if latest is True: + if no > 150: + elems = elems[:150] + no = 150 + paginator = Paginator(elems, items) try: c = paginator.page(page)
project/urls.py +3 -1
@@ -18,6 +18,7 @@ urlpatterns = patterns('', # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), #url(r'^accounts/', include('registration.backends.default.urls')), + url(r'^Errors/Search/Latest/$', 'Post.views.search', {'template_name' : 'latest-errors.html'}, name= "latest_errors"), url(r'^Errors/Search/Args/$', 'Post.views.search', {'template_name' : 'search-details.html'}, name = "entry_args"), url(r'^Errors/Search/(?P<items>\d+)/(?P<page>\d+)/(?P<query>\w+)/', 'Post.views.search', {'template_name' : 'search-details.html'}, name = "entry"), url(r'^Errors/Search/(?P<page>\d+)/(?P<query>\d+)/', 'Post.views.viewEntry', {'template_name' : 'search-details.html'}),
@@ -27,5 +28,6 @@ urlpatterns = patterns('', url(r'^Errors/ErrorPage/$', direct_to_template, {'template':"error-page.html"}, name = "errorpage"), url(r'^ClientPost/', 'Post.views.addData'), url(r'^Errors/', direct_to_template, {'template':"home.html"}, name = "main"), - url(r'.*', redirect_to, {'url' : '/Errors/'}, name = "home"), + url(r'.*', redirect_to, {'url' : '/Errors/Search/Latest/?items=25&page=1&query=all_latest'}), + )
templates/base.html +3 -3
@@ -21,8 +21,8 @@ <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand logo" href="{% url main %}"><img src="{% static "img/logo.png" %}" /></a> - <a class="brand" href={% url main%}>Error reports</a> + <a class="brand logo" href="{% url latest_errors %}?items=25&page=1&query=all_latest"><img src="{% static "img/logo.png" %}" /></a> + <a class="brand" href="{% url latest_errors %}?items=25&page=1&query=all_latest">Error reports</a> {% comment %} {% if user.is_authenticated %} <div class="dropdown pull-right">
@@ -55,7 +55,7 @@ </div> </div> </div> - + <script type = "text/javascript" src = "{% static "js/jquery.js" %}"></script> <script type = "text/javascript" src = "{% static "js/bootstrap.min.js" %}"></script> <script type = "text/javascript" src = "{% static "js/d3.v2.js" %}"></script>
templates/error-page.html +25 -2
@@ -6,10 +6,31 @@ <body> {% block content %} <div class="row-fluid"> + {% if latest %} + <ul class="nav nav-pills"> + <li> <a href="{% url latest_errors %}?items=25&page=1&query=all_latest" >Latest errors</a> </li> + <li class="active"> <a href="{% url latest_errors %}?items=25&page=1&query=autobuilder_latest" >Latest Autobuilder errors</a></li> + <li> <a href="{% url main %}" >Statistics </a> </li> + </ul> + <div class="alert"> + {% ifequal query "autobuilder" %} + <h3>No Autobuilder errors found</h3> + {% else %} + <h3>No errors found</h3> + {% endifequal%} + <form class="no-results" action="{% url entry_args %}" method="GET"> + <div class="input-append"> + <input class="input-xxlarge" type="text" name="query" value="{{ query }}"> + <input type="text" name="items" value=10 style="display: none;"> + <input type="text" name="page" value=1 style="display: none;"> + <button class="btn" type="submit" value = "Search">Search</button> + </div> + </form> + </div> + {% else %} <div class="page-header"> <h1>No errors found</h1> </div> - <div class="alert"> <form class="no-results" action="{% url entry_args %}" method="GET"> <div class="input-append">
@@ -17,10 +38,12 @@ <input type="text" name="items" value=10 style="display: none;"> <input type="text" name="page" value=1 style="display: none;"> <button class="btn" type="submit" value = "Search">Search</button> - <a class="btn btn-link" href="/">Go to error dashboard</a> + <a class="btn btn-link" href="/">View latest errors</a> </div> </form> </div> + {% endif %} + </div> {% endblock %} </body> </html>
templates/home.html +235 -207
452 lines not on this page · raw message
templates/latest-errors.html new file +239 -0
239 lines not on this page · raw message
templates/search-details.html +1 -1
@@ -37,7 +37,7 @@ <form class="form-inline pull-right"> {% if no > 10 %} <label>Show rows:</label> - <select class="paginationLimit input-mini" onchange="javascript:window.open('{% url entry_args %}?items='+this.value+'&page={{ details.number }}&query={{ d }}', '_self')"> + <select class="paginationLimit input-mini" style="margin-top:5px;margin-bottom:0px;width:60px;" onchange="javascript:window.open('{% url entry_args %}?items='+this.value+'&page={{ details.number }}&query={{ d }}', '_self')"> {% ifequal items "10" %} <option selected="selected" value = "10">10</option> <option value = "25">25</option>
Signature · 1 line
1.9.1