2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00

Merge branch 'master' of github.com:inventree/InvenTree into multi_part_forms

This commit is contained in:
eeintech 2021-05-11 10:22:34 -04:00
commit 10eb69caf9
166 changed files with 776 additions and 727 deletions

View File

@ -77,12 +77,20 @@ class AuthRequiredMiddleware(object):
if request.path_info == reverse_lazy('logout'):
return HttpResponseRedirect(reverse_lazy('login'))
login = reverse_lazy('login')
path = request.path_info
if not request.path_info == login and not request.path_info.startswith('/api/'):
# List of URL endpoints we *do not* want to redirect to
urls = [
reverse_lazy('login'),
reverse_lazy('logout'),
reverse_lazy('admin:login'),
reverse_lazy('admin:logout'),
]
if path not in urls and not path.startswith('/api/'):
# Save the 'next' parameter to pass through to the login view
return redirect('%s?next=%s' % (login, request.path))
return redirect('%s?next=%s' % (reverse_lazy('login'), request.path))
# Code to be executed for each request/response after
# the view is called.

View File

@ -507,7 +507,7 @@
padding-right: 6px;
padding-top: 3px;
padding-bottom: 2px;
};
}
.panel-heading .badge {
float: right;
@ -568,7 +568,7 @@
}
.media {
//padding-top: 15px;
/* padding-top: 15px; */
overflow: visible;
}
@ -594,8 +594,8 @@
width: 160px;
position: fixed;
z-index: 1;
//top: 0;
//left: 0;
/* top: 0;
left: 0; */
overflow-x: hidden;
padding-top: 20px;
padding-right: 25px;
@ -826,7 +826,7 @@ input[type="submit"] {
width: 100%;
padding: 20px;
z-index: 5000;
pointer-events: none; // Prevent this div from blocking links underneath
pointer-events: none; /* Prevent this div from blocking links underneath */
}
.alert {
@ -937,3 +937,14 @@ input[type="submit"] {
input[type="date"].form-control, input[type="time"].form-control, input[type="datetime-local"].form-control, input[type="month"].form-control {
line-height: unset;
}
.clip-btn {
font-size: 10px;
padding: 0px 6px;
color: var(--label-grey);
background: none;
}
.clip-btn:hover {
background: var(--label-grey);
}

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,14 @@
function attachClipboard(selector) {
new ClipboardJS(selector, {
text: function(trigger) {
var content = trigger.parentElement.parentElement.textContent;
return content.trim();
}
});
}
function inventreeDocReady() {
/* Run this function when the HTML document is loaded.
* This will be called for every page that extends "base.html"
@ -48,6 +59,10 @@ function inventreeDocReady() {
no_post: true,
});
});
// Initialize clipboard-buttons
attachClipboard('.clip-btn');
}
function isFileTransfer(transfer) {

View File

@ -1,5 +1,6 @@
{% extends "modal_delete_form.html" %}
{% load i18n %}
{% block pre_form_content %}
Are you sure you wish to delete this line item?
{% trans "Are you sure you wish to delete this line item?" %}
{% endblock %}

View File

@ -20,20 +20,20 @@
<tr>
<td><span class='fas fa-font'></span></td>
<td><strong>{% trans "Part name" %}</strong></td>
<td>{{ part.name }}</td>
<td>{{ part.name }}{% include "clip.html"%}</td>
</tr>
{% if part.IPN %}
<tr>
<td></td>
<td><strong>{% trans "IPN" %}</strong></td>
<td>{{ part.IPN }}</td>
<td>{{ part.IPN }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.revision %}
<tr>
<td><span class='fas fa-code-branch'></span></td>
<td><strong>{% trans "Revision" %}</strong></td>
<td>{{ part.revision }}</td>
<td>{{ part.revision }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.trackable %}
@ -42,7 +42,7 @@
<td><strong>{% trans "Latest Serial Number" %}</strong></td>
<td>
{% if part.getLatestSerialNumber %}
{{ part.getLatestSerialNumber }}
{{ part.getLatestSerialNumber }}{% include "clip.html"%}
{% else %}
<em>{% trans "No serial numbers recorded" %}</em>
{% endif %}
@ -52,7 +52,7 @@
<tr>
<td><span class='fas fa-info-circle'></span></td>
<td><strong>{% trans "Description" %}</strong></td>
<td>{{ part.description }}</td>
<td>{{ part.description }}{% include "clip.html"%}</td>
</tr>
{% if part.variant_of %}
<tr>
@ -96,7 +96,7 @@
<td></td>
<td><strong>{% trans "Default Supplier" %}</strong></td>
<td><a href="{% url 'supplier-part-detail' part.default_supplier.id %}">
{{ part.default_supplier.supplier.name }} | {{ part.default_supplier.SKU }}
{{ part.default_supplier.supplier.name }} | {{ part.default_supplier.SKU }}{% include "clip.html"%}
</a></td>
</tr>
{% endif %}

View File

@ -1234,7 +1234,6 @@ class StockItem(MPTTModel):
return False
if self.updateQuantity(self.quantity + quantity):
text = _('Added {n} items').format(n=helpers.normalize(quantity))
self.addTransactionNote(

View File

@ -133,11 +133,14 @@
<!-- boostrap-table-treegrid -->
<script type='text/javascript' src='{% static "bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js" %}'></script>
<!-- 3rd party general js -->
<script type="text/javascript" src="{% static 'fullcalendar/main.js' %}"></script>
<script type="text/javascript" src="{% static 'fullcalendar/locales-all.js' %}"></script>
<script type="text/javascript" src="{% static 'script/select2/select2.js' %}"></script>
<script type='text/javascript' src="{% static 'script/moment.js' %}"></script>
<script type='text/javascript' src="{% static 'script/clipboard.min.js' %}"></script>
<!-- general InvenTree -->
<script type='text/javascript' src="{% static 'script/inventree/inventree.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/api.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script>

View File

@ -0,0 +1,5 @@
{% load i18n %}
<span class="float-right">
<button class="btn clip-btn" type="button" data-toggle='tooltip' title='{% trans "copy to clipboard" %}'><i class="fas fa-copy"></i></button>
</span>