Skip to content

Commit

Permalink
Fix problems with text inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
horcsinbalint committed Mar 3, 2024
1 parent ac60be6 commit a5616ec
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 79 deletions.
4 changes: 3 additions & 1 deletion app/View/Components/Input/Textarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
class Textarea extends Input
{
public $helper;
public $withoutLabel;

/**
* Create a new textarea input instance.
*
* @param string $helper helper message
* @return void
*/
public function __construct($id, $helper = null, $text = null, $s = 12, $m = null, $l = null, $xl = null, $onlyInput = false)
public function __construct($id, $withoutLabel = false, $text = null, $s = 12, $m = null, $l = null, $xl = null, $onlyInput = false, $helper = null)
{
parent::__construct($id, $text, $s, $m, $l, $xl, $onlyInput);
$this->helper = $helper;
$this->withoutLabel = $withoutLabel;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<x-input.textarea id="note"
text="Megjegyzés"
helper="A megjegyzéseket a felvételiző nem látja, de azok láthatóak a többi felvételiztető számára (akár más műhelyekből is)."
:value="$user->application->note"/>
>{{ $user->application->note }}</x-input.textarea>
</div>
<x-input.button floating class="right" icon="save"/>
</div>
Expand Down
13 changes: 6 additions & 7 deletions resources/views/auth/application/questions.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,22 @@
@endif
@endforeach
<div class="input-field" style="margin: 0; padding-left:35px">
<x-input.text only-input id="question_1_other"
:value="$user->application->question_1_custom" name="question_1[]"
without-label placeholder="egyéb/bővebben..."/>
<x-input.textarea only-input id="question_1_other" name="question_1[]"
without-label placeholder="egyéb/bővebben...">{{$user->application->question_1_custom}}</x-input.textarea>
</div>
</div>
<x-input.textarea id="question_2" text="Miért kíván a Collegium tagja lenni?"
helper="≈300-500 karakter" :value="$user->application->question_2"/>
helper="≈300-500 karakter">{{$user->application->question_2}}</x-input.textarea>
<x-input.textarea id="question_3"
text="Tervez-e tovább tanulni a diplomája megszerzése után? Milyen tervei vannak az egyetem után?"
:value="$user->application->question_3"/>
>{{$user->application->question_3}}</x-input.textarea>
<x-input.textarea id="question_4"
text="Részt vett-e közéleti tevékenységben? Ha igen, röviden jellemezze!"
helper="Pl. diákönkormányzati tevékenység, önkéntesség, szervezeti tagság. (nem kötelező)"
:value="$user->application->question_4"/>
>{{$user->application->question_4}}</x-input.textarea>
<x-input.textarea id="present"
text="Amennyiben nem tud jelen lenni a felvételi teljes ideje alatt (vasárnap-szerda), kérjük itt indoklással jelezze!"
:value="$user->application->present" helper="Változás esetén értesítse a titkárságot!"/>
helper="Változás esetén értesítse a titkárságot!">{{$user->application->present}}</x-input.textarea>
<x-input.checkbox id="accommodation"
text="Igényel-e szállást a felvételi idejére?"
:checked="$user->application->accommodation"/>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/passwords/reset.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="card-content">
<div class="card-title"> @lang('passwords.resetpwd')</div>
<div class="row">
<x-input.text id="email" text="registration.email" type="email" :value="$email" required autocomplete="email" autofocus/>
<x-input.textarea id="email" text="registration.email" type="email" required autocomplete="email" autofocus>{{ $email }}</x-input.textarea>
<x-input.text id="password" text="registration.password" type="password" required autocomplete="new-password"/>
<x-input.text id="confirmpwd" text="registration.confirmpwd" name="password_confirmation" type="password" required autocomplete="new-password"/>
</div>
Expand Down
15 changes: 10 additions & 5 deletions resources/views/components/input/textarea.blade.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
@if(!$onlyInput)
@if(!$onlyInput && !$attributes->get('hidden'))
<div class="input-field col s{{$s}} m{{$m}} l{{$l}} xl{{$xl}}">
@endif
<textarea
id="{{$id}}"
class="materialize-textarea validate @error($id) invalid @enderror"
{{-- Default values + other provided attributes --}}
{{$attributes->whereDoesntStartWith('value')->merge([
'name' => $id,
'class' => "materialize-textarea validate"
])}}>{{old($id) ?? $attributes->get('value')}}</textarea>
'type' => 'text',
'name' => $id
])}}
>{{ $slot }}</textarea>
@if(!$attributes->get('hidden') && !$withoutLabel)
<label for="{{$id}}">{{$label}}</label>
@endif
@if($helper ?? null)
<span class="helper-text">{{ $helper }}</span>
@endif
@error($id)
<span class="helper-text" data-error="{{ $message }}"></span>
@enderror
@if(!$onlyInput)
@if(!$onlyInput && !$attributes->get('hidden'))
</div>
@endif
2 changes: 1 addition & 1 deletion resources/views/localizations/manage.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@can('approve', $contribution);
<form method="POST" action="{{ route('localizations.delete') }}">
@csrf
<x-input.text type="number" id="id" :value="$contribution->id" hidden/>
<x-input.text type="number" id="id" :value="$contribution->id" hidden />
<x-input.button floating class="red" icon="clear" />
</form>
@endcan
Expand Down
16 changes: 8 additions & 8 deletions resources/views/network/routers/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
<div class="card-content">
<span class="card-title">Új router</span>
<div class="row">
<x-input.text s="6" type="text" text="router.ip" id="ip" maxlength="15" required/>
<x-input.textarea s="6" type="text" text="router.ip" id="ip" maxlength="15" required/>
<x-input.text s="6" type="number" text="router.room" id="room" min="1" max="500" required/>
</div>
<div class="row">
<x-input.text s="4" type="text" text="router.port" id="port"/>
<x-input.text s="4" type="text" text="router.type" id="type"/>
<x-input.text s="4" type="text" text="router.serial_number" id="serial_number"/>
<x-input.textarea s="4" type="text" text="router.port" id="port"/>
<x-input.textarea s="4" type="text" text="router.type" id="type"/>
<x-input.textarea s="4" type="text" text="router.serial_number" id="serial_number"/>
</div>
<div><p>MAC cím</p></div>
<div class="row">
<x-input.text s="4" type="text" text="WAN" id="mac_wan"/>
<x-input.text s="4" type="text" text="2G/LAN" id="mac_2g_lan"/>
<x-input.text s="4" type="text" text="5G" id="mac_5g"/>
<x-input.textarea s="4" type="text" text="WAN" id="mac_wan"/>
<x-input.textarea s="4" type="text" text="2G/LAN" id="mac_2g_lan"/>
<x-input.textarea s="4" type="text" text="5G" id="mac_5g"/>
</div>
<div class="row">
<x-input.text type="text" id="comment" text="general.comment" maxlength="255"/>
<x-input.textarea type="text" id="comment" text="general.comment" maxlength="255"/>
</div>
<div class="row">
<x-input.text s="6" type="date" id="date_of_acquisition" text="router.date_of_acquisition"/>
Expand Down
19 changes: 10 additions & 9 deletions resources/views/network/routers/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@
<div class="card-content">
<span class="card-title">Módosítás</span>
<div class="row">
<x-input.text s="6" type="text" text="router.ip" id="ip" value="{{ $router->ip }}" maxlength="15" required/>
<x-input.text s="6" type="number" text="router.room" id="room" value="{{ $router->room }}" min="1" max="500" required/>
<x-input.textarea s="6" type="text" text="router.ip" id="ip" maxlength="15" required>{{ $router->ip }}</x-input.textarea>
<x-input.text s="6" type="number" text="router.room" id="room" min="1" max="500" :value="$router->room" required>
</x-input.text>
</div>
<div class="row">
<x-input.text s="4" type="text" text="router.port" id="port" value="{{ $router->port }}"/>
<x-input.text s="4" type="text" text="router.type" id="type" value="{{ $router->type }}"/>
<x-input.text s="4" type="text" text="router.serial_number" id="serial_number" value="{{ $router->serial_number }}"/>
<x-input.textarea s="4" type="text" text="router.port" id="port">{{ $router->port }}</x-input.textarea>
<x-input.textarea s="4" type="text" text="router.type" id="type">{{ $router->type }}</x-input.textarea>
<x-input.textarea s="4" type="text" text="router.serial_number" id="serial_number">{{ $router->serial_number }}</x-input.textarea>
</div>
<div><p>MAC cím</p></div>
<div class="row">
<x-input.text s="4" type="text" text="WAN" id="mac_WAN" value="{{ $router->mac_WAN }}"/>
<x-input.text s="4" type="text" text="2G/LAN" id="mac_2G_LAN" value="{{ $router->mac_2G_LAN }}"/>
<x-input.text s="4" type="text" text="5G" id="mac_5G" value="{{ $router->mac_5G }}"/>
<x-input.textarea s="4" type="text" text="WAN" id="mac_WAN">{{ $router->mac_WAN }}</x-input.textarea>
<x-input.textarea s="4" type="text" text="2G/LAN" id="mac_2G_LAN">{{ $router->mac_2G_LAN }}</x-input.textarea>
<x-input.textarea s="4" type="text" text="5G" id="mac_5G">{{ $router->mac_5G }}</x-input.textarea>
</div>
<div class="row">
<x-input.text type="text" id="comment" text="general.comment" value="{{ $router->comment }}" maxlength="255"/>
<x-input.textarea type="text" id="comment" text="general.comment" maxlength="255">{{ $router->comment }}</x-input.textarea>
</div>
<div class="row">
<x-input.datepicker s="6" id="date_of_acquisition" text="router.date_of_acquisition" value="{{ $router->date_of_acquisition }}"/>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/secretariat/evaluation-form/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
@csrf
<div class="row">
<input type="hidden" name="section" value="alfonso"/>
<x-input.text l=10 id="alfonso_note" :value="$evaluation?->alfonso_note"
text="Megjegyzés, helyesbítés, egyéni elbírálás"/>
<x-input.textarea l=10 id="alfonso_note"
text="Megjegyzés, helyesbítés, egyéni elbírálás">{{ $evaluation?->alfonso_note }}</x-input.textarea>
<x-input.button l=2 class="right" text="general.save"/>
</div>
</form>
Expand Down
12 changes: 5 additions & 7 deletions resources/views/secretariat/evaluation-form/course.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<div class="row course" id="course_{{$index}}" style="margin:0">
<x-input.text id="courses[{{$index}}][name]"
<x-input.textarea id="courses[{{$index}}][name]"
l=5
text="Kurzus neve"
value="{{ $value ? $value['name'] ?? '' : '' }}"
required />
<x-input.text id="courses[{{$index}}][code]{{ $index }}"
required >{{ $value ? $value['name'] ?? '' : '' }}</x-input.textarea>
<x-input.textarea id="courses[{{$index}}][code]{{ $index }}"
l=3
text="Kurzus kódja"
value="{{ $value ? $value['code'] ?? '' : '' }}"
required />
required >{{ $value ? $value['code'] ?? '' : '' }}</x-input.textarea>
<x-input.text id="courses[{{$index}}][grade]"
l=3 s=11
type="number"
min="1"
max="5"
text="Jegy"
value="{{ $value ? $value['grade'] ?? '' : '' }}"
:value="($value ? $value['grade'] ?? '' : '')"
helper="(ha ismert)" />
<x-input.button type="button" s="1" class="right red" floating icon="delete" onclick="removeCourse({{$index}})"/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
A Collegiumból elbocsátható, aki a Collegiumban felvett óráját nem teljesítette.
</blockquote>
<div class="row">
<x-input.text l=10 id="courses_note" :value="$evaluation?->courses_note" text="Megjegyzés, helyesbítés"/>
<x-input.textarea l=10 id="courses_note" text="Megjegyzés, helyesbítés">{{ $evaluation?->courses_note }}</x-input.textarea>
<x-input.button l=2 class="right" text="general.save" />
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@csrf
<div class="row">
<input type="hidden" name="section" value="feedback"/>
<x-input.textarea id="feedback" :value="$evaluation?->feedback" text="Visszajelzés..." style="height:100px" />
<x-input.textarea id="feedback" text="Visszajelzés..." style="height:100px" >{{$evaluation?->feedback}}</x-input.textarea>
<x-input.checkbox id="anonymous_feedback" s=10 text="Névtelen visszajelzés" />
<x-input.button s=2 class="right" text="Küldés" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
@csrf
<div class="row">
<input type="hidden" name="section" value="general_assembly"/>
<x-input.text l=10 id="general_assembly_note" :value="$evaluation?->general_assembly_note"
text="Megjegyzés, helyesbítés, igazolt hiányzás"/>
<x-input.textarea l=10 id="general_assembly_note"
text="Megjegyzés, helyesbítés, igazolt hiányzás">{{ $evaluation?->general_assembly_note }}</x-input.textarea>
<x-input.button l=2 class="right" text="general.save"/>
</div>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
:value="$evaluation?->next_status"
:formatter="function($o) { return __('user.'.$o); }"
placeholder="Tagsági státusz"/>
<x-input.text xl=6 id="next_status_note"
:value="$evaluation?->next_status_note"
<x-input.textarea xl=6 id="next_status_note"
placeholder="Rövid megjegyzés: BB/Erasmus/két képzés között/stb."
maxlength="20"/>
maxlength="20">{{ $evaluation?->next_status_note }}</x-input.textarea>
<x-input.checkbox s=12 id="will_write_request"
:checked="$evaluation?->will_write_request ?? false"
text="Írok kérvényt." />
Expand Down

0 comments on commit a5616ec

Please sign in to comment.