Skip to content

Commit 04bdba9

Browse files
authored
Merge pull request #107 from satoblacksato/master
Changes for bulmaCss
2 parents 950ac03 + 9153557 commit 04bdba9

11 files changed

Lines changed: 238 additions & 1 deletion

config.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Set the HTML theme for the components
77
* like alerts, form fields, menus, etc.
88
*/
9-
'theme' => 'bootstrap4',
9+
'theme' => 'bootstrap4',
1010

1111
/*
1212
* Set the folder to store the custom templates
@@ -97,6 +97,33 @@
9797
'checkbox' => 'form-check-input',
9898
'error' => 'is-invalid'
9999
],
100+
],
101+
/**
102+
* configuration for BulmaCss
103+
*/
104+
'bulma' => [
105+
/*
106+
* Set a specific HTML template for a field type if the
107+
* type is not set, the default template will be used
108+
*/
109+
'field_templates' => [
110+
// type => template
111+
'checkbox' => 'checkbox',
112+
'checkboxes' => 'collections',
113+
'radios' => 'collections',
114+
'select'=>'selects',
115+
116+
],
117+
/*
118+
* Set the default classes for each field type
119+
*/
120+
'field_classes' => [
121+
// type => class or classes
122+
'textarea'=>'textarea',
123+
'default' => 'input',
124+
'checkbox' => 'checkbox',
125+
'error' => 'is-danger'
126+
],
100127
]
101128
]
102129

themes/bulma/alert.blade.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@foreach ($messages as $msg)
2+
<article class="message is-{{ $msg['type'] }}">
3+
<div class="message-header">
4+
<p> <strong>Alerta!!</strong></p>
5+
<button type="button" onclick="this.parentElement.parentElement.style.display = 'none';" class="delete" aria-label="delete"></button>
6+
</div>
7+
<div class="message-body">
8+
<p> <strong>{{ $msg['message'] }}</strong></p>
9+
@if (!empty ($msg['details']))
10+
{{ $msg['details'] }}
11+
@endif
12+
{!! $msg['html'] !!}
13+
@if (!empty ($msg['items']))
14+
<ul>
15+
@foreach ($msg['items'] as $item)
16+
<li>{{ $item }}</li>
17+
@endforeach
18+
</ul>
19+
@endif
20+
@if ( ! empty ($msg['buttons']))
21+
<div class="is-right-to-left">
22+
@foreach ($msg['buttons'] as $btn)
23+
<a class="button is-{{ $btn['class'] }}" href="{{ $btn['url'] }}">{{ $btn['text'] }}</a>
24+
@endforeach
25+
</div>
26+
@endif
27+
</div>
28+
</article>
29+
@endforeach
30+
31+
32+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div id="field_{{ $id }}" class="field">
2+
<label class="label" for="{{ $id }}"{!! Html::classes(['text-danger' => $hasErrors]) !!}>
3+
{{ $label }}
4+
@if ($required)
5+
<span class="tag is-success">Required</span>
6+
@endif
7+
</label>
8+
<div class="field-body">
9+
<div class="field">
10+
<div class="control">
11+
{!! $input !!}
12+
</div>
13+
<p class="help is-danger">
14+
@foreach ($errors as $error)
15+
{{ $error }}
16+
@endforeach
17+
</p>
18+
</div>
19+
</div>
20+
</div>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div id="field_{{ $id }}" class="field">
2+
<label class="label" for="{{ $id }}"{!! Html::classes(['text-danger' => $hasErrors]) !!}>
3+
{{ $label }}
4+
@if ($required)
5+
<span class="tag is-success">Required</span>
6+
@endif
7+
</label>
8+
<div class="field-body">
9+
<div class="field">
10+
<div class="control">
11+
{!! $input !!}
12+
</div>
13+
<p class="help is-danger">
14+
@foreach ($errors as $error)
15+
{{ $error }}
16+
@endforeach
17+
</p>
18+
</div>
19+
</div>
20+
</div>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div id="field_{{ $id }}" class="field">
2+
<label class="label" for="{{ $id }}"{!! Html::classes(['text-danger' => $hasErrors]) !!}>
3+
{{ $label }}
4+
@if ($required)
5+
<span class="tag is-success">Required</span>
6+
@endif
7+
</label>
8+
<div class="field-body">
9+
<div class="field">
10+
<div class="control">
11+
{!! $input !!}
12+
</div>
13+
<p class="help is-danger">
14+
@foreach ($errors as $error)
15+
{{ $error }}
16+
@endforeach
17+
</p>
18+
</div>
19+
</div>
20+
</div>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div id="field_{{ $id }}" class="field">
2+
<label class="label" for="{{ $id }}"{!! Html::classes(['text-danger' => $hasErrors]) !!}>
3+
{{ $label }}
4+
@if ($required)
5+
<span class="tag is-success">Required</span>
6+
@endif
7+
</label>
8+
<div class="field-body">
9+
<div class="field">
10+
<div class="select is-fullwidth">
11+
{!! $input !!}
12+
</div>
13+
<p class="help is-danger">
14+
@foreach ($errors as $error)
15+
{{ $error }}
16+
@endforeach
17+
</p>
18+
</div>
19+
</div>
20+
</div>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@php
2+
$classes = 'form-check-input';
3+
if ($hasErrors) {
4+
$classes .= ' is-invalid';
5+
}
6+
@endphp
7+
<div class="control">
8+
@foreach($checkboxes as $checkbox)
9+
{!! Form::checkbox(
10+
$checkbox['name'],
11+
$checkbox['value'],
12+
$checkbox['checked'],
13+
['class' => $classes, 'id' => $checkbox['id']]
14+
) !!}
15+
<label class="checkbox" for="{{ $checkbox['id'] }}">
16+
{{ $checkbox['label'] }}
17+
</label>
18+
@endforeach
19+
</div>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@php
2+
$classes = 'form-check-input';
3+
if ($hasErrors) {
4+
$classes .= ' is-invalid';
5+
}
6+
@endphp
7+
@foreach($checkboxes as $checkbox)
8+
<div class="control">
9+
{!! Form::checkbox(
10+
$checkbox['name'],
11+
$checkbox['value'],
12+
$checkbox['checked'],
13+
['class' => $classes, 'id' => $checkbox['id']]
14+
) !!}
15+
<label class="checkbox" for="{{ $checkbox['id'] }}">
16+
{{ $checkbox['label'] }}
17+
</label>
18+
</div>
19+
@endforeach
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@php
2+
$classes = 'form-check-input';
3+
if ($hasErrors) {
4+
$classes .= ' is-invalid';
5+
}
6+
@endphp
7+
<div class="control">
8+
@foreach($radios as $radio)
9+
10+
{!! Form::radio(
11+
$radio['name'],
12+
$radio['value'],
13+
$radio['selected'],
14+
['class' => $classes, 'id' => $radio['id']]) !!}
15+
<label class="radio" for="{{ $radio['id'] }}">
16+
{{ $radio['label'] }}
17+
</label>
18+
19+
@endforeach
20+
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@php
2+
$classes = 'form-check-input';
3+
if ($hasErrors) {
4+
$classes .= ' is-invalid';
5+
}
6+
@endphp
7+
@foreach($radios as $radio)
8+
<div class="control">
9+
{!! Form::radio(
10+
$radio['name'],
11+
$radio['value'],
12+
$radio['selected'],
13+
['class' => $classes, 'id' => $radio['id']]) !!}
14+
<label class="radio" for="{{ $radio['id'] }}">
15+
{{ $radio['label'] }}
16+
</label>
17+
</div>
18+
@endforeach

0 commit comments

Comments
 (0)