better collection handlich in backend

This commit is contained in:
Arno Kaimbacher 2018-10-04 16:41:29 +02:00
parent 324eacf061
commit 50bcae442e
24 changed files with 623 additions and 68 deletions

View file

@ -17,7 +17,6 @@ window.Vue = require('vue');
Vue.component('my-vuetable', require('./components/MyVuetable.vue'));
const app = new Vue({
el: '#app'
});

View file

@ -1,5 +1,4 @@
@extends('layouts.app')
@extends('layouts.app')
@section('content')
<div class="pure-g">
<div class="pure-u-1 pure-u-md-2-3">
@ -13,9 +12,9 @@
<?php endforeach; ?>
</span>
<div class="posts">
<ol><?php foreach ($documents as $document) : ?>
<ol>
<?php foreach ($documents as $document) : ?>
<li>
<section class="post">
<header class="post-header">
@ -24,27 +23,28 @@
</a>
</h2>
</header>
<div class="blog-meta"><?= $document->server_date_published->toDayDateTimeString() ?>
<div class="blog-meta">
<?= $document->server_date_published->toDayDateTimeString() ?>
</div>
<div class="post-description">
@foreach ($document->authors as $author)
<em>Author: {{ $author->getFullName() }}</em>
<br />
@endforeach
<em>Author: {{ $author->full_name }}</em>
<br />
@endforeach
@foreach ($document->titles as $title)
<em>Main Title: {{ $title->value }}</em>
<br />
<br />
@endforeach
</div>
</section>
</li><?php endforeach; ?>
</li>
<?php endforeach; ?>
</ol>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@endsection

View file

@ -11,16 +11,16 @@
<div class="pure-g box-content">
<div class="pure-u-1 pure-u-md-3-3">
<a href="{{ route('settings.project.add') }}" class="pure-button button-small is-primary">
<i class="fa fa-plus-circle"></i>ADD NEW COLLECTION
<a href="{{ route('settings.collection.create') }}" class="pure-button button-small is-primary">
<i class="fa fa-plus-circle"></i>ADD NEW CHILD COLLECTION
</a>
<br><br>
<table class="pure-table pure-table-horizontal">
<thead>
<th>Collection</th>
<th>id</th>
<th>Collection (number of child collections)</th>
<th>Collection Role</th>
<th>Document id's</th>
<th>Options</th>
</thead>
@ -30,8 +30,13 @@
@foreach($collections as $collection)
<tr>
<td>{{ $collection->name }}</td>
<td>{{ $collection->id }}</td>
<td>
<a class="show" href="{{ route('settings.collection.show', $collection) }}">
{{-- <span">{{ $collection->name }}</span> --}}
<span">{{ $collection->name .' ('. $collection->children->count() .')' }}</span>
</a>
</td>
<td>{{ $collection->collectionrole->name }}</td>
<td>
@foreach ($collection->documents as $document)
<p>document id: {{ $document->id }}</p>
@ -39,12 +44,8 @@
</td>
<td>
<a class="edit" href="{{ route('settings.collection.edit', $collection->id) }}"><span aria-hidden="true"></span></a>
<a class="delete" href="{{ route('settings.collection.delete', $collection->id) }}"><span aria-hidden="true"></span></a>
<a class="edit" href="{{ route('settings.collection.edit', $collection->id) }}"><span aria-hidden="true">edit collection</span></a>
{{-- <a class="delete" href="{{ route('settings.collection.delete', $collection->id) }}"><span aria-hidden="true"></span></a> --}}
</td>
</td>
</tr>

View file

@ -0,0 +1,44 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
Edit Collection "{{ $collection->name }}"
</h3>
</div>
<div class="box-content">
@if($collection->parent()->exists())
<a href="{{ route('settings.collection.show', $collection->parent) }}" class="pure-button button-small">
<i class="fa fa-chevron-left"></i>
<span>BACK</span>
</a>
@else
<a href="{{ route('settings.collectionrole.show', $collection->collectionrole) }}" class="pure-button button-small">
<i class="fa fa-chevron-left"></i>
<span>BACK</span>
</a>
@endif
<div>
{!! Form::model($collection, ['method' => 'PATCH', 'route' => ['settings.collection.update', $collection->id], 'class' =>
'pure-form pure-form-aligned']) !!}
<fieldset>
<div class="pure-control-group">
{{ Form::label('name', 'collection name') }} {{ Form::text('name', null, ['class' => 'form-control']) }}
<em>*</em>
</div>
<div class="pure-control-group pure-div">
{!! Form::label('role_id', 'Collection Role..') !!}
{!! Form::select('role_id', $collectionroles, null, ['id' => 'role_id', 'placeholder' => '-- no role selected --']) !!}
<em>*</em>
</div>
{{ Form::submit("Submit", ['class' => 'pure-button button-small']) }}
</fieldset>
@include('errors._errors')
{!! Form::close() !!}
</div>
</div>
@endsection

View file

@ -0,0 +1,46 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
Edit Collection Role
</h3>
</div>
<div class="box-content">
<a href="{{ route('settings.collectionrole.index') }}" class="pure-button button-small">
<i class="fa fa-chevron-left"></i>
<span>BACK</span>
</a>
<div>
{!! Form::model($collectionrole, ['method' => 'PATCH', 'route' => ['settings.collectionrole.update', $collectionrole->id], 'class' => 'pure-form pure-form-aligned']) !!}
<fieldset>
<div class="pure-control-group">
{{ Form::label('name', 'collectionrole name') }}
{{ Form::text('name', null, ['class' => 'form-control']) }}
<em>*</em>
</div>
<div class="pure-control-group">
{{ Form::label('oai_name', 'name of oai set') }}
{{ Form::text('oai_name', null, ['class' => 'form-control']) }}
<em>*</em>
</div>
<!-- checkboxes -->
<label for="active" class="pure-checkbox">
<input type="hidden" name="visible" value="0">
<input name="visible" value="1" {{ ($collectionrole->visible == 1) ? 'checked="checked" ' : '' }} type="checkbox" class="form-check-input">
Visible?
</label>
<label for="active" class="pure-checkbox">
<input type="hidden" name="visible_oai" value="0">
<input name="visible_oai" value="1" {{ ($collectionrole->visible_oai == 1) ? 'checked="checked" ' : '' }} type="checkbox" class="form-check-input">
Use collection as OAI set
</label>
{{ Form::submit("Submit", ['class' => 'pure-button button-small']) }}
</fieldset>
{!! Form::close() !!}
</div>
</div>
@endsection

View file

@ -0,0 +1,67 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
<i class="fa fa-archive"></i> Collection Roles
</h3>
</div>
<div class="pure-g box-content">
<div class="pure-u-1 pure-u-md-3-3">
{{-- <a href="{{ route('settings.collectionrole.create') }}" class="pure-button button-small is-primary">
<i class="fa fa-plus-circle"></i>ADD NEW COLLECTION ROLE
</a> --}}
<br><br>
<table class="pure-table pure-table-horizontal">
<thead>
<th>Collection</th>
<th>Count Of Nested Collections</th>
<th>Options</th>
<th>Visible</th>
</thead>
<tbody>
@foreach($collectionroles as $collectionrole)
<tr>
<td>
<a class="show" href="{{ route('settings.collectionrole.show', $collectionrole) }}">
<span">{{ $collectionrole->name .' ('. $collectionrole->collections->count() .')' }}</span>
</a>
</td>
<td>
{{-- @foreach ($collection->documents as $document)
<p>document id: {{ $document->id }}</p>
@endforeach --}}
{{ $collectionrole->collections->count() }}
{{-- <a href="" class="pure-button button-small is-success">Show Collections</a> --}}
</td>
<td>
<a class="edit" href="{{ route('settings.collectionrole.edit', $collectionrole->id) }}"><span aria-hidden="true">Edit</span></a>
{{-- <a class="delete" href="{{ route('settings.collection.delete', $collection->id) }}"><span aria-hidden="true"></span></a> --}}
</td>
<td>
@if($collectionrole->visible == 1)
<a href="{{ route('settings.collectionrole.hide', $collectionrole->id) }}" class="pure-button button-small is-warning">Hide</a>
@else
<a href="{{ route('settings.collectionrole.up', $collectionrole->id) }}" class="pure-button button-small is-success">Unhide</a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="pure-u-1 pure-u-md-3-3">
{{-- {{ $collectionroles->links('vendor.pagination.default') }} --}}
</div>
</div>
@stop

View file

@ -0,0 +1,65 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
<i class="fa fa-archive"></i> Top Level Collections
</h3>
</div>
<div class="pure-g box-content">
<div class="pure-u-1 pure-u-md-3-3">
{{-- <a href="{{ route('settings.collection.create') }}" class="pure-button button-small is-primary">
<i class="fa fa-plus-circle"></i>ADD NEW COLLECTION
</a> --}}
<br><br>
<table class="pure-table pure-table-horizontal">
<thead>
<th>Collection (number of child collections)</th>
<th>Collection Role</th>
<th>Document id's</th>
<th>Options</th>
</thead>
<tbody>
@foreach($collections as $collection)
<tr>
<td>
<a class="show" href="{{ route('settings.collection.show', $collection) }}">
{{-- <span">{{ $collection->name }}</span> --}}
<span">{{ $collection->name .' ('. $collection->children->count() .')' }}</span>
</a>
</td>
<td>{{ $collection->collectionrole->name }}</td>
<td>
@foreach ($collection->documents as $document)
<p>document id: {{ $document->id }}</p>
@endforeach
</td>
<td>
<a class="edit" href="{{ route('settings.collection.edit', $collection->id) }}"><span aria-hidden="true">edit collection</span></a>
{{-- <a class="delete" href="{{ route('settings.collection.delete', $collection->id) }}"><span aria-hidden="true"></span></a> --}}
</td>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="pure-u-1 pure-u-md-3-3">
{{ $collections->links('vendor.pagination.default') }}
</div>
</div>
@stop

View file

@ -53,8 +53,11 @@
<li class="pure-menu-item {{ Route::is('settings.document*') ? 'active' : '' }}">
<a class="pure-menu-link" href="{{ route('settings.document') }}"><i class="fa fa-database"></i> Datasets</a>
</li>
<li class="pure-menu-item {{ Route::is('settings.collection*') ? 'active' : '' }}">
{{-- <li class="pure-menu-item {{ Route::is('settings.collection*') ? 'active' : '' }}">
<a class="pure-menu-link" href="{{ route('settings.collection') }}"><i class="fa fa-archive"></i> Collections</a>
</li> --}}
<li class="pure-menu-item {{ Route::is('settings.collectionrole') ? 'active' : '' }}">
<a class="pure-menu-link" href="{{ route('settings.collectionrole.index') }}"><i class="fa fa-archive"></i> Collection Roles</a>
</li>
<li class="pure-menu-item {{ Route::is('settings.license*') ? 'active' : '' }}">
<a href="{{ route('settings.license') }}" class="pure-menu-link"><i class="fa fa-file"></i> Licenses</a>

View file

@ -14,7 +14,8 @@
<div class="pure-control-group" ">
{!! Form::label('first_name', 'First Name..') !!}
{!! Form::text('first_name', null, ['class' => 'form-control']) !!}
<aside id="firstNameHelp" class="pure-form-message-inline">first name is optional.</aside>
<em>*</em>
{{-- <aside id="firstNameHelp" class="pure-form-message-inline">first name is optional.</aside> --}}
</div>

View file

@ -9,6 +9,11 @@
{{ Form::text('label', null, ['class' => 'form-control']) }}
<em>*</em>
</div>
<div class="pure-control-group">
{{ Form::label('description', 'description') }}
{{ Form::textarea('description', null, ['class' => 'form-control', 'size' => '70x6']) }}
<em>*</em>
</div>
{{ Form::submit($submitButtonText, ['class' => 'pure-button button-small']) }}
</fieldset>