Change "star" icon to "bullhorn" icon

This commit is contained in:
Oliver 2021-11-02 15:07:20 +11:00
parent 9b0d8bedb5
commit 4bfdf21107
6 changed files with 8 additions and 19 deletions

View File

@ -655,17 +655,6 @@ class IndexView(TemplateView):
context = super(TemplateView, self).get_context_data(**kwargs)
# TODO - Re-implement this when a less expensive method is worked out
# context['starred'] = [star.part for star in self.request.user.starred_parts.all()]
# Generate a list of orderable parts which have stock below their minimum values
# TODO - Is there a less expensive way to get these from the database
# context['to_order'] = [part for part in Part.objects.filter(purchaseable=True) if part.need_to_restock()]
# Generate a list of assembly parts which have stock below their minimum values
# TODO - Is there a less expensive way to get these from the database
# context['to_build'] = [part for part in Part.objects.filter(assembly=True) if part.need_to_restock()]
return context

View File

@ -874,8 +874,8 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
GLOBAL_SETTINGS = {
'HOMEPAGE_PART_STARRED': {
'name': _('Show starred parts'),
'description': _('Show starred parts on the homepage'),
'name': _('Show subscribed parts'),
'description': _('Show subscribed parts on the homepage'),
'default': True,
'validator': bool,
},

View File

@ -23,8 +23,8 @@
{% include "admin_button.html" with url=url %}
{% endif %}
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Star this part" %}'>
<span id='part-star-icon' class='fas fa-star {% if starred %}icon-yellow{% endif %}'/>
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Subscribe to nofications for this part" %}'>
<span id='part-star-icon' class='fas fa-bullhorn {% if starred %}icon-green{% endif %}'/>
</button>
{% if barcodes %}

View File

@ -84,7 +84,7 @@ function addHeaderAction(label, title, icon, options) {
addHeaderTitle('{% trans "Parts" %}');
{% if setting_part_starred %}
addHeaderAction('starred-parts', '{% trans "Starred Parts" %}', 'fa-star');
addHeaderAction('starred-parts', '{% trans "Subscribed Parts" %}', 'fa-bullhorn');
loadSimplePartTable("#table-starred-parts", "{% url 'api-part-list' %}", {
params: {
"starred": true,

View File

@ -14,7 +14,7 @@
<div class='row'>
<table class='table table-striped table-condensed'>
<tbody>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_STARRED" icon='fa-star' user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_STARRED" icon='fa-bullhorn' user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_LATEST" icon='fa-history' user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="PART_RECENT_COUNT" icon="fa-clock" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BOM_VALIDATION" user_setting=True %}

View File

@ -398,9 +398,9 @@ function toggleStar(options) {
method: 'PATCH',
success: function(response) {
if (response.starred) {
$(options.button).addClass('icon-yellow');
$(options.button).addClass('icon-green');
} else {
$(options.button).removeClass('icon-yellow');
$(options.button).removeClass('icon-green');
}
}
}