Skip to content
Open
Show file tree
Hide file tree
Changes from 10 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
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 -->
9 changes: 9 additions & 0 deletions resources/views/blade/form-label.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- form-label blade component -->
@props([
'label',
])

<label {{ $attributes->merge(['class' => 'control-label']) }}>
{{ $label }}
Copy link
Member

Choose a reason for hiding this comment

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

It's a stylistic thing, but you could use $slot here - making your labels look something like:

<x-label.whatever blah="blah" blah="blah">
    This is the actual Label
</x-label.whatever>

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it this way to ensure that we have control-label and whatever other styles might be needed. Possible I'm misunderstanding though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think he means removing @props and swapping {{ $label }} for {{ $slot }}. The attributes will still be merged (class="control-label" will still render) and the calling syntax would change from

<x-form-label
    :$label
    :for="$name"
    :style="$label_style ?? null"
    class="{{ $label_class }}"
/>

to

<x-form-label
    :for="$name"
    :style="$label_style ?? null"
    class="{{ $label_class }}"
>
    {{ $label }}
</x-form-label>

It's not a big difference but it's worth noting the attributes are still merged using that syntax.

Personally, I like the "content" to be passed via $slot because it feels more natural than passing it as an attribute but either way works for me.

Copy link
Member Author

Choose a reason for hiding this comment

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

That gives me Undefined variable $label

Copy link
Member Author

Choose a reason for hiding this comment

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

When I swap it for {{ $slot }}, it works, but for such a simple blade, I'm not really sure how that helps us.

Copy link
Collaborator

Choose a reason for hiding this comment

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

$slot feels more natural to me in this scenario but either way works.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, but that screws up the flexibility I just built into the checkboxes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gotcha. I hadn't gotten that far into my review 😅

</label>

61 changes: 61 additions & 0 deletions resources/views/blade/form-row.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!-- form-row blade component -->
@props([
'errors',
'label',
'name' => null,
'help_text' => null,
'label_style' => null,
'label_class' => 'col-md-3 col-sm-12 col-xs-12',
'div_style' => null,
'input_div_class' => 'col-md-8 col-sm-12',
'input_style' => null,
'item' => null,
'type' => 'text',
'placeholder' => null,
'maxlength' => 191,
])

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

<x-form-label
:$label
:for="$name"
:style="$label_style ?? null"
class="{{ $label_class }}"
/>

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

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

<x-dynamic-component
:component="'input.'.$type"
:aria-label="$name"
:$name
:$placeholder
:$input_style
:$item
:id="$name"
:required="Helper::checkIfRequired($item, $name)"
:value="old($name, $item->{$name})"
:$type
:$maxlength

/>

@error($name)
<span class="alert-msg" role="alert-msg">
<i class="fas fa-times" aria-hidden="true"></i>
{{ $message }}
</span>
@enderror

@if ($help_text)
<p class="help-block">
{!! $help_text !!}
</p>
@endif
</div>
</div>
8 changes: 8 additions & 0 deletions resources/views/blade/input/text.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@props([
'item' => null,
'field_name' => null,
'input_style' => null,
'required' => null,
])
<!-- input-text blade component -->
<input {{ $attributes->merge(['class' => 'form-control']) }} {{ ($input_style) ? $attributes->merge(['style' => $input_style]): '' }} {{ ($required ?? false) ? 'required' : '' }} />
77 changes: 44 additions & 33 deletions resources/views/locations/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@

{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/locations/table.name')])

<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
:$errors
name="name"
/>

<!-- parent -->
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/locations/table.parent'), 'fieldname' => 'parent_id'])
Expand All @@ -20,25 +27,33 @@
<!-- Company -->
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])

@include ('partials.forms.edit.phone')
@include ('partials.forms.edit.fax')
<!-- Phone -->
<x-form-row
:label="trans('general.phone')"
:$item
:$errors
name="phone"
type="tel"
/>

<!-- Currency -->
<div class="form-group {{ $errors->has('currency') ? ' has-error' : '' }}">
<label for="currency" class="col-md-3 control-label">
{{ trans('admin/locations/table.currency') }}
</label>
<div class="col-md-7">
<input class="form-control" style="width:100px" type="text" name="currency" aria-label="currency" id="currency" value="{{ old('currency', $item->currency) }}"{!! (Helper::checkIfRequired($item, 'currency')) ? ' required' : '' !!} maxlength="3" />
@error('currency')
<span class="alert-msg">
<x-icon type="x" />
{{ $message }}
</span>
@enderror
<!-- Fax -->
<x-form-row
:label="trans('general.fax')"
:$item
:$errors
name="fax"
type="tel"
/>

</div>
</div>
<!-- Currency -->
<x-form-row
:label="trans('admin/locations/table.currency')"
:$item
:$errors
name="currency"
maxlength="3"
input_div_class="col-md-2 col-sm-6 col-xs-6"
/>

@include ('partials.forms.edit.address')

Expand All @@ -61,22 +76,18 @@
@endif


@include ('partials.forms.edit.image-upload', ['image_path' => app('locations_upload_path')])
@include ('partials.forms.edit.image-upload', ['image_path' => app('locations_upload_path')])

<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-8">
<x-input.textarea
name="notes"
id="notes"
:value="old('notes', $item->notes)"
placeholder="{{ trans('general.placeholders.notes') }}"
aria-label="notes"
rows="5"
/>
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
:$errors
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>

@stop

114 changes: 57 additions & 57 deletions resources/views/manufacturers/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,75 +9,75 @@

{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/manufacturers/table.name')])

<!-- Name -->
<x-form-row
:label="trans('admin/manufacturers/table.name')"
:$item
:$errors
name="name"
/>

<!-- URL -->
<div class="form-group {{ $errors->has('url') ? ' has-error' : '' }}">
<label for="url" class="col-md-3 control-label">{{ trans('general.url') }}
</label>
<div class="col-md-6">
<input class="form-control" type="text" name="url" id="url" value="{{ old('url', $item->url) }}" />
{!! $errors->first('url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('general.url')"
:$item
:$errors
name="url"
type="url"
/>

<!-- Support URL -->
<div class="form-group {{ $errors->has('support_url') ? ' has-error' : '' }}">
<label for="support_url" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_url') }}
</label>
<div class="col-md-6">
<input class="form-control" type="url" name="support_url" id="support_url" value="{{ old('support_url', $item->support_url) }}" />
{!! $errors->first('support_url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.support_url')"
:$item
:$errors
name="support_url"
type="url"
/>

<!-- Warranty Lookup URL -->
<div class="form-group {{ $errors->has('warranty_lookup_url') ? ' has-error' : '' }}">
<label for="support_url" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.warranty_lookup_url') }}
</label>
<div class="col-md-6">
<input class="form-control" type="url" name="warranty_lookup_url" id="warranty_lookup_url" value="{{ old('warranty_lookup_url', $item->warranty_lookup_url) }}" />
<p class="help-block">{!! trans('admin/manufacturers/message.support_url_help') !!}</p>
{!! $errors->first('warranty_lookup_url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.warranty_lookup_url')"
:$item
:$errors
help_text="{!! trans('admin/manufacturers/message.support_url_help') !!}"
name="warranty_lookup_url"
type="url"
/>

<!-- Support Phone -->
<div class="form-group {{ $errors->has('support_phone') ? ' has-error' : '' }}">
<label for="support_phone" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_phone') }}
</label>
<div class="col-md-6">
<input class="form-control" type="text" name="support_phone" id="support_phone" value="{{ old('support_phone', $item->support_phone) }}" />
{!! $errors->first('support_phone', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.support_phone')"
:$item
:$errors
name="support_phone"
type="tel"
/>

<!-- Support Email -->
<div class="form-group {{ $errors->has('support_email') ? ' has-error' : '' }}">
<label for="support_email" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_email') }}
</label>
<div class="col-md-6">
<input class="form-control" type="email" name="support_email" id="support_email" value="{{ old('support_email', $item->support_email) }}" />
{!! $errors->first('support_email', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.support_email')"
:$item
:$errors
name="support_email"
type="email"
input_div_class="col-md-6 col-sm-12 col-xs-12"
/>

@include ('partials.forms.edit.image-upload', ['image_path' => app('manufacturers_upload_path')])

<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-8">
<x-input.textarea
name="notes"
id="notes"
:value="old('notes', $item->notes)"
placeholder="{{ trans('general.placeholders.notes') }}"
aria-label="notes"
rows="5"
/>
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload', ['image_path' => app('manufacturers_upload_path')])

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


@stop
Loading
Loading