Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8ce3001
First stab
snipe Sep 23, 2025
9023eda
Changed class
snipe Sep 23, 2025
514711d
Label blade component
snipe Sep 23, 2025
7c0c3b2
Use shorthand for errors
snipe Sep 23, 2025
e138c93
Added maxlength default for text
snipe Sep 23, 2025
5c716c3
Updated notes maxlength
snipe Sep 23, 2025
671e79f
Sorry, this shouldn’t have been in there :(
snipe Sep 23, 2025
a59914e
Added placeholder back in
snipe Sep 23, 2025
253026d
Updated locations edit
snipe Sep 23, 2025
c4923fa
Updated address
snipe Sep 23, 2025
d2e3a13
Added ability to mark fields as disabled
snipe Sep 23, 2025
c3efdd0
Updated company
snipe Sep 23, 2025
433a3e1
Fixed field type
snipe Sep 23, 2025
2554b50
Updated suppliers
snipe Sep 23, 2025
33e7425
Account for tooltips
snipe Sep 23, 2025
a3bad98
Added date and tooltip components
snipe Sep 23, 2025
b766f6e
Made edit screen narrower on wide screens
snipe Sep 23, 2025
3863e82
Handle text and date fields on license edit
snipe Sep 23, 2025
682c1a8
Make required false
snipe Sep 23, 2025
f8362f4
handled text fields in status labels
snipe Sep 23, 2025
02a4268
Switched more fields to blade compaonents
snipe Sep 23, 2025
1c09657
Handle checkboxes
snipe Sep 23, 2025
cde2297
More checkbox changes
snipe Sep 23, 2025
150c205
Added checkboxes to status labels page
snipe Sep 23, 2025
3b4c51b
Use slot instead of label
snipe Sep 24, 2025
f056147
Update resources/views/blade/input/text.blade.php
snipe Sep 24, 2025
235dcbc
Updated more views
snipe Sep 24, 2025
5782484
Update resources/views/blade/form-row.blade.php
snipe Sep 24, 2025
eea1922
Added checkbox and radios
snipe Sep 25, 2025
dc6ee34
Revert custom field name text box for now
snipe Sep 29, 2025
08630d9
Remove radio buttons - they don’t work correctly yet
snipe Sep 29, 2025
750c376
Set item to null so it doesn’t get merged automatically
snipe Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion .github/ISSUE_TEMPLATE/Bug-Report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,38 @@ body:
- Safari
- Microsoft Edge
- Other
- type: dropdown
id: on-demo
attributes:
label: Can you reproduce this on the public demo?
description: You can check this at https://demo.snipeitapp.com.
options:
- 'Yes'
- 'No'
- N/A
validations:
required: true
- type: dropdown
id: fmcs
attributes:
label: Do you have full multiple company support enabled?
description: You can check this in your Snipe-IT installation at `Admin Settings > General Settings > Scoping`.
options:
- 'Yes'
- 'No'
validations:
required: true
- type: dropdown
id: fmcs-location
attributes:
label: If you have full multiple company support enabled, do you have location scoping to company enabled?
description: You can check this in your Snipe-IT installation at `Admin Settings > General Settings > Scoping`.
options:
- 'Yes'
- 'No'
- I do not have full multiple company support enabled
validations:
required: true
- type: textarea
id: server-logs
attributes:
Expand Down Expand Up @@ -102,4 +134,4 @@ body:
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/grokability/snipe-it/blob/master/CODE_OF_CONDUCT.md).
options:
- label: I agree to follow this project's Code of Conduct
required: true
required: true
84 changes: 75 additions & 9 deletions resources/views/accessories/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,85 @@
@section('inputFields')

@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/accessories/general.accessory_name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
:$errors
name="name"
/>
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true','category_type' => 'accessory'])
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
@include ('partials.forms.edit.model_number')
@include ('partials.forms.edit.order_number')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
@include ('partials.forms.edit.purchase_cost', ['currency_type' => $item->location->currency ?? null, 'unit_cost' => trans('general.unit_cost')])
@include ('partials.forms.edit.quantity')
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.notes')
@include ('partials.forms.edit.image-upload', ['image_path' => app('accessories_upload_path')])

<!-- Model Number -->
<x-form-row
:label="trans('general.model_no')"
:$item
name="model_number"
/>
<!-- Order number -->
<x-form-row
:label="trans('general.order_number')"
:$item
name="order_number"
input_div_class="col-md-5 col-sm-12"
/>


<!-- Purchase date -->
<x-form-row
:label="trans('general.purchase_date')"
:$item
name="purchase_date"
type="date"
input_div_class="col-md-4 col-sm-12"
:value="old('purchase_date', (($item->purchase_date && $item->purchase_date->format('Y-m-d')) ?? ''))"
/>

<!-- Purchase cost -->
<x-form-row
:label="trans('general.unit_cost')"
:$item
name="purchase_cost"
type="number"
maxlength="25"
min="0.00"
max="99999999999999999.000"
step="0.001"
input_div_class="col-md-4 col-sm-12"
/>

<!-- QTY -->
<x-form-row
:label="trans('general.quantity')"
:$item
input_div_class="col-md-2"
name="qty"
/>

<!-- Min Amount -->
<x-form-row
:label="trans('general.min_amt')"
:$item
name="min_amt"
input_div_class="col-md-2"
minlength="1"
maxlength="5"
type="number"
:info_tooltip_text="trans('general.min_amt_help')"
/>

<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>

@include ('partials.forms.edit.image-upload', ['image_path' => app('accessories_upload_path')])
@stop
3 changes: 0 additions & 3 deletions resources/views/blade/example.blade.php

This file was deleted.

6 changes: 2 additions & 4 deletions resources/views/blade/filestable.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'object_type' => '',
])

<!-- begin non-ajaxed file listing table -->
<!-- begin ajaxed file listing table -->
<div class="table-responsive">
<table
data-columns="{{ \App\Presenters\UploadedFilesPresenter::dataTableLayout() }}"
Expand All @@ -30,6 +30,4 @@ class="table table-striped snipe-table"

</div>



<!-- end non-ajaxed file listing table -->
<!-- end ajaxed file listing table -->
5 changes: 5 additions & 0 deletions resources/views/blade/form-label.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- form-label blade component -->
<label {{ $attributes->merge(['class' => 'control-label']) }}>
{{ $slot }}
</label>

107 changes: 107 additions & 0 deletions resources/views/blade/form-row.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<!-- form-row blade component -->
@props([
'checkbox_value' => null,
'disabled' => false,
'div_style' => null,
'error_offset_class' => 'col-md-7 col-md-offset-3',
'errors',
'help_text' => null,
'info_tooltip_text' => null,
'input_class' => null,
'input_div_class' => 'col-md-8 col-sm-12',
'input_group_addon' => null,
'input_style' => null,
'item' => null,
'label' => null,
'label_class' => 'col-md-3 col-sm-12 col-xs-12',
'label_style' => null,
'max' => null,
'maxlength' => 191,
'min' => null,
'minlength' => null,
'name' => null,
'placeholder' => null,
'step' => null,
'type' => 'text',
'value' => null,
'value_text' => null,
])

<div {{ $attributes->merge(['class' => 'form-group']) }}>

@if (isset($label))
<x-form-label
:for="$name"
:style="$label_style ?? null"
class="{{ $label_class }}"
>
{{ $label }}
</x-form-label>
@else
@php
$input_div_class = $input_div_class . ' ' . $error_offset_class;
@endphp
@endif


<div {{ $attributes->merge(['class' => $input_div_class, 'style' => $div_style]) }}>

@php
$blade_type = in_array($type, ['text', 'email', 'url', 'tel', 'number', 'password']) ? 'text' : $type;
@endphp

<x-dynamic-component
:$checkbox_value
:$disabled
:$input_group_addon
:$input_style
:$item
:$max
:$maxlength
:$min
:$minlength
:$name
:$placeholder
:$step
:$type
:$value_text
:aria-label="$name"
:class="$input_class"
:component="'input.'.$blade_type"
:id="$name"
:required="Helper::checkIfRequired($item, $name)"
:value="old($name, $item->{$name})"
/>
</div>


@if ($info_tooltip_text)
<!-- Info Tooltip -->
<div class="col-md-1 text-left" style="padding-left:0; margin-top: 5px;">
<x-input.info-tooltip>
{{ $info_tooltip_text }}
</x-input.info-tooltip>
</div>
@endif


@error($name)
<!-- Form Error -->
<div {{ $attributes->merge(['class' => $error_offset_class]) }}>
<span class="alert-msg" role="alert">
<i class="fas fa-times" aria-hidden="true"></i>
{{ $message }}
</span>
</div>
@enderror

@if ($help_text)
<!-- Help Text -->
<div {{ $attributes->merge(['class' => $error_offset_class]) }}>
<p class="help-block">
{!! $help_text !!}
</p>
</div>
@endif

</div>
16 changes: 16 additions & 0 deletions resources/views/blade/input/checkbox.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@props([
'item' => null,
'field_name' => null,
'input_style' => null,
'required' => false,
'disabled' => false,
'checkbox_value' => null,
'name' => null,
'label' => null,
'value_text' => null,
])

<label class="form-control{{ $disabled ? ' form-control--disabled' : '' }}">
<input type="checkbox" name="{{ $name }}" aria-label="{{ $name }}" value="{{ $checkbox_value }}" @checked(old($name, $item->$name)) {!! $disabled ? 'class="disabled" disabled' : '' !!}>
{{ $value_text ?? $label }}
</label>
12 changes: 12 additions & 0 deletions resources/views/blade/input/date.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@props([
'item' => null,
'input_style' => null,
'end_date' => null,
])

<!-- Datepicker -->
<div {{ $attributes->merge(['class' => 'input-group date']) }} data-provide="datepicker" data-date-today-highlight="true" data-date-language="{{ auth()->user()->locale }}" data-date-locale="{{ auth()->user()->locale }}" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-date-clear-btn="true"{{ $end_date ? ' data-date-end-date=' . $end_date : '' }}>
<input type="text" {{ $attributes->merge(['class' => 'form-control']) }}>
Comment on lines +8 to +9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a $attributes->merge(['class' => on the parent div and the input makes me 🤔

I noticed the same on form-row itself. I'm side-eyeing it but it seems to work fine.

<span class="input-group-addon"><x-icon type="calendar" /></span>

</div>
4 changes: 4 additions & 0 deletions resources/views/blade/input/info-tooltip.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<a href="#" data-tooltip="true" title="{{ $slot }}" style="padding-left: 0px;">
<x-icon type="more-info" style="font-size: 20px;" />
<span class="sr-only">{{ $slot }}</span>
</a>
15 changes: 15 additions & 0 deletions resources/views/blade/input/radio.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@props([
'item' => null,
'field_name' => null,
'input_style' => null,
'required' => false,
'disabled' => false,
'name' => null,
'label' => null,
'value_text' => null,
])

<label class="form-control{{ $disabled ? ' form-control--disabled' : '' }}">
<input type="radio" name="{{ $name }}" aria-label="{{ $name }}" @checked(old($name)) {!! $disabled ? 'class="disabled" disabled' : '' !!}>
{{ $value_text ?? $label }}
</label>
15 changes: 15 additions & 0 deletions resources/views/blade/input/text.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@props([
'input_style' => null,
'input_group_addon' => null,
'required' => false,
'item' => null,
])
<!-- input-text blade component -->
<input
{{ $attributes->merge(['class' => 'form-control', 'style' => $input_style]) }}
@required($required)
/>

@if ($input_group_addon)
<span class="input-group-addon">{{ $input_group_addon }}</span>
@endif
7 changes: 6 additions & 1 deletion resources/views/categories/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@

@section('inputFields')

@include ('partials.forms.edit.name', ['translated_name' => trans('admin/categories/general.name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>

<!-- Type -->
<div class="form-group {{ $errors->has('category_type') ? ' has-error' : '' }}">
Expand Down
Loading
Loading