Management of links and first form for link storing #616

This commit is contained in:
James Cole
2017-08-21 07:13:03 +02:00
parent c5cdd748fc
commit 35ab4a5ff4
25 changed files with 948 additions and 31 deletions

View File

@@ -0,0 +1,44 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('admin.links.store') }}" accept-charset="UTF-8" class="form-horizontal">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('name', null, {helpText: trans('firefly.link_type_help_name')}) }}
{{ ExpandedForm.text('inward', null, {helpText: trans('firefly.link_type_help_inward')}) }}
{{ ExpandedForm.text('outward', null, {helpText: trans('firefly.link_type_help_outward')}) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<!-- panel for options -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('create','link_type') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">{{ 'store_new_link_type'|_ }}</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,53 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, linkType) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('admin.links.destroy',linkType.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.delete_link_type', {'name': linkType.name}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.linkType_areYouSure', {'name': linkType.name,'inward': linkType.inward,'outward': linkType.outward}) }}
</p>
{% if count > 0 %}
<p>
{{ Lang.choice('form.also_delete_connections', count, {count: count}) }}
</p>
{% endif %}
{% if count > 0 %}
<p class="text-success">
{{ 'save_connections_by_moving'|_ }}
</p>
<p>
{{ Form.select('move_link_type_before_delete', moveTo, null, {class: 'form-control'}) }}
</p>
{% else %}
<input type="hidden" name="move_link_type_before_delete" value="0"/>
{% endif %}
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn pull-right btn-danger"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,48 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, linkType) }}
{% endblock %}
{% block content %}
{{ Form.model(linkType, {'class' : 'form-horizontal','id' : 'update','url' : route('admin.links.update', linkType.id) } ) }}
<input type="hidden" name="id" value="{{ linkType.id }}"/>
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('name', null, {helpText: trans('firefly.link_type_help_name')}) }}
{{ ExpandedForm.text('inward', null, {helpText: trans('firefly.link_type_help_inward')}) }}
{{ ExpandedForm.text('outward', null, {helpText: trans('firefly.link_type_help_outward')}) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<!-- panel for options -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('update','link_type') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
{{ ('update_link_type')|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -10,8 +10,47 @@
<div class="box-header with-border">
<h3 class="box-title">{{ 'journal_link_configuration'|_ }}</h3>
</div>
<div class="box-body">
<div class="box-body no-padding">
<table class="table table-hover sortable">
<thead>
<tr>
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
<th data-defaultsign="az">{{ trans('list.name') }}</th>
<th class="hidden-sm hidden-xs" data-defaultsign="az">{{ trans('list.inward') }}</th>
<th class="hidden-sm hidden-xs" data-defaultsign="az">{{ trans('list.outward') }}</th>
<th data-defaultsign="_19">{{ trans('list.number_of_transactions') }}</th>
</tr>
</thead>
<tbody>
{% for linkType in linkTypes %}
<tr>
<td>
{% if linkType.editable %}
<div class="btn-group btn-group-xs">
<a class="btn btn-default btn-xs" href="{{ route('admin.links.edit',linkType.id) }}"><i class="fa fa-fw fa-pencil"></i></a>
<a class="btn btn-danger btn-xs" href="{{ route('admin.links.delete',linkType.id) }}"><i class="fa fa-fw fa-trash-o"></i></a>
</div>
{% endif %}
</td>
<td>
<strong>{{ linkType.name }}</strong>
</td>
<td>
{{ linkType.inward }}
</td>
<td>
{{ linkType.outward }}
</td>
<td data-value="{{ linkType.journalCount }}">
{{ linkType.journalCount }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="box-footer">
<a href="{{ route('admin.links.create') }}" class="btn btn-success">{{ 'create_new_link_type'|_ }}</a>
</div>
</div>
</div>