aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-03-20 17:09:27 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-08-11 11:28:14 +0100
commit84709dbca6c0da26e61809d7cb8df2300b6ce288 (patch)
tree03f4721fd76f8ef3b7301dc5f2b1635aa3aad262 /templates
parent1a9f73d4a75a6c64fd90d10532b030a880c11353 (diff)
downloadopenembedded-core-contrib-84709dbca6c0da26e61809d7cb8df2300b6ce288.tar.gz
Add recipe bulk change feature
This provides a way to set "meta" fields (SUMMARY, DESCRIPTION, HOMEPAGE, BUGTRACKER, SECTION, and LICENSE) for a number of recipes at once, and then download those changes in the form of one or more patch files which can be submitted for merging into the layer. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html1
-rw-r--r--templates/layerindex/bulkchange.html69
-rw-r--r--templates/layerindex/bulkchangeedit.html54
-rw-r--r--templates/layerindex/bulkchangereview.html47
-rw-r--r--templates/layerindex/bulkchangesearch.html153
-rw-r--r--templates/layerindex/deleteconfirm.html2
6 files changed, 325 insertions, 1 deletions
diff --git a/templates/base.html b/templates/base.html
index f11674e352..f075dee237 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -69,6 +69,7 @@
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
+ <li><a href="{% url bulk_change %}">Bulk Change</a></li>
<li><a href="{% url duplicates %}">Duplicates</a></li>
</ul>
</li>
diff --git a/templates/layerindex/bulkchange.html b/templates/layerindex/bulkchange.html
new file mode 100644
index 0000000000..e7fc270e5c
--- /dev/null
+++ b/templates/layerindex/bulkchange.html
@@ -0,0 +1,69 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% comment %}
+
+ layerindex-web - bulk change page template
+
+ Copyright (C) 2013 Intel Corporation
+ Licensed under the MIT license, see COPYING.MIT for details
+
+{% endcomment %}
+
+<!--
+{% block title_append %} - bulk change{% endblock %}
+-->
+
+{% block content %}
+{% autoescape on %}
+
+<h2>Bulk change</h2>
+
+<p>This tool allows you to update the value of "meta" variables (such as
+DESCRIPTION and LICENSE) on more than one recipe at once, and then
+generate a patch for these changes which can be submitted for merging.</p>
+
+<p>To get started, your changes will need to be associated with a changeset.</p>
+
+{% if changesets %}
+ <h3>Select an existing changeset</h3>
+ <ul>
+ {% for changeset in changesets %}
+ <li><a href="{% url bulk_change_search changeset.id %}">{{ changeset.name }}</a></li>
+ {% endfor %}
+ </ul>
+{% endif %}
+
+<h3>Create a new changeset</h3>
+
+<form class="form-inline" method="POST">
+ {% csrf_token %}
+ {% for hidden in form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+ {% for field in form.visible_fields %}
+ {% if field.errors %}
+ <div class="control-group alert alert-error">
+ {{ field.errors }}
+ {% endif %}
+ <div class="control-group">
+ {{ field.label_tag }}
+ {{ field }}
+ <span class="help-inline custom-help">
+ {{ field.help_text }}
+ </span>
+ {% if field.errors %}
+ </div>
+ {% endif %}
+ </div>
+ {% endfor %}
+ <div class="control-group">
+ <div class="controls">
+ <button type="submit" class="btn">Create</button>
+ </div>
+ </div>
+</form>
+
+{% endautoescape %}
+
+{% endblock %}
diff --git a/templates/layerindex/bulkchangeedit.html b/templates/layerindex/bulkchangeedit.html
new file mode 100644
index 0000000000..8d864d6621
--- /dev/null
+++ b/templates/layerindex/bulkchangeedit.html
@@ -0,0 +1,54 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% comment %}
+
+ layerindex-web - bulk change edit page template
+
+ Copyright (C) 2013 Intel Corporation
+ Licensed under the MIT license, see COPYING.MIT for details
+
+{% endcomment %}
+
+<!--
+{% block title_append %} - bulk change{% endblock %}
+-->
+
+{% block content %}
+{% autoescape on %}
+
+<h2>Edit recipe fields</h2>
+
+<form method="POST">
+ {{ formset.non_form_errors }}
+ {{ formset.management_form }}
+ {% csrf_token %}
+ {% for form in formset %}
+ {% for hidden in form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+ <h3>{{ form.instance.recipe.filename }}</h3>
+ {% for field in form.visible_fields %}
+ {% if field.errors %}
+ <div class="control-group alert alert-error">
+ {{ field.errors }}
+ {% endif %}
+ <div class="control-group formfields">
+ <div class="control-label">
+ {{ field.label_tag }}
+ </div>
+ <div class="controls">
+ {{ field }}
+ <span class="help-inline custom-help">
+ {{ field.help_text }}
+ </span>
+ </div>
+ </div>
+ {% endfor %}
+ {% endfor %}
+ <input type="submit" class="btn" name="save" value="Save"></input>
+</form>
+
+{% endautoescape %}
+
+{% endblock %}
diff --git a/templates/layerindex/bulkchangereview.html b/templates/layerindex/bulkchangereview.html
new file mode 100644
index 0000000000..5fb971eff0
--- /dev/null
+++ b/templates/layerindex/bulkchangereview.html
@@ -0,0 +1,47 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% comment %}
+
+ layerindex-web - bulk change result page template
+
+ Copyright (C) 2013 Intel Corporation
+ Licensed under the MIT license, see COPYING.MIT for details
+
+{% endcomment %}
+
+<!--
+{% block title_append %} - bulk change{% endblock %}
+-->
+
+{% block content %}
+{% autoescape on %}
+
+<h2>{{ changeset.name }}</h2>
+{% regroup changeset.recipechange_set.all by recipe.layerbranch.layer as changeset_recipes %}
+<ul>
+{% for layer in changeset_recipes %}
+ <li>{{ layer.grouper }}
+ <ul>
+ {% for change in layer.list %}
+ <li>
+ {{ change.recipe.filename }}
+ <ul>
+ {% for field in change.changed_fields %}
+ <li>{{ field }}</li>
+ {% endfor %}
+ </ul>
+ </li>
+ {% endfor %}
+ </ul>
+ </li>
+{% endfor %}
+</ul>
+<a href="{% url bulk_change_search changeset.id %}" class="btn">Add recipes</a>
+<a href="{% url bulk_change_edit changeset.id %}" class="btn">Edit</a>
+<a href="{% url bulk_change_patches changeset.id %}" class="btn">Get patches</a>
+<a href="{% url bulk_change_delete changeset.id %}?cancel=bulk_change_review" class="btn">Delete</a>
+
+{% endautoescape %}
+
+{% endblock %}
diff --git a/templates/layerindex/bulkchangesearch.html b/templates/layerindex/bulkchangesearch.html
new file mode 100644
index 0000000000..662c37d2a8
--- /dev/null
+++ b/templates/layerindex/bulkchangesearch.html
@@ -0,0 +1,153 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% comment %}
+
+ layerindex-web - bulk change search page template
+
+ Copyright (C) 2013 Intel Corporation
+ Licensed under the MIT license, see COPYING.MIT for details
+
+{% endcomment %}
+
+
+<!--
+{% block title_append %} - bulk change{% endblock %}
+-->
+
+{% block content %}
+{% autoescape on %}
+
+<h2>Add recipes to changeset</h2>
+
+ <div class="row-fluid">
+
+ <div class="span9">
+
+ <div class="row-fluid">
+ <form id="search-form" class="form-inline" method="GET">
+ <table class="search-form-table">
+ <tbody>
+ <tr>
+ <td></td>
+ <td>
+ {{ search_form.field.errors }}
+ {{ search_form.match_type.errors }}
+ {{ search_form.value.errors }}
+ </td>
+ </tr>
+ <tr>
+ <td>Field:</td>
+ <td>
+ {{ search_form.field }}
+ {{ search_form.match_type }}
+ {{ search_form.value }}
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ {{ search_form.layer.errors }}
+ </td>
+ </tr>
+ <tr>
+ <td>Layer:</td>
+ <td>{{ search_form.layer }}</td>
+ </tr>
+ </tbody>
+ </table>
+ <button class="btn" type="submit">Search</button>
+ </form>
+ </div>
+
+{% if recipe_list %}
+ <form id="recipe-select-form" method="POST">
+ {% csrf_token %}
+ <table class="table table-striped table-bordered recipestable">
+ <thead>
+ <tr>
+ <th></th>
+ <th>Recipe name</th>
+ <th>Version</th>
+ <th class="span9">Description</th>
+ <th>Layer</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ {% for recipe in recipe_list %}
+ <tr>
+ <td><input type="checkbox" name="selecteditems" value="{{ recipe.id }}"></input></td>
+ <td><a href="{% url recipe recipe.id %}">{{ recipe.name }}</a></td>
+ <td>{{ recipe.pv }}</td>
+ <td>{{ recipe.short_desc }}</td>
+ <td><a href="{% url layer_item recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <input type="submit" class="btn" name="add_selected" value="Add selected"></input>
+ <input type="submit" class="btn" name="add_all" value="Add all"></input>
+
+ {% if is_paginated %}
+ {% load pagination %}
+ {% pagination page_obj %}
+ {% endif %}
+{% else %}
+ {% if searched %}
+ <p>No matching recipes in database.</p>
+ {% endif %}
+{% endif %}
+ </div>
+
+ <div class="span3">
+ {% if changeset %}
+ <div class="well">
+ <p>{{ changeset.name }}</p>
+ {% if changeset.recipechange_set.all %}
+ <small>
+ {% regroup changeset.recipechange_set.all by recipe.layerbranch.layer as changeset_recipes %}
+ <ul>
+ {% for layer in changeset_recipes %}
+ <li>{{ layer.grouper }}
+ <ul>
+ {% for change in layer.list %}
+ <li>{{ change.recipe.filename }}</li>
+ {% endfor %}
+ </ul>
+ </li>
+ {% endfor %}
+ </ul>
+ </small>
+ <input type="submit" class="btn" name="remove_all" value="Remove all"></input>
+ <a href="{% url bulk_change_edit changeset.id %}" class="btn">Edit</a>
+ {% endif %}
+ <a href="{% url bulk_change_delete changeset.id %}?cancel=bulk_change_search" class="btn">Delete</a>
+ </div>
+ {% endif %}
+ </form>
+
+
+ </div>
+
+ </div>
+
+{% endautoescape %}
+
+{% endblock %}
+
+{% block scripts %}
+<script>
+ enable_value_field = function() {
+ if($('#id_match_type').val() == 'B')
+ $('#id_value').prop('disabled', true);
+ else
+ $('#id_value').prop('disabled', false);
+ }
+
+ $(document).ready(function() {
+ $('#id_match_type').change(enable_value_field)
+ enable_value_field()
+ });
+</script>
+{% endblock %}
diff --git a/templates/layerindex/deleteconfirm.html b/templates/layerindex/deleteconfirm.html
index 5884d998aa..08e5166254 100644
--- a/templates/layerindex/deleteconfirm.html
+++ b/templates/layerindex/deleteconfirm.html
@@ -26,7 +26,7 @@
<form action="" method="post">
{% csrf_token %}
<input type="submit" value="Delete" class='btn btn-warning' />
- <a href="{{ return_url }}" class='btn'>Cancel</a>
+ <a href="{{ cancel_url }}" class='btn'>Cancel</a>
</form>
{% endautoescape %}