mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
Add "needs attention" flag for comparison recipes
Add a flag that can be set and searched for to indicate that we need to take care of importing a package or a patch applied by a package. Ideally the comments would elaborate on what's needed (if it's not obvious from the cover status). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
ea8b656711
commit
fcb44571fd
|
@ -164,7 +164,7 @@ class EditProfileForm(forms.ModelForm):
|
|||
class ClassicRecipeForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = ClassicRecipe
|
||||
fields = ('cover_layerbranch', 'cover_pn', 'cover_status', 'cover_verified', 'cover_comment', 'classic_category')
|
||||
fields = ('cover_layerbranch', 'cover_pn', 'cover_status', 'cover_verified', 'cover_comment', 'classic_category', 'needs_attention')
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = super(ClassicRecipeForm, self).clean()
|
||||
|
@ -226,6 +226,11 @@ class ClassicRecipeSearchForm(forms.Form):
|
|||
('1', 'Has patches'),
|
||||
('0', 'No patches'),
|
||||
]
|
||||
ATTENTION_CHOICES = [
|
||||
('', '(any)'),
|
||||
('1', 'Yes'),
|
||||
('0', 'No'),
|
||||
]
|
||||
|
||||
q = forms.CharField(label='Keyword', max_length=255, required=False)
|
||||
category = forms.CharField(max_length=255, required=False)
|
||||
|
@ -233,4 +238,5 @@ class ClassicRecipeSearchForm(forms.Form):
|
|||
has_patches = forms.ChoiceField(label='Patches', choices=PATCH_CHOICES, required=False)
|
||||
cover_status = forms.ChoiceField(label='Status', choices=COVER_STATUS_CHOICES, required=False)
|
||||
cover_verified = forms.ChoiceField(label='Verified', choices=VERIFIED_CHOICES, required=False)
|
||||
needs_attention = forms.ChoiceField(label='Needs attention', choices=ATTENTION_CHOICES, required=False)
|
||||
|
||||
|
|
19
layerindex/migrations/0017_classicrecipe_needs_attention.py
Normal file
19
layerindex/migrations/0017_classicrecipe_needs_attention.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('layerindex', '0016_classicrecipe_delete'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='classicrecipe',
|
||||
name='needs_attention',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -535,6 +535,7 @@ class ClassicRecipe(Recipe):
|
|||
cover_comment = models.TextField(blank=True)
|
||||
classic_category = models.CharField('OE-Classic Category', max_length=100, blank=True)
|
||||
deleted = models.BooleanField(default=False)
|
||||
needs_attention = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
|
|
|
@ -929,6 +929,7 @@ class ClassicRecipeSearchView(RecipeSearchView):
|
|||
category = self.request.GET.get('category', None)
|
||||
oe_layer = self.request.GET.get('oe_layer', None)
|
||||
has_patches = self.request.GET.get('has_patches', '')
|
||||
needs_attention = self.request.GET.get('needs_attention', '')
|
||||
init_qs = ClassicRecipe.objects.filter(layerbranch__branch__name=self.kwargs['branch']).filter(deleted=False)
|
||||
if cover_status:
|
||||
if cover_status == '!':
|
||||
|
@ -951,6 +952,11 @@ class ClassicRecipeSearchView(RecipeSearchView):
|
|||
init_qs = init_qs.filter(patch__isnull=False).distinct()
|
||||
else:
|
||||
init_qs = init_qs.filter(patch__isnull=True)
|
||||
if needs_attention.strip():
|
||||
if needs_attention == '1':
|
||||
init_qs = init_qs.filter(needs_attention=True)
|
||||
else:
|
||||
init_qs = init_qs.filter(needs_attention=False)
|
||||
if query_string.strip():
|
||||
order_by = (Lower('pn'), 'layerbranch__layer')
|
||||
|
||||
|
|
|
@ -141,8 +141,14 @@
|
|||
<label>
|
||||
Category
|
||||
{{ form.classic_category }}
|
||||
</p>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label class="checkbox" id="id_label_needs_attention">
|
||||
{{ form.needs_attention }}
|
||||
Needs attention
|
||||
</label>
|
||||
</p>
|
||||
<input type="submit" value="Save" class='btn' />
|
||||
</form>
|
||||
{% else %}
|
||||
|
|
|
@ -96,11 +96,7 @@
|
|||
{% for recipe in recipe_list %}
|
||||
<tr {% if recipe.preferred_count > 0 %}class="muted"{% endif %}>
|
||||
{% if compare %}
|
||||
{% if branch.name == 'oe-classic' %}
|
||||
<td><a href="{% url 'classic_recipe' recipe.id %}">{{ recipe.name }}</a></td>
|
||||
{% else %}
|
||||
<td><a href="{% url 'comparison_recipe' recipe.id %}">{{ recipe.name }}</a></td>
|
||||
{% endif %}
|
||||
<td><a href="{% url 'comparison_recipe' recipe.id %}">{{ recipe.name }}{% if recipe.needs_attention %} <i class="icon-exclamation-sign" data-toggle="tooltip" title="Needs attention"></i>{% endif %}</a></td>
|
||||
<td>{{ recipe.pv|truncatechars:10 }}</td>
|
||||
<td>{% if recipe.patch_set.exists %}{{ recipe.patch_set.count }}{% endif %}</td>
|
||||
<td>{{ recipe.get_cover_status_display }}{% if recipe.cover_comment %} <a href="{% url 'classic_recipe' recipe.id %}"><i class="icon-comment" data-toggle="tooltip" title="{{ recipe.cover_comment }}"></i></a>{% endif %}</td>
|
||||
|
@ -115,11 +111,7 @@
|
|||
<td></td>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if branch.name == 'oe-classic' %}
|
||||
<td><a href="{% url 'classic_recipe' recipe.id %}">{{ recipe.name }}</a></td>
|
||||
{% else %}
|
||||
<td><a href="{% url 'comparison_recipe' recipe.id %}">{{ recipe.name }}</a></td>
|
||||
{% endif %}
|
||||
<td><a href="{% url 'comparison_recipe' recipe.id %}">{{ recipe.name }}{% if recipe.needs_attention %} <i class="icon-exclamation-sign" data-toggle="tooltip" title="Needs attention"></i>{% endif %}</a></td>
|
||||
<td>{{ recipe.pv }}</td>
|
||||
<td>{{ recipe.short_desc }}</td>
|
||||
<td>{{ recipe.get_cover_desc }}</td>
|
||||
|
|
Loading…
Reference in New Issue
Block a user