bitbake: toaster: fixing undefined variables

This patchset fixes usage of undefined variables in
the base page.

(Bitbake rev: a9e889af41e1e59c3b426c78ba80e4d49c6c122b)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2015-06-11 13:14:39 +01:00
committed by Richard Purdie
parent 933e4dbb50
commit b98a2fcab6
3 changed files with 16 additions and 8 deletions

View File

@@ -29,17 +29,18 @@
{% endif %}
<script>
libtoaster.ctx = {
projectId : {{project.id|default:'undefined'}},
jsUrl : "{% static 'js/' %}",
htmlUrl : "{% static 'html/' %}",
projectsUrl : "{% url 'all-projects' %}",
{% if project.id %}
projectId : {{project.id}},
projectPageUrl : {% url 'project' project.id as purl%}{{purl|json}},
projectName : {{project.name|json}},
projectTargetsUrl: {% url 'projectavailabletargets' project.id as paturl%}{{paturl|json}},
projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}},
projectId : {{project.id}},
{% else %}
projectId : undefined,
projectPageUrl : undefined,
projectName : undefined,
projectId : undefined,
@@ -101,8 +102,10 @@
<h3>New build</h3>
<h6>Project:</h6>
<span id="project">
<a class="lead" href="{% if project.id %}{% url 'project' project.id %}{% endif %}">{{project.name}}</a>
<i class="icon-pencil"></i>
{% if project.id %}
<a class="lead" href="{% url 'project' project.id %}">{{project.name}}</a>
<i class="icon-pencil"></i>
{% endif %}
</span>
<form id="change-project-form" style="display:none;">
<div class="input-append">
@@ -122,7 +125,7 @@
<form>
<input type="text" class="input-xlarge" id="build-target-input" placeholder="Type a recipe name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" disabled/>
<div>
<button class="btn btn-primary" id="build-button" data-project-id="{{project.id}}" disabled>Build</button>
<button class="btn btn-primary" id="build-button" disabled>Build</button>
</div>
</form>
</li>

View File

@@ -162,7 +162,7 @@
<div class="navbar">
<div class="navbar-inner">
<form class="navbar-search input-append pull-left" id="searchform">
<input class="input-xxlarge" id="search" name="search" type="text" placeholder="Search {%if object_search_display %}{{object_search_display}}{%else%}{{objectname}}{%endif%}" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{%endif%}
<input class="input-xxlarge" id="search" name="search" type="text" placeholder="Search {%if object_search_display %}{{object_search_display}}{%else%}{{objectname}}{%endif%}" value="{%if request.GET.search %}{{request.GET.search}}{% endif %}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{%endif%}
<input type="hidden" name="orderby" value="{{request.GET.orderby}}">
<input type="hidden" name="page" value="1">
<button class="btn" type="submit" value="Search">Search</button>
@@ -191,7 +191,12 @@
onclick="showhideTableColumn(
$(this).attr('id'),
$(this).is(':checked'),
'{{i.orderkey}}' )"
{% if i.ordericon %}
'{{i.orderkey}}'
{% else %}
undefined
{% endif %}
)"
{%else%}
checked disabled
{% endif %}/> {{i.name}}
@@ -221,7 +226,7 @@
<thead>
<!-- Table header row; generated from "tablecols" entry in the context dict -->
<tr>
{% for tc in tablecols %}<th class="{{tc.dclass}} {{tc.clclass}}">
{% for tc in tablecols %}<th class="{%if tc.dclass%}{{tc.dclass}}{%endif%} {% if tc.clclass %}{{tc.clclass}}{% endif %}">
{%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%}
{%if tc.orderfield%}<a {%if tc.ordericon%} class="sorted" {%endif%}href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })">{{tc.name}}</a>{%else%}<span class="muted">{{tc.name}}</span>{%endif%}
{%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%}

View File

@@ -2,7 +2,7 @@
<!-- '{{f.class}}' filter -->
{% with f.class as key %}
<form id="filter_{{f.class}}" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<input type="hidden" name="search" value="{{request.GET.search}}"/>
<input type="hidden" name="search" value="{%if request.GET.search %}{{request.GET.search}}{%endif%}"/>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
{% if search_term %}