Change bullhorn icon to bell icon

This commit is contained in:
Oliver 2021-11-03 16:59:59 +11:00
parent 63ec5770f4
commit 85adf842f6
4 changed files with 17 additions and 13 deletions

View File

@ -24,7 +24,11 @@
{% endif %} {% endif %}
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Subscribe to nofications for 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-bullhorn {% if starred %}icon-green{% endif %}'/> {% if starred %}
<span id='part-star-icon' class='fas fa-bell icon-green'/>
{% else %}
<span id='part-star-icon' class='fa fa-bell-slash'/>
{% endif %}
</button> </button>
{% if barcodes %} {% if barcodes %}

View File

@ -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 "Subscribed Parts" %}', 'fa-bullhorn'); addHeaderAction('starred-parts', '{% trans "Subscribed Parts" %}', 'fa-bell');
loadSimplePartTable("#table-starred-parts", "{% url 'api-part-list' %}", { loadSimplePartTable("#table-starred-parts", "{% url 'api-part-list' %}", {
params: { params: {
"starred": true, "starred": true,

View File

@ -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-bullhorn' user_setting=True %} {% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_STARRED" icon='fa-bell' 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 %}

View File

@ -373,8 +373,7 @@ function duplicatePart(pk, options={}) {
} }
function toggleStar(options) { /* Toggle the 'starred' status of a part.
/* Toggle the 'starred' status of a part.
* Performs AJAX queries and updates the display on the button. * Performs AJAX queries and updates the display on the button.
* *
* options: * options:
@ -382,6 +381,7 @@ function toggleStar(options) {
* - part: pk of the part object * - part: pk of the part object
* - user: pk of the user * - user: pk of the user
*/ */
function toggleStar(options) {
var url = `/api/part/${options.part}/`; var url = `/api/part/${options.part}/`;
@ -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-green'); $(options.button).removeClass('fa fa-bell-slash').addClass('fas fa-bell icon-green');
} else { } else {
$(options.button).removeClass('icon-green'); $(options.button).removeClass('fas fa-bell icon-green').addClass('fa fa-bell-slash');
} }
} }
} }