disable shirt size edit for user in settings if got shirt
This commit is contained in:
parent
89d68a56e7
commit
ffa531f311
|
@ -193,6 +193,7 @@ Renders a select element wrapped in a DIV with mb-3.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<select id="{{ name }}" name="{{ name }}"
|
<select id="{{ name }}" name="{{ name }}"
|
||||||
class="form-control {%- if opt.class is defined %} {{ opt.class }}{% endif %}"
|
class="form-control {%- if opt.class is defined %} {{ opt.class }}{% endif %}"
|
||||||
|
{%- if opt.disabled|default(false) %} disabled{%- endif -%}
|
||||||
{%- if opt.required|default(false) %} required{%- endif -%}>
|
{%- if opt.required|default(false) %} required{%- endif -%}>
|
||||||
{%- if opt.default_option is defined %}
|
{%- if opt.default_option is defined %}
|
||||||
<option value="">{{ opt.default_option }}</option>
|
<option value="">{{ opt.default_option }}</option>
|
||||||
|
|
|
@ -154,6 +154,7 @@
|
||||||
'required': isTShirtSizeRequired,
|
'required': isTShirtSizeRequired,
|
||||||
'required_icon': isTShirtSizeRequired,
|
'required_icon': isTShirtSizeRequired,
|
||||||
'default_option': __('form.select_placeholder'),
|
'default_option': __('form.select_placeholder'),
|
||||||
|
'disabled': user.state.got_shirt,
|
||||||
}) }}
|
}) }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -86,7 +86,7 @@ class UserWorkLogController extends BaseController
|
||||||
$worklog->save();
|
$worklog->save();
|
||||||
|
|
||||||
$this->log->info(
|
$this->log->info(
|
||||||
'Added worklog for {name} ({id}) at {time} about {hours}h: {text}',
|
'Added worklog for {name} ({id}) at {time} spanning {hours}h: {text}',
|
||||||
[
|
[
|
||||||
'name' => $user->name,
|
'name' => $user->name,
|
||||||
'id' => $user->id,
|
'id' => $user->id,
|
||||||
|
@ -132,7 +132,7 @@ class UserWorkLogController extends BaseController
|
||||||
$worklog->delete();
|
$worklog->delete();
|
||||||
|
|
||||||
$this->log->info(
|
$this->log->info(
|
||||||
'Deleted worklog for {name} ({id}) at {time} about {hours}h: {text}',
|
'Deleted worklog for {name} ({id}) at {time} spanning {hours}h: {text}',
|
||||||
[
|
[
|
||||||
'name' => $worklog->user->name,
|
'name' => $worklog->user->name,
|
||||||
'id' => $worklog->user->id,
|
'id' => $worklog->user->id,
|
||||||
|
|
|
@ -110,6 +110,7 @@ class SettingsController extends BaseController
|
||||||
if (
|
if (
|
||||||
$goodie_tshirt
|
$goodie_tshirt
|
||||||
&& isset(config('tshirt_sizes')[$data['shirt_size']])
|
&& isset(config('tshirt_sizes')[$data['shirt_size']])
|
||||||
|
&& !$user->state->got_shirt
|
||||||
) {
|
) {
|
||||||
$user->personalData->shirt_size = $data['shirt_size'];
|
$user->personalData->shirt_size = $data['shirt_size'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue