summaryrefslogtreecommitdiff
path: root/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html')
-rw-r--r--yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html118
1 files changed, 66 insertions, 52 deletions
diff --git a/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html b/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
index 640bc47bc..11ac2a035 100644
--- a/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
@@ -1,9 +1,12 @@
<!DOCTYPE html>
{% load static %}
{% load projecttags %}
+{% load project_url_tag %}
<html lang="en">
<head>
- <title>{% if objectname %} {{objectname|title}} - {% endif %}Toaster</title>
+ <title>
+ {% block title %} Toaster {% endblock %}
+ </title>
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" type="text/css"/>
<link rel="stylesheet" href="{% static 'css/bootstrap-responsive.min.css' %}" type='text/css'/>
<link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}" type='text/css'/>
@@ -35,8 +38,9 @@
projectsTypeAheadUrl: {% url 'xhr_projectstypeahead' as prjurl%}{{prjurl|json}},
{% if project.id %}
projectId : {{project.id}},
- projectPageUrl : {% url 'project' project.id as purl%}{{purl|json}},
+ projectPageUrl : {% url 'project' project.id as purl %}{{purl|json}},
projectName : {{project.name|json}},
+ projectIsDefault: {% if project.is_default %}true{% else %}false{% endif %},
recipesTypeAheadUrl: {% url 'xhr_recipestypeahead' project.id as paturl%}{{paturl|json}},
layersTypeAheadUrl: {% url 'xhr_layerstypeahead' project.id as paturl%}{{paturl|json}},
machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}},
@@ -47,7 +51,7 @@
projectId : undefined,
projectPageUrl : undefined,
projectName : undefined,
- projectId : undefined,
+ projectIsDefault: false,
{% endif %}
};
</script>
@@ -89,9 +93,9 @@
<i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
{% endif %}
</span>
- {% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
+ {% if BUILD_MODE and request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
<ul class="nav">
- <li {% if request.resolver_match.url_name == 'all-builds' %}
+ <li {% if request.resolver_match.url_name == 'all-builds' %}
class="active"
{% endif %}>
<a href="{% url 'all-builds' %}">
@@ -118,55 +122,65 @@
</li>
</ul>
<span class="pull-right divider-vertical"></span>
- <div class="btn-group pull-right">
- <a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
- </div>
- <!-- New build popover -->
- <div class="btn-group pull-right" id="new-build-button" style="display:none">
- <button class="btn dropdown-toggle" data-toggle="dropdown">
- New build
- <i class="icon-caret-down"></i>
- </button>
- <ul class="dropdown-menu new-build multi-select">
- <li>
- <h3>New build</h3>
- <h6>Project:</h6>
- <span id="project">
- {% if project.id %}
- <a class="lead" href="{% url 'project' project.id %}">{{project.name}}</a>
- {% else %}
- <a class="lead" href="#"></a>
- {% endif %}
- <i class="icon-pencil"></i>
- </span>
- <form id="change-project-form" style="display:none;">
- <div class="input-append">
- <input type="text" class="input-medium" id="project-name-input" placeholder="Type a project name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead"/>
- <button id="save-project-button" class="btn" type="button">Save</button>
- <a href="#" id="cancel-change-project" class="btn btn-link" style="display: none">Cancel</a>
- </div>
- <p><a id="view-all-projects" href="{% url 'all-projects' %}">View all projects</a></p>
- </form>
- </li>
- <li>
- <div class="alert" style="display:none;">
- <p>This project configuration is incomplete, so you cannot run builds.</p>
- <p><a href="{% if project.id %}{% url 'project' project.id %}{% endif %}">View project configuration</a></p>
- </div>
- </li>
- <li id="targets-form">
- <h6>Recipe(s):</h6>
- <form>
- <input type="text" class="input-xlarge build-target-input" placeholder="Type a recipe name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" disabled/>
- <div class="row-fluid">
- <button class="btn btn-primary build-button" disabled>Build</button>
- </div>
- </form>
- </li>
- </ul>
- </div>
+ <!-- new project button; only show in build mode -->
+ {% if BUILD_MODE %}
+ <div class="btn-group pull-right">
+ <a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
+ </div>
+ {% endif %}
+ <!--
+ New build popover; only shown if there is at least one user-created project
+ and we're in build mode
+ -->
+ {% if BUILD_MODE and non_cli_projects.count > 0 %}
+ <div class="btn-group pull-right" id="new-build-button" style="display:none">
+ <button class="btn dropdown-toggle" data-toggle="dropdown">
+ New build
+ <i class="icon-caret-down"></i>
+ </button>
+ <ul class="dropdown-menu new-build multi-select">
+ <li>
+ <h3>New build</h3>
+ <h6>
+ Project:
+ <span id="project">
+ {% if project.id and not project.is_default %}
+ <a class="lead" href="{% project_url project %}">{{project.name}}</a>
+ {% else %}
+ <a class="lead" href="#"></a>
+ {% endif %}
+ <i class="icon-pencil"></i>
+ </span>
+ </h6>
+ <form id="change-project-form" style="display:none;">
+ <div class="input-append">
+ <input type="text" class="input-medium" id="project-name-input" placeholder="Type a project name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead"/>
+ <button id="save-project-button" class="btn" type="button">Save</button>
+ <a href="#" id="cancel-change-project" class="btn btn-link" style="display: none">Cancel</a>
+ </div>
+ <p><a id="view-all-projects" href="{% url 'all-projects' %}">View all projects</a></p>
+ </form>
+ </li>
+ <li>
+ <div class="alert" style="display:none;">
+ <p>This project configuration is incomplete, so you cannot run builds.</p>
+ <p><a href="{% if project.id %}{% url 'project' project.id %}{% endif %}">View project configuration</a></p>
+ </div>
+ </li>
+ <li id="targets-form">
+ <h6>Recipe(s):</h6>
+ <form>
+ <input type="text" class="input-xlarge build-target-input" placeholder="Type a recipe name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" disabled/>
+ <div class="row-fluid">
+ <button class="btn btn-primary build-button" disabled>Build</button>
+ </div>
+ </form>
+ </li>
+ </ul>
+ </div>
+ {% endif %}
</div>
</div>
</div>