mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Change "star" icon to "bullhorn" icon
This commit is contained in:
parent
9b0d8bedb5
commit
4bfdf21107
@ -655,17 +655,6 @@ class IndexView(TemplateView):
|
|||||||
|
|
||||||
context = super(TemplateView, self).get_context_data(**kwargs)
|
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
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
@ -874,8 +874,8 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
|
|||||||
|
|
||||||
GLOBAL_SETTINGS = {
|
GLOBAL_SETTINGS = {
|
||||||
'HOMEPAGE_PART_STARRED': {
|
'HOMEPAGE_PART_STARRED': {
|
||||||
'name': _('Show starred parts'),
|
'name': _('Show subscribed parts'),
|
||||||
'description': _('Show starred parts on the homepage'),
|
'description': _('Show subscribed parts on the homepage'),
|
||||||
'default': True,
|
'default': True,
|
||||||
'validator': bool,
|
'validator': bool,
|
||||||
},
|
},
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
{% include "admin_button.html" with url=url %}
|
{% include "admin_button.html" with url=url %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Star this part" %}'>
|
<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-star {% if starred %}icon-yellow{% endif %}'/>
|
<span id='part-star-icon' class='fas fa-bullhorn {% if starred %}icon-green{% endif %}'/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{% if barcodes %}
|
{% if barcodes %}
|
||||||
|
@ -84,7 +84,7 @@ function addHeaderAction(label, title, icon, options) {
|
|||||||
addHeaderTitle('{% trans "Parts" %}');
|
addHeaderTitle('{% trans "Parts" %}');
|
||||||
|
|
||||||
{% if setting_part_starred %}
|
{% 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' %}", {
|
loadSimplePartTable("#table-starred-parts", "{% url 'api-part-list' %}", {
|
||||||
params: {
|
params: {
|
||||||
"starred": true,
|
"starred": true,
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<div class='row'>
|
<div class='row'>
|
||||||
<table class='table table-striped table-condensed'>
|
<table class='table table-striped table-condensed'>
|
||||||
<tbody>
|
<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="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="PART_RECENT_COUNT" icon="fa-clock" user_setting=True %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BOM_VALIDATION" user_setting=True %}
|
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BOM_VALIDATION" user_setting=True %}
|
||||||
|
@ -398,9 +398,9 @@ function toggleStar(options) {
|
|||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
if (response.starred) {
|
if (response.starred) {
|
||||||
$(options.button).addClass('icon-yellow');
|
$(options.button).addClass('icon-green');
|
||||||
} else {
|
} else {
|
||||||
$(options.button).removeClass('icon-yellow');
|
$(options.button).removeClass('icon-green');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user