Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
config
Browse files Browse the repository at this point in the history
  • Loading branch information
balping committed Jun 11, 2018
1 parent a3a1169 commit 33373c6
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 226 deletions.
6 changes: 3 additions & 3 deletions src/Views/admin/configuration/common/paginate.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="panel-footer">
<div class="text-center">{!! $records->render("pagination::bootstrap-4") !!}</div>
</div>
<div class="card-footer">
<div class="text-center">{!! $records->render("pagination::bootstrap-4") !!}</div>
</div>
130 changes: 58 additions & 72 deletions src/Views/admin/configuration/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,89 +1,75 @@
@extends($master)
@extends('ticketit::layouts.master')
@section('page', trans('ticketit::admin.config-create-subtitle'))

@section('page')
{{ trans('ticketit::admin.config-create-subtitle') }}
@section('ticketit_header')
{!! link_to_route(
$setting->grab('admin_route').'.configuration.index',
trans('ticketit::admin.btn-back'), null,
['class' => 'btn btn-secondary'])
!!}
@stop

@section('content')
@include('ticketit::shared.header')
<div class="panel panel-default">
<div class="panel-heading">
<h3>{{ trans('ticketit::admin.config-create-title') }}
<div class="panel-nav pull-right" style="margin-top: -7px;">
{!! link_to_route(
$setting->grab('admin_route').'.configuration.index',
trans('ticketit::admin.btn-back'), null,
['class' => 'btn btn-default'])
!!}
</div>
</h3>
</div>
<div class="panel-body">
<div class="form-horizontal">
{!! CollectiveForm::open(['route' => $setting->grab('admin_route').'.configuration.store']) !!}
@section('ticketit_content')
{!! CollectiveForm::open(['route' => $setting->grab('admin_route').'.configuration.store']) !!}

<!-- Slug Field -->
<div class="form-group">
{!! CollectiveForm::label('slug', trans('ticketit::admin.config-edit-slug') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('slug', null, ['class' => 'form-control']) !!}
</div>
<!-- Slug Field -->
<div class="form-group row">
{!! CollectiveForm::label('slug', trans('ticketit::admin.config-edit-slug') . trans('ticketit::admin.colon'), ['class' => 'col-sm-3 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('slug', null, ['class' => 'form-control']) !!}
</div>
</div>

<!-- Default Field -->
<div class="form-group">
{!! CollectiveForm::label('default', trans('ticketit::admin.config-edit-default') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('default', null, ['class' => 'form-control']) !!}
</div>
<!-- Default Field -->
<div class="form-group row">
{!! CollectiveForm::label('default', trans('ticketit::admin.config-edit-default') . trans('ticketit::admin.colon'), ['class' => 'col-sm-3 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('default', null, ['class' => 'form-control']) !!}
</div>
</div>

<!-- Value Field -->
<div class="form-group">
{!! CollectiveForm::label('value', trans('ticketit::admin.config-edit-value') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('value', null, ['class' => 'form-control']) !!}
</div>
<!-- Value Field -->
<div class="form-group row">
{!! CollectiveForm::label('value', trans('ticketit::admin.config-edit-value') . trans('ticketit::admin.colon'), ['class' => 'col-sm-3 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('value', null, ['class' => 'form-control']) !!}
</div>
</div>

<!-- Lang Field -->
<div class="form-group">
{!! CollectiveForm::label('lang', trans('ticketit::admin.config-edit-language') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('lang', null, ['class' => 'form-control']) !!}

</div>
<!-- Lang Field -->
<div class="form-group row">
{!! CollectiveForm::label('lang', trans('ticketit::admin.config-edit-language') . trans('ticketit::admin.colon'), ['class' => 'col-sm-3 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('lang', null, ['class' => 'form-control']) !!}

</div>
</div>

<!-- Submit Field -->
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
{!! CollectiveForm::submit(trans('ticketit::admin.btn-submit'), ['class' => 'btn btn-primary']) !!}
</div>
<!-- Submit Field -->
<div class="form-group row">
<div class="col-sm-10 offset-sm-3">
{!! CollectiveForm::submit(trans('ticketit::admin.btn-submit'), ['class' => 'btn btn-primary']) !!}
</div>

{!! CollectiveForm::close() !!}
</div>
</div>
<div class="panel-footer">
</div>
</div>

<script>
$(document).ready(function() {
$("#slug").bind('change', function() {
var slugger = $('#slug').val();
slugger = slugger
.replace(/\W/g, '.')
.toLowerCase();
$("#slug").val(slugger);
});
{!! CollectiveForm::close() !!}
@stop

$("#default").bind('keyup blur keypress change', function() {
var duplicate = $('#default').val();
$("#value").val(duplicate);
});
});
</script>
@section('footer')
<script>
$(document).ready(function() {
$("#slug").bind('change', function() {
var slugger = $('#slug').val();
slugger = slugger
.replace(/\W/g, '.')
.toLowerCase();
$("#slug").val(slugger);
});
@stop
$("#default").bind('keyup blur keypress change', function() {
var duplicate = $('#default').val();
$("#value").val(duplicate);
});
});
</script>
@append
217 changes: 101 additions & 116 deletions src/Views/admin/configuration/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,131 +1,116 @@
@extends($master)
@extends('ticketit::layouts.master')

@section('page')
{{ trans('ticketit::admin.config-edit-subtitle') }}
@section('page', trans('ticketit::admin.config-edit-subtitle'))

@section('ticketit_header')
{!! link_to_route(
$setting->grab('admin_route').'.configuration.index',
trans('ticketit::admin.btn-back'), null,
['class' => 'btn btn-secondary'])
!!}
@stop

@section('content')
@include('ticketit::shared.header')
<div class="panel panel-default">
<div class="panel-heading">
<h3>{{ trans('ticketit::admin.config-edit-title') }}
<div class="panel-nav pull-right" style="margin-top: -7px;">
{!! link_to_route(
$setting->grab('admin_route').'.configuration.index',
trans('ticketit::admin.btn-back'), null,
['class' => 'btn btn-default'])
!!}
{{--
{!! link_to_route(
$setting->grab('admin_route').'.configuration.create',
trans('ticketit::admin.btn-create-new-config'), null,
['class' => 'btn btn-primary'])
!!}
--}}
@section('ticketit_content')
{!! CollectiveForm::model($configuration, ['route' => [$setting->grab('admin_route').'.configuration.update', $configuration->id], 'method' => 'patch']) !!}
<div class="card bg-light mb-3">
<div class="card-body">
<b>{{ trans('ticketit::admin.config-edit-tools') }}</b>
<br>
<a href="https://www.functions-online.com/unserialize.html" target="_blank">
{{ trans('ticketit::admin.config-edit-unserialize') }}
</a>
<br>
<a href="https://www.functions-online.com/serialize.html" target="_blank">
{{ trans('ticketit::admin.config-edit-serialize') }}
</a>
</div>
</div>

@if(trans("ticketit::settings." . $configuration->slug) != ("ticketit::settings." . $configuration->slug) && trans("ticketit::settings." . $configuration->slug))
<div class="card border-info mb-3">
<div class="card-body">{!! trans("ticketit::settings." . $configuration->slug) !!}</div>
</div>
@endif

<!-- ID Field -->
<div class="form-group row">
{!! CollectiveForm::label('id', trans('ticketit::admin.config-edit-id') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('id', null, ['class' => 'form-control', 'disabled']) !!}
</div>
</h3>
</div>
<div class="panel-body">
<div class="form-horizontal">
{!! CollectiveForm::model($configuration, ['route' => [$setting->grab('admin_route').'.configuration.update', $configuration->id], 'method' => 'patch']) !!}
<div class="well">
<b>{{ trans('ticketit::admin.config-edit-tools') }}</b><br>
<a href="https://www.functions-online.com/unserialize.html" target="_blank">
{{ trans('ticketit::admin.config-edit-unserialize') }}
</a>
<br>
<a href="https://www.functions-online.com/serialize.html" target="_blank">
{{ trans('ticketit::admin.config-edit-serialize') }}
</a>
</div>

@if(trans("ticketit::settings." . $configuration->slug) != ("ticketit::settings." . $configuration->slug) && trans("ticketit::settings." . $configuration->slug))
<div class="panel panel-info">
<div class="panel-body">{!! trans("ticketit::settings." . $configuration->slug) !!}</div>
</div>
@endif

<!-- ID Field -->
<div class="form-group">
{!! CollectiveForm::label('id', trans('ticketit::admin.config-edit-id') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('id', null, ['class' => 'form-control', 'disabled']) !!}
</div>
</div>

<!-- Slug Field -->
<div class="form-group">
{!! CollectiveForm::label('slug', trans('ticketit::admin.config-edit-slug') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('slug', null, ['class' => 'form-control', 'disabled']) !!}
</div>
</div>

<div class="form-group">
{!! CollectiveForm::label('default', trans('ticketit::admin.config-edit-default') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
@if(!$default_serialized)
{!! CollectiveForm::text('default', null, ['class' => 'form-control', 'disabled']) !!}
@else
<pre>{{var_export(unserialize($configuration->default), true)}}</pre>
@endif
</div>
</div>


<!-- Value Field -->
<div class="form-group">
{!! CollectiveForm::label('value', trans('ticketit::admin.config-edit-value') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
@if(!$should_serialize)
{!! CollectiveForm::text('value', null, ['class' => 'form-control']) !!}
@else
{!! CollectiveForm::textarea('value', var_export(unserialize($configuration->value), true), ['class' => 'form-control']) !!}
@endif
</div>
</div>

<!-- Serialize Field -->
<div class="form-group">
{!! CollectiveForm::label('serialize', trans('ticketit::admin.config-edit-should-serialize') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::checkbox('serialize', 1, $should_serialize, ['class' => 'form-control', 'onchange' => 'changeSerialize(this)',]) !!}
<span class="help-block" style="color: red;">@lang('ticketit::admin.config-edit-eval-warning') <code>eval('$value = serialize(' . $value . ');')</code></span>
</div>
</div>

<!-- Slug Field -->
<div class="form-group row">
{!! CollectiveForm::label('slug', trans('ticketit::admin.config-edit-slug') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('slug', null, ['class' => 'form-control', 'disabled']) !!}
</div>
</div>

<div class="form-group row">
{!! CollectiveForm::label('default', trans('ticketit::admin.config-edit-default') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 col-form-label']) !!}
<div class="col-sm-9">
@if(!$default_serialized)
{!! CollectiveForm::text('default', null, ['class' => 'form-control', 'disabled']) !!}
@else
<pre>{{var_export(unserialize($configuration->default), true)}}</pre>
@endif
</div>
</div>


<!-- Value Field -->
<div class="form-group row">
{!! CollectiveForm::label('value', trans('ticketit::admin.config-edit-value') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 col-form-label']) !!}
<div class="col-sm-9">
@if(!$should_serialize)
{!! CollectiveForm::text('value', null, ['class' => 'form-control']) !!}
@else
{!! CollectiveForm::textarea('value', var_export(unserialize($configuration->value), true), ['class' => 'form-control']) !!}
@endif
</div>
</div>

<!-- Serialize Field -->
<div class="form-group row">
{!! CollectiveForm::label('serialize', trans('ticketit::admin.config-edit-should-serialize') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::checkbox('serialize', 1, $should_serialize, ['class' => 'form-control', 'onchange' => 'changeSerialize(this)',]) !!}
<span class="form-text" style="color: red;">@lang('ticketit::admin.config-edit-eval-warning') <code>eval('$value = serialize(' . $value . ');')</code></span>
</div>
</div>

<!-- Password Field -->
<div id="serialize-password" class="form-group">
{!! CollectiveForm::label('password', trans('ticketit::admin.config-edit-reenter-password') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::password('password', ['class' => 'form-control']) !!}
</div>
<!-- Password Field -->
<div id="serialize-password" class="form-group row">
{!! CollectiveForm::label('password', trans('ticketit::admin.config-edit-reenter-password') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::password('password', ['class' => 'form-control']) !!}
</div>
</div>

<!-- Lang Field -->
<div class="form-group">
{!! CollectiveForm::label('lang', trans('ticketit::admin.config-edit-language') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 control-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('lang', null, ['class' => 'form-control']) !!}
</div>
</div>

<!-- Submit Field -->
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
{!! CollectiveForm::submit(trans('ticketit::admin.btn-submit'), ['class' => 'btn btn-primary']) !!}
</div>
</div>

{!! CollectiveForm::close() !!}
<!-- Lang Field -->
<div class="form-group row">
{!! CollectiveForm::label('lang', trans('ticketit::admin.config-edit-language') . trans('ticketit::admin.colon'), ['class' => 'col-sm-2 col-form-label']) !!}
<div class="col-sm-9">
{!! CollectiveForm::text('lang', null, ['class' => 'form-control']) !!}
</div>
</div>

<!-- Submit Field -->
<div class="form-group row">
<div class="col-sm-10 col-sm-offset-2">
{!! CollectiveForm::submit(trans('ticketit::admin.btn-submit'), ['class' => 'btn btn-primary']) !!}
</div>
</div>
</div>
</div>

{!! CollectiveForm::close() !!}


<script>
function changeSerialize(e){
document.querySelector("#serialize-password").style.display = e.checked ? 'block' : 'none';
document.querySelector(".help-block").style.display = e.checked ? 'block' : 'none';
document.querySelector("#serialize-password").style.display = e.checked ? 'flex' : 'none';
document.querySelector(".form-text").style.display = e.checked ? 'block' : 'none';
}
changeSerialize(document.querySelector("input[name='serialize']"));
Expand Down
Loading

0 comments on commit 33373c6

Please sign in to comment.