FEATURE #1446: add html code widget

This commit is contained in:
Michal Kváček
2016-02-15 12:19:54 +01:00
parent da3046c990
commit 043c842aef
9 changed files with 284 additions and 0 deletions
@@ -0,0 +1,20 @@
@extends('admin.layout')
@section('pageName', @trans('widgets/htmlCode.edit', ['name' => $widget->name]))
@section('content')
<h1>@lang('widgets/htmlCode.edit', ['name' => $widget->name])</h1>
<div class="row">
<div class="column large-8">
@include('admin.widgets.htmlCode.editForm')
</div>
<div class="column large-4">
<h3>@lang('widgets/htmlCode.preview')</h3>
@widgetPreview($widget)
</div>
</div>
@stop
@@ -0,0 +1,68 @@
@if (!isset($hideMessages))
@if (session('success'))
<div class="callout success">
{{ session('success') }}
</div>
@endif
@if (session('error'))
<div class="callout alert">
{{ session('error') }}
</div>
@endif
@endif
<form action="{{route('widgets.postEdit', ['id' => $widget->id])}}" method="POST">
{!! csrf_field() !!}
<label>
@lang('widgets/htmlCode.name')
<input type="text" name="name" value="{{$widget->name}}" placeholder="@lang('widgets/htmlCode.name')" />
@if (isset($errors) && $errors->has('name'))
<div class="callout alert">
{{ $errors->first('name') }}
</div>
@endif
</label>
<label>
@lang('widgets/htmlCode.description')
<input type="text" name="description" placeholder="@lang('widgets/htmlCode.description')"
value="{{$widget->description}}" />
@if (isset($errors) && $errors->has('description'))
<div class="callout alert">
{{ $errors->first('description') }}
</div>
@endif
</label>
<label>
@lang('widgets/htmlCode.containerClass')
<input type="text" name="containerClass" placeholder="@lang('widgets/htmlCode.containerClass')"
value="{{$widget->containerClass}}" />
@if (isset($errors) && $errors->has('containerClass'))
<div class="callout alert">
{{ $errors->first('description') }}
</div>
@endif
</label>
<label>
@lang('widgets/htmlCode.code')
<textarea rows="4" name="code" placeholder="@lang('widgets/htmlCode.code')">{{$widget->code}}</textarea>
@if (isset($errors) && $errors->has('code'))
<div class="callout alert">
{{ $errors->first('code') }}
</div>
@endif
</label>
<button type="submit" class="button success">@lang('widgets/htmlCode.editExisting')</button>
</form>
@@ -0,0 +1,10 @@
@extends('admin.layout')
@section('pageName', @trans('widgets/htmlCode.new'))
@section('content')
<h1>@lang('widgets/htmlCode.new')</h1>
@include('admin.widgets.htmlCode.newForm')
@stop
@@ -0,0 +1,68 @@
@if (!isset($hideMessages))
@if (session('success'))
<div class="callout success">
{{ session('success') }}
</div>
@endif
@if (session('error'))
<div class="callout alert">
{{ session('error') }}
</div>
@endif
@endif
<form action="{{route('widgets.postNew', ['type' => $type])}}" method="POST">
{!! csrf_field() !!}
<label>
@lang('widgets/htmlCode.name')
<input type="text" name="name" value="{{old("name")}}" placeholder="@lang('widgets/htmlCode.name')" />
@if (isset($errors) && $errors->has('name'))
<div class="callout alert">
{{ $errors->first('name') }}
</div>
@endif
</label>
<label>
@lang('widgets/htmlCode.description')
<input type="text" name="description" placeholder="@lang('widgets/htmlCode.description')"
value="{{old("description")}}" />
@if (isset($errors) && $errors->has('description'))
<div class="callout alert">
{{ $errors->first('description') }}
</div>
@endif
</label>
<label>
@lang('widgets/htmlCode.containerClass')
<input type="text" name="containerClass" placeholder="@lang('widgets/htmlCode.containerClass')"
value="{{old("containerClass")}}" />
@if (isset($errors) && $errors->has('containerClass'))
<div class="callout alert">
{{ $errors->first('description') }}
</div>
@endif
</label>
<label>
@lang('widgets/htmlCode.code')
<textarea rows="4" name="code" placeholder="@lang('widgets/htmlCode.code')">{{old("code")}}</textarea>
@if (isset($errors) && $errors->has('code'))
<div class="callout alert">
{{ $errors->first('code') }}
</div>
@endif
</label>
<button type="submit" class="button success">@lang('widgets/htmlCode.createNew')</button>
</form>