Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool page improvements #622

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions resources/views/tools/tool/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@
@enderror
</div>

<div class="form-group form-check">
<input id="hidden" class="form-check-input" type="checkbox" name="hidden">
<label class="form-check-label" for="hidden">
Should the tool be hidden from regular users?
</label>
</div>

<button type="submit" class="btn btn-primary btn-block">Add Tool</button>
</form>
</div>
Expand Down
21 changes: 18 additions & 3 deletions resources/views/tools/tool/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="container">
@content('tools.tool.index', 'main')
<p>
To book a tool click on the <span style="color: #195905"><i class="far fa-calendar-alt" aria-hidden="true"></i></span> or name.<br>
To book a tool click on the <span class="text-primary"><i class="far fa-calendar-alt" aria-hidden="true"></i></span> or name.<br>
Use of some tools is restricted and needs an induction first.
</p>
@foreach ($tools as $tool)
Expand All @@ -17,6 +17,7 @@
<tr>
<th class="d-none d-md-table-cell">&nbsp;</th>
<th>Tool</th>
<th>Inducted</th>
<th>Status</th>
<th class="d-none d-md-table-cell">Cost per hour</th>
<th>Next booking</th>
Expand All @@ -27,9 +28,23 @@
@endif
@if (! $tool->isHidden() || \Auth::user()->can('tools.edit'))
<tr>
<td class="d-none d-md-table-cell" style="width:25px"><a href="{{ route('tools.bookings.index', $tool->getId()) }}"><span style="color: #195905"><i class="far fa-calendar-alt" aria-hidden="true"></i></span></a></td>
<td data-title="Tool"><a href="{{ route('tools.bookings.index', $tool->getId()) }}"><span class="d-md-none" style="color: #195905"><i class="far fa-calendar-alt" aria-hidden="true"></i>&nbsp;</span>{{ $tool->getDisplayName() }}</a></td>
<td class="d-none d-md-table-cell" style="width:25px"><a href="{{ route('tools.bookings.index', $tool->getId()) }}"><span class="text-primary"><i class="far fa-calendar-alt" aria-hidden="true"></i></span></a></td>
<td data-title="Tool"><a href="{{ route('tools.bookings.index', $tool->getId()) }}"><span class="d-md-none" class="text-primary"><i class="far fa-calendar-alt" aria-hidden="true"></i>&nbsp;</span>{{ $tool->getDisplayName() }}</a></td>
<td data-title="Inducted">
@if ($tool->isRestricted())
@can('tools.' . $tool->getPermissionName() . '.use')
<span class="text-primary" title="You are inducted on this tool."><i class="far fa-check" aria-hidden="true"></i></span>
@else
<span class="text-primary" title="Request an induction to use this tool."><i class="far fa-times-circle" aria-hidden="true"></i></span>
@endcan
@else
<span class="text-primary" title="No induction required."><i class="far fa-circle"aria-hidden="true"></i></span>
@endif
</td>
<td data-title="Status">
@if ($tool->isHidden())
<span class="text-primary" title="This tool is hidden for general users."><i class="fa fa-eye-slash" aria-hidden="true"></i></span>
@endif
{{ $tool->getStatusString() }}
@if ($tool->getStatus() == \HMS\Entities\Tools\ToolState::DISABLED && ! is_null($tool->getStatusText()))
<br>{{ $tool->getStatusText() }}
Expand Down