Skip to content

A free open source IT asset/license management system

Removed old partials

snipe2f6f8c7e1c37
diff --git a/resources/views/partials/assets-assigned.blade.php b/resources/views/partials/assets-assigned.blade.php
deleted file mode 100644
index 0ca4cfdf3c..0000000000
--- a/resources/views/partials/assets-assigned.blade.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<script nonce="{{ csrf_token() }}">
-
- // create the assigned assets listing box for the right side of the screen
- $(function() {
- $('#assigned_user').on("change",function () {
- var userid = $('#assigned_user option:selected').val();
-
- if(userid=='') {
- console.warn('no user selected');
- $('#current_assets_box').fadeOut();
- $('#current_assets_content').html("");
- } else {
-
- $.ajax({
- type: 'GET',
- url: '{{ config('app.url') }}/api/v1/users/' + userid + '/assets',
- headers: {
- "X-Requested-With": 'XMLHttpRequest',
- "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
- },
-
- dataType: 'json',
- success: function (data) {
- $('#current_assets_box').fadeIn();
-
- var table_html = '<div class="row">';
- table_html += '<div class="col-md-12">';
- table_html += '<table class="table table-striped">';
- table_html += '<thead><tr>';
- table_html += '<th scope="col"></th>';
- table_html += '<th scope="col">{{ trans('admin/hardware/form.name') }}</th>';
- table_html += '<th scope="col">{{ trans('admin/hardware/form.tag') }}</th>';
- table_html += '<th scope="col">{{ trans('admin/hardware/form.serial') }}</th>';
- table_html += '</tr></thead><tbody>';
-
- $('#current_assets_content').append('');
-
- if (data.rows.length > 0) {
-
- for (var i in data.rows) {
- var asset = data.rows[i];
- table_html += '<tr>';
- if (asset.image != null) {
- table_html += '<td class="col-md-1"><a href="' + asset.image + '" data-toggle="lightbox" data-type="image"><img src="' + asset.image + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" alt=""></a></td>';
- } else {
- table_html += "<td></td> ";
- }
- table_html += '<td><a href="{{ config('app.url') }}/hardware/' + asset.id + '">';
-
- if ((asset.name == '') && (asset.name != null)) {
- table_html += " " + asset.model.name;
- } else {
- table_html += asset.name;
- table_html += " (" + asset.model.name + ")";
- }
-
- table_html += '</a></td>';
- table_html += '<td class="col-md-4">' + asset.asset_tag + '</td>';
- table_html += '<td class="col-md-4">' + asset.serial + '</td>';
- table_html += "</tr>";
- }
- } else {
- table_html += '<tr><td colspan="4">{{ trans('admin/users/message.user_has_no_assets_assigned') }}</td></tr>';
- }
- $('#current_assets_content').html(table_html + '</tbody></table></div></div>');
-
- },
- error: function (data) {
- $('#current_assets_box').fadeOut();
- }
- });
- }
- });
- });
-</script>
diff --git a/resources/views/partials/licenses-assigned.blade.php b/resources/views/partials/licenses-assigned.blade.php
deleted file mode 100644
index a1241ab5e7..0000000000
--- a/resources/views/partials/licenses-assigned.blade.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<script nonce="{{ csrf_token() }}">
- let canViewKeys = @json(Gate::check('viewKeys', $license));
- // create the assigned licenses listing box for the right side of the screen
- $(function() {
- $('#assigned_user').on("change",function () {
- var userid = $('#assigned_user option:selected').val();
-
- if(userid=='') {
- console.warn('no user selected');
- $('#current_license_box').fadeOut();
- $('#current_license_content').html("");
- } else {
-
- $.ajax({
- type: 'GET',
- url: '{{ config('app.url') }}/api/v1/users/' + userid + '/licenses',
- headers: {
- "X-Requested-With": 'XMLHttpRequest',
- "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
- },
-
- dataType: 'json',
- success: function (data) {
- $('#current_license_box').fadeIn();
-
- var table_html = '<div class="row">';
- table_html += '<div class="col-md-12">';
- table_html += '<table class="table table-striped">';
- table_html += '<thead><tr>';
- table_html += '<th scope="col">{{ trans('admin/licenses/form.name') }}</th>';
- table_html += '<th scope="col">{{ trans('admin/licenses/form.license_key') }}</th>';
- table_html += '</tr></thead><tbody>';
-
- $('#current_license_content').append('');
-
- if (data.rows.length > 0) {
-
- for (var i in data.rows) {
- var license = data.rows[i];
- table_html += '<tr>';
- table_html += '<td><a href="{{ config('app.url') }}/licenses/' + license.id + '">';
-
- if ((license.name == '') && (license.name != null)) {
- table_html += " " + license.name;
- } else {
- table_html += license.name;
- }
- table_html += '</a></td>';
- if (canViewKeys) {
- table_html += '<td>' + license.product_key + '</td>';
- }
- table_html += "</tr>";
- }
- } else {
- table_html += '<tr><td colspan="4">{{ trans('admin/users/message.user_has_no_assets_assigned') }}</td></tr>';
- }
- $('#current_license_content').html(table_html + '</tbody></table></div></div>');
-
- },
- error: function (data) {
- $('#current_license_box').fadeOut();
- }
- });
- }
- });
- });
-</script>
-<?php