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

[Feature] VC blocks html #7

Open
wants to merge 2 commits into
base: master
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
1 change: 1 addition & 0 deletions resources/lang/en/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'image-simple' => [
'name' => 'Image',
'crud_image' => 'Image',
'crud_image_alt' => 'Alt attribut',
],
'separator' => [
'name' => 'Separator',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/fr/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'image-simple' => [
'name' => 'Image',
'crud_image' => 'Image',
'crud_image_alt' => 'Attribut Alt',
],
'separator' => [
'name' => 'Séparateur',
Expand Down
4 changes: 2 additions & 2 deletions resources/views/templates/Article/front.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
) = $content;
@endphp

<div class="block-article">
<article class="vc-block vc-block-article">
@if (!empty($title))
<h3 class="title">
{{ $title }}
Expand All @@ -26,4 +26,4 @@
{!! $htmlContent !!}
</div>
@endif
</div>
</article>
2 changes: 1 addition & 1 deletion resources/views/templates/ImageMultiple/front.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}
$images = array_shift($content);
@endphp
<div class="block-images">
<div class="vc-block vc-block-images">
@foreach($images as $image)
<img src="{{ asset('storage/'.$image) }}" />
@endforeach
Expand Down
7 changes: 7 additions & 0 deletions resources/views/templates/ImageSimple/crud.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
<div class="form-group w-1/2">
<input type="file" class="filepond js-visual-field js-image-uploader">
</div>
<div class="form-group mb-2 w-1/2">
<label class="block text-grey-darker text-sm font-bold mb-2" for="username">
{{ trans('nova-visual-composer::templates.'.$templateName.'.crud_image_alt') }}
</label>
<input class="js-visual-field w-full form-control form-input form-input-bordered"
type="text"/>
</div>
</div>
</div>
12 changes: 8 additions & 4 deletions resources/views/templates/ImageSimple/front.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
if (empty($content) || !is_array($content)) {
return;
}
$images = array_shift($content);
$image = array_shift($images);

list(
$image,
$altText,
) = $content;
@endphp
<div class="block-image">
<img src="{{ asset('storage/'.$image) }}" />

<div class="vc-block vc-block-image">
<img src="{{ asset('storage/'.$image[0]) }}" alt="{{ $altText ?? '' }}" />
</div>
2 changes: 1 addition & 1 deletion resources/views/templates/Separator/front.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="block-separator"></div>
<div class="vc-block vc-block-separator"></div>
2 changes: 1 addition & 1 deletion resources/views/templates/Title/front.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$title = array_shift($content);
@endphp
@if (!empty($title))
<div class="block-title">
<div class="vc-block vc-block-title">
<h3 class="title">
{{ $title }}
</h3>
Expand Down