fields now properly enable/disable where applicable
This commit is contained in:
parent
23949b86b4
commit
f0aec10d20
@ -58,29 +58,32 @@
|
|||||||
<x-input-label for="habit_type" value="Habit Type"></x-input-label>
|
<x-input-label for="habit_type" value="Habit Type"></x-input-label>
|
||||||
<div class="flex items-center mb-1 mt-1">
|
<div class="flex items-center mb-1 mt-1">
|
||||||
|
|
||||||
<!-- Radio button: todo-->
|
<!-- Radio button: do-->
|
||||||
<input id="habit-type-1" type="radio" value="todo" name="type"
|
<input id="habit-type-1" type="radio" value="todo" name="type"
|
||||||
onclick="toggleHabitValueSuffix(true)" checked
|
onclick="toggleHabitValueSuffix(true)" @if($habit->type === 'todo') checked
|
||||||
|
@elseif(!isset($habit->type)) checked @endif
|
||||||
class="w-4 h-4 text-blue-600 bg-gray-50 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
class="w-4 h-4 text-blue-600 bg-gray-50 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
||||||
<label for="habit-type-1" class="ml-2">Todo</label>
|
<label for="habit-type-1" class="ml-2">To do</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Radio button: value-->
|
<!-- Radio button: value-->
|
||||||
<div class="flex items-center mb-1">
|
<div class="flex items-center mb-1">
|
||||||
<input id="habit-type-2" type="radio" value="value" name="type"
|
<input id="habit-type-2" type="radio" value="value" name="type"
|
||||||
onclick="toggleHabitValueSuffix(false)"
|
onclick="toggleHabitValueSuffix(false)" @if($habit->type === 'value') checked @endif
|
||||||
class="w-4 h-4 text-blue-600 bg-gray-50 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
class="w-4 h-4 text-blue-600 bg-gray-50 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
||||||
<label for="habit-type-2" class="ml-2 ">Amount and suffix</label>
|
<label for="habit-type-2" class="ml-2 ">Amount and suffix</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Value / Suffix -->
|
<!-- Suffix -->
|
||||||
<x-input-label for="value" value="Suffix" class="mt-4"
|
<x-input-label for="value" value="Suffix" class="mt-4"
|
||||||
id="habit-suffix-label"/>
|
id="habit-suffix-label"/>
|
||||||
|
|
||||||
<x-text-input id="habit-suffix-name" class="inline-block mt-1 disabled:opacity-50 w-1/2"
|
<x-text-input id="habit-suffix-name"
|
||||||
type="text" name="suffix" disabled required
|
class="inline-block mt-1 disabled:opacity-50 w-1/2"
|
||||||
|
type="text" name="suffix"
|
||||||
placeholder="minutes"
|
placeholder="minutes"
|
||||||
:value="old('suffix', isset($habit->suffix) ? $habit->suffix : '')"
|
:value="old('suffix', isset($habit->suffix) ? $habit->suffix : '')"
|
||||||
|
:disabled="!isset($habit->type) || $habit->type === 'todo' ? true : false"
|
||||||
autocomplete="suffix"/>
|
autocomplete="suffix"/>
|
||||||
<x-input-error :messages="$errors->get('suffix')" class="mt-2"/>
|
<x-input-error :messages="$errors->get('suffix')" class="mt-2"/>
|
||||||
</div>
|
</div>
|
||||||
@ -90,17 +93,16 @@ class="w-4 h-4 text-blue-600 bg-gray-50 border-gray-300 focus:ring-blue-500 dark
|
|||||||
<!-- Schedule -->
|
<!-- Schedule -->
|
||||||
<div class="">
|
<div class="">
|
||||||
<x-input-label for="schedule-value" value="Schedule Recurrence"></x-input-label>
|
<x-input-label for="schedule-value" value="Schedule Recurrence"></x-input-label>
|
||||||
<div class="text-sm my-1 text-gray-700 mr-20">
|
<div class="text-sm my-1 text-gray-700">
|
||||||
The recurrence value determines how often you will be inquired about this habit.
|
The recurrence value determines how often you will be inquired about this habit.
|
||||||
Note: this is
|
Note: this is different from setting a goal. Set to 0 to disable inquiries.
|
||||||
different from setting a goal.
|
|
||||||
</div>
|
</div>
|
||||||
<div class="inline-block mt-4 pr-1">
|
<div class="inline-block mt-4 pr-1">
|
||||||
Every
|
Every
|
||||||
</div>
|
</div>
|
||||||
<x-text-input id="schedule-value" class="inline-block mt-1 w-20" type="number"
|
<x-text-input id="schedule-value" class="inline-block mt-1 w-20" type="number"
|
||||||
placeholder="" min="0" value="1" name="schedule_value"
|
placeholder="" min="0" name="schedule_value"
|
||||||
:value="old('schedule_value', isset($habit->schedule_value) ? $habit->schedule_value : '0')"
|
:value="old('schedule_value', isset($habit->schedule_value) ? $habit->schedule_value : '1')"
|
||||||
/>
|
/>
|
||||||
<x-input-error :messages="$errors->get('schedule_value')" class="mt-2"/>
|
<x-input-error :messages="$errors->get('schedule_value')" class="mt-2"/>
|
||||||
|
|
||||||
@ -154,7 +156,7 @@ class="w-4 h-4 text-blue-600 bg-gray-50 border-gray-300 focus:ring-blue-500 dark
|
|||||||
</div>
|
</div>
|
||||||
<hr class="mt-4">
|
<hr class="mt-4">
|
||||||
|
|
||||||
<!-- goal schedule -->
|
<!-- goal schedule items -->
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<x-input-label for="goal-schedule-unit" value="Goal Recurrence"/>
|
<x-input-label for="goal-schedule-unit" value="Goal Recurrence"/>
|
||||||
<div class="inline-block mt-1 pr-1">
|
<div class="inline-block mt-1 pr-1">
|
||||||
@ -162,15 +164,17 @@ class="w-4 h-4 text-blue-600 bg-gray-50 border-gray-300 focus:ring-blue-500 dark
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<x-text-input id="goal-schedule-amount" class="inline-block mt-1 w-20" type="number"
|
<x-text-input id="goal-schedule-amount" class="inline-block mt-1 w-20" type="number"
|
||||||
:value="old('goal_value', isset($habit->goal_value) ? $habit->goal_value : '0')"
|
:value="old('goal_value', isset($habit->goal_value) ? $habit->goal_value : '1')"
|
||||||
placeholder="" min="0" disabled
|
placeholder="" min="1" required name="goal_value"
|
||||||
required name="goal_value"/>
|
:disabled="!isset($habit->goal_type) || $habit->goal_type !== 'custom' ? true : false"
|
||||||
|
/>
|
||||||
|
|
||||||
<x-input-error :messages="$errors->get('goal_value')" class="mt-2"/>
|
<x-input-error :messages="$errors->get('goal_value')" class="mt-2"/>
|
||||||
|
|
||||||
|
<!-- Select box -->
|
||||||
<select name="goal_unit" id="goal-schedule-unit"
|
<select name="goal_unit" id="goal-schedule-unit"
|
||||||
disabled required
|
required
|
||||||
|
@if(!isset($habit->goal_type) || $habit->goal_type !== 'custom') disabled @endif
|
||||||
class="inline-block w-fit border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm disabled:opacity-50">
|
class="inline-block w-fit border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm disabled:opacity-50">
|
||||||
@foreach(['day', 'week', 'month'] as $time_unit)
|
@foreach(['day', 'week', 'month'] as $time_unit)
|
||||||
<option value="{{$time_unit}}"
|
<option value="{{$time_unit}}"
|
||||||
@ -183,8 +187,10 @@ class="inline-block w-fit border-gray-300 dark:border-gray-700 dark:bg-gray-900
|
|||||||
starting
|
starting
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- goal date input -->
|
||||||
<x-text-input type="date" class="inline-block mt-1" name="goal_start" id="goal-start"
|
<x-text-input type="date" class="inline-block mt-1" name="goal_start" id="goal-start"
|
||||||
:value="old('goal_start', isset($habit->goal_start) ? $habit->goal_start : $today)" disabled required/>
|
:value="old('goal_start', isset($habit->goal_start) ? $habit->goal_start : $today)"
|
||||||
|
:disabled="!isset($habit->goal_type) || $habit->goal_type !== 'custom' ? true : false"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</x-pagecard>
|
</x-pagecard>
|
||||||
|
@ -11,13 +11,13 @@
|
|||||||
{{-- </div>--}}
|
{{-- </div>--}}
|
||||||
|
|
||||||
<!-- Navigation Links -->
|
<!-- Navigation Links -->
|
||||||
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
|
<div class="hidden space-x-6 sm:-my-px sm:ml-10 sm:flex">
|
||||||
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||||
{{ __('Dashboard') }}
|
{{ __('Dashboard') }}
|
||||||
</x-nav-link>
|
</x-nav-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
|
<div class="hidden space-x-6 sm:-my-px sm:ml-10 sm:flex">
|
||||||
<x-nav-link :href="route('habits.index')" :active="request()->routeIs('habits.*')">
|
<x-nav-link :href="route('habits.index')" :active="request()->routeIs('habits.*')">
|
||||||
{{ __('Habits') }}
|
{{ __('Habits') }}
|
||||||
</x-nav-link>
|
</x-nav-link>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user