- add references anf keywords fro edit form
- edit datetime settings from database - edit time, elevation and depth
This commit is contained in:
parent
43d98a1f82
commit
fef6dea98d
14 changed files with 681 additions and 941 deletions
|
@ -1,14 +1,14 @@
|
|||
import { Component, Vue, Watch } from 'vue-property-decorator';
|
||||
import axios from 'axios';
|
||||
import datetime from 'vuejs-datetimepicker';
|
||||
import VeeValidate from 'vee-validate';
|
||||
Vue.use(VeeValidate);
|
||||
import LocationsMap from './components/locations-map.vue';
|
||||
import Dataset from './components/Dataset';
|
||||
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
LocationsMap
|
||||
LocationsMap,
|
||||
datetime
|
||||
}
|
||||
})
|
||||
export default class EditDataset extends Vue {
|
||||
|
@ -53,6 +53,9 @@ export default class EditDataset extends Vue {
|
|||
// };
|
||||
allErros = [];
|
||||
success = false;
|
||||
elevation = "no_elevation";
|
||||
depth = "no_depth";
|
||||
time = "no_time";
|
||||
|
||||
beforeMount() {
|
||||
// this.form = window.Laravel.form;
|
||||
|
@ -60,6 +63,12 @@ export default class EditDataset extends Vue {
|
|||
this.projects = window.Laravel.projects;
|
||||
this.licenses = window.Laravel.licenses;
|
||||
this.checkeds = window.Laravel.checkeds;
|
||||
this.referenceTypes = window.Laravel.referenceTypes;
|
||||
this.relationTypes = window.Laravel.relationTypes;
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.setRadioButtons();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -90,11 +99,11 @@ export default class EditDataset extends Vue {
|
|||
}
|
||||
}
|
||||
if (from.embargo_date) {
|
||||
from.embargo_date = this.formatDateFormat(new Date(from.embargo_date), 'yyyy-MM-dd');
|
||||
from.embargo_date = this.formatDateFormat(new Date(from.embargo_date), 'yyyy-MM-dd');
|
||||
}
|
||||
return from;
|
||||
}
|
||||
|
||||
|
||||
formatDateFormat(x, y) {
|
||||
var z = {
|
||||
M: x.getMonth() + 1,
|
||||
|
@ -116,6 +125,32 @@ export default class EditDataset extends Vue {
|
|||
return (typeof item === "object" && !Array.isArray(item) && item !== null);
|
||||
}
|
||||
|
||||
setRadioButtons() {
|
||||
if (this.form.coverage.time_absolut != null) {
|
||||
this.time = "absolut";
|
||||
} else if (this.form.coverage.time_min != null) {
|
||||
this.time = "range";
|
||||
} else {
|
||||
this.time = "no_time";
|
||||
}
|
||||
|
||||
if (this.form.coverage.elevation_absolut != null) {
|
||||
this.elevation = "absolut";
|
||||
} else if (this.form.coverage.elevation_min != null) {
|
||||
this.elevation = "range";
|
||||
} else {
|
||||
this.elevation = "no_elevation";
|
||||
}
|
||||
|
||||
if (this.form.coverage.depth_absolut != null) {
|
||||
this.depth = "absolut";
|
||||
} else if (this.form.coverage.depth_min != null) {
|
||||
this.depth = "range";
|
||||
} else {
|
||||
this.depth = "no_depth";
|
||||
}
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
// var dataform = new FormData();
|
||||
// dataform.append('name', this.form.name);
|
||||
|
@ -141,4 +176,45 @@ export default class EditDataset extends Vue {
|
|||
});
|
||||
}
|
||||
|
||||
/*
|
||||
adds a new Keyword
|
||||
*/
|
||||
addKeyword() {
|
||||
let newKeyword = { value: '', type: 'uncontrolled', language: this.form.language };
|
||||
//this.dataset.files.push(uploadedFiles[i]);
|
||||
this.form.subjects.push(newKeyword);
|
||||
}
|
||||
/*
|
||||
Removes a selected keyword
|
||||
*/
|
||||
removeKeyword(key) {
|
||||
this.form.subjects.splice(key, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
Handles a change on the file upload
|
||||
*/
|
||||
addReference() {
|
||||
let newReference = { value: '', label: '', relation: '', type: '' };
|
||||
//this.dataset.files.push(uploadedFiles[i]);
|
||||
this.form.references.push(newReference);
|
||||
}
|
||||
|
||||
/*
|
||||
Removes a selected reference
|
||||
*/
|
||||
removeReference(key) {
|
||||
this.form.references.splice(key, 1);
|
||||
}
|
||||
|
||||
// @Watch('form.coverage.time_absolut')
|
||||
// onTimeAbsolutChanged(val) {
|
||||
// this.time = "absolut";
|
||||
// }
|
||||
|
||||
// @Watch('form.coverage.time_min')
|
||||
// onTimeMinChanged(val) {
|
||||
// this.time = "range";
|
||||
// }
|
||||
|
||||
}
|
|
@ -1,19 +1,21 @@
|
|||
<fieldset id="fieldset-State">
|
||||
<legend>State & notes</legend>
|
||||
<div class="pure-g">
|
||||
@if(!empty($reject_reviewer_note))
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('reject_reviewer_note', 'editor reject note..') !!}
|
||||
{{-- {!! Form::select('server_state', Config::get('enums.server_states'), null, ['id' => 'server_state', 'placeholder' => '-- select server state --']) !!} --}}
|
||||
{!! Form::textarea('reject_editor_note', null, ['class'=>'pure-u-23-24','readonly', 'v-model' => 'form.reject_editor_note']) !!}
|
||||
</div>
|
||||
@endif
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('server_state', 'Status..') !!}
|
||||
{{-- {!! Form::select('server_state', Config::get('enums.server_states'), null, ['id' => 'server_state', 'placeholder' => '-- select server state --']) !!} --}}
|
||||
{!! Form::text('server_state', null, ['class'=>'pure-u-23-24','readonly', 'v-model' => 'form.server_state']) !!}
|
||||
</div>
|
||||
<legend>State & notes</legend>
|
||||
<div class="pure-g">
|
||||
@if(!empty($reject_reviewer_note))
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('reject_reviewer_note', 'editor reject note..') !!}
|
||||
{{-- {!! Form::select('server_state', Config::get('enums.server_states'), null, ['id' => 'server_state', 'placeholder' => '-- select server state --']) !!} --}}
|
||||
{!! Form::textarea('reject_editor_note', null, ['class'=>'pure-u-23-24','readonly', 'v-model' =>
|
||||
'form.reject_editor_note']) !!}
|
||||
</div>
|
||||
@endif
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('server_state', 'Status..') !!}
|
||||
{{-- {!! Form::select('server_state', Config::get('enums.server_states'), null, ['id' => 'server_state', 'placeholder' => '-- select server state --']) !!} --}}
|
||||
{!! Form::text('server_state', null, ['class'=>'pure-u-23-24','readonly', 'v-model' => 'form.server_state'])
|
||||
!!}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="fieldset-General">
|
||||
|
@ -32,7 +34,8 @@
|
|||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('type', 'Type..') !!}
|
||||
<div class="select pure-u-23-24">
|
||||
{!! Form::select('type', Lang::get('doctypes'), null, ['id' => 'type', 'placeholder' => '-- select type --',
|
||||
{!! Form::select('type', Lang::get('doctypes'), null, ['id' => 'type', 'placeholder' => '-- select type
|
||||
--',
|
||||
'v-model' => 'form.type', "v-validate" => "'required'"]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -48,20 +51,21 @@
|
|||
</select>
|
||||
</div>
|
||||
<small id="projectHelp" class="pure-form-message-inline">project is optional</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('creating_corporation', 'Creating Corporation') !!}
|
||||
{!! Form::text('creating_corporation', null, ['class' =>
|
||||
'pure-u-23-24', 'v-model' => 'form.creating_corporation', "v-validate" => "'required'"]) !!}
|
||||
<span class="md-error" v-if="errors.has('form.creating_corporation')">creating corporation is required.</span>
|
||||
<span class="md-error" v-if="errors.has('form.creating_corporation')">creating corporation is
|
||||
required.</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="fieldset-dates">
|
||||
<legend>Date(s)</legend>
|
||||
<legend>Date(s)</legend>
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('embargo_date', 'Embargo Date') !!}
|
||||
{!! Form::date('embargo_date', null, ['placeholder' => date('y-m-d'), 'class'
|
||||
|
@ -75,9 +79,9 @@
|
|||
<div class="pure-g">
|
||||
<div class="pure-u-1 pure-u-md-1 pure-u-lg-1 pure-div">
|
||||
<locations-map v-bind:geolocation="form.coverage"></locations-map>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
{{-- <fieldset id="fieldset-geolocation">
|
||||
<legend>Coverage: Geolocation, Elevation, Depth, Time</legend>
|
||||
|
@ -172,31 +176,145 @@
|
|||
</div>
|
||||
</fieldset> --}}
|
||||
|
||||
<fieldset id="fieldset-coverage">
|
||||
<legend>Coverage</legend>
|
||||
<div class="pure-g">
|
||||
|
||||
<div class="pure-u-1 pure-u-md-1-2">
|
||||
<div class="pure-u-1 pure-u-md-1">
|
||||
<label for="elevation-option-one" class="pure-radio">
|
||||
<input id="elevation-option-one" type="radio" v-model="elevation" value="absolut">
|
||||
absolut elevation (m)
|
||||
</label>
|
||||
<label for="elevation-option-two" class="pure-radio">
|
||||
<input id="elevation-option-two" type="radio" v-model="elevation" value="range">
|
||||
elevation range (m)
|
||||
</label>
|
||||
<label for="elevation-option-three" class="pure-radio">
|
||||
<input id="elevation-option-three" type="radio" v-model="elevation" value="no_elevation">
|
||||
no elevation
|
||||
</label>
|
||||
</div>
|
||||
<div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('elevation_absolut', 'elevation absolut: ') !!}
|
||||
{!! Form::text('elevation_absolut', null,
|
||||
['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.elevation_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!}
|
||||
</div>
|
||||
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('elevation_min', 'elevation min: ') !!}
|
||||
{!! Form::text('elevation_min', null,
|
||||
['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.elevation_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
|
||||
</div>
|
||||
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('elevation_max', 'elevation max: ') !!}
|
||||
{!! Form::text('elevation_max', null,
|
||||
['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.elevation_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1 pure-u-md-1-2">
|
||||
<div class="pure-u-1 pure-u-md-1">
|
||||
<label for="depth-option-one" class="pure-radio">
|
||||
<input id="depth-option-one" type="radio" v-model="depth" value="absolut">
|
||||
absolut depth (m)
|
||||
</label>
|
||||
<label for="depth-option-two" class="pure-radio">
|
||||
<input id="depth-option-two" type="radio" v-model="depth" value="range">
|
||||
depth range (m)
|
||||
</label>
|
||||
<label for="depth-option-three" class="pure-radio">
|
||||
<input id="depth-option-three" type="radio" v-model="depth" value="no_depth">
|
||||
no depth
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-show="depth === 'absolut'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('depth_absolut', 'depth absolut: ') !!} {!! Form::text('depth_absolut', null, ['class' => 'pure-u-23-24',
|
||||
'v-model' => 'form.coverage.depth_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthAbsolut
|
||||
? 'required|integer' : '' " ]) !!}
|
||||
</div>
|
||||
<div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('depth_min', 'depth min: ') !!} {!! Form::text('depth_min', null, ['class' => 'pure-u-23-24', 'v-model' =>
|
||||
'form.coverage.depth_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer'
|
||||
: '' "]) !!}
|
||||
</div>
|
||||
<div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('depth_max', 'depth max: ') !!} {!! Form::text('depth_max', null, ['class' => 'pure-u-23-24', 'v-model' =>
|
||||
'form.coverage.depth_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer'
|
||||
: '' "]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1 pure-u-md-1-2">
|
||||
<div class="pure-u-1 pure-u-md-1">
|
||||
<label for="time-option-one" class="pure-radio">
|
||||
<input id="time-option-one" type="radio" v-model="time" value="absolut">
|
||||
absolut time (dd.MM.yyyy HH:mm:ss)
|
||||
</label>
|
||||
<label for="time-option-two" class="pure-radio">
|
||||
<input id="time-option-two" type="radio" v-model="time" value="range">
|
||||
time range (dd.MM.yyyy HH:mm:ss)
|
||||
</label>
|
||||
<label for="time-option-three" class="pure-radio">
|
||||
<input id="time-option-three" type="radio" v-model="time" value="no_time">
|
||||
no time
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-show="time === 'absolut'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('time_absolut', 'time absolut: ') !!}
|
||||
{{-- {!! Form::datetime('time_absolut', null, ['class' => 'pure-u-23-24', 'placeholder' => 'dd.MM.yyyy HH:mm',
|
||||
'v-model' => 'dataset.coverage.time_absolut', 'data-vv-scope' => 'step-2', 'format' => 'yyyy-MM-dd HH:mm',
|
||||
"v-validate" => "this.isTimeAbsolut ? 'required|date_format:dd.MM.yyyy HH:mm:ss' : '' " ]) !!} --}}
|
||||
<datetime name="time_absolut" v-validate="this.isTimeAbsolut ? 'required|date_format:dd-MM-yyyy HH:mm:ss' : '' " data-vv-scope="step-2" format="YYYY-MM-DD h:i:s" v-model='form.coverage.time_absolut' ></datetime>
|
||||
{{-- <datetime name="time_absolut" format="MM-DD-YYYY H:i:s" width="300px" v-model="dataset.coverage.time_absolut"></datetime> --}}
|
||||
</div>
|
||||
<div v-show="time === 'range'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('time_min', 'time min: ') !!}
|
||||
{{-- {!! Form::datetimelocal('time_min', null, ['class' => 'pure-u-23-24', 'placeholder' => 'dd.MM.yyyy HH:mm:ss',
|
||||
'v-model' => 'dataset.coverage.time_min', 'data-vv-scope' => 'step-2', 'step' => 1,
|
||||
"v-validate" => "this.isTimeRange ? 'required|date_format:dd.MM.yyyy HH:mm:ss' : '' "]) !!} --}}
|
||||
<datetime name="time_min" v-validate="this.isTimeRange ? 'required|date_format:dd-MM-yyyy HH:mm:ss' : '' " data-vv-scope="step-2" format="DD-MM-YYYY h:i:s" v-model='form.coverage.time_min' ></datetime>
|
||||
</div>
|
||||
<div v-show="time === 'range'" class="pure-u-1 pure-u-md-1">
|
||||
{!! Form::label('timemax', 'time max: ') !!}
|
||||
{{-- {!! Form::datetimelocal('time_max', null, ['class' => 'pure-u-23-24', 'placeholder' => 'dd.MM.yyyy HH:mm:ss',
|
||||
'v-model' => 'dataset.coverage.time_max', 'data-vv-scope' => 'step-2', 'step' => 1,
|
||||
"v-validate" => "this.isTimeRange ? 'required|date_format:dd.MM.yyyy HH:mm:ss' : '' "]) !!} --}}
|
||||
<datetime name="time_max" v-validate="this.isTimeRange ? 'required|date_format:dd-MM-yyyy HH:mm:ss' : '' " data-vv-scope="step-2" format="DD-MM-YYYY h:i:s" v-model='form.coverage.time_max' ></datetime>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="fieldset-titles">
|
||||
<legend>Title</legend>
|
||||
<div class="pure-g">
|
||||
|
||||
{{-- @foreach($dataset->titles as $key => $title)
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{{ Form::label('title', 'Title ' .($key+1).':') }}
|
||||
{{ Form::text('titles['.$title->id.'][value]', $title->value, ['class' => 'pure-u-23-24']) }}
|
||||
{{ Form::label('title', 'Title ' .($key+1).':') }}
|
||||
{{ Form::text('titles['.$title->id.'][value]', $title->value, ['class' => 'pure-u-23-24']) }}
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{{ Form::label('language', 'Language..') }}
|
||||
{{ Form::text('titles['.$title->id.'][language]', $title->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }}
|
||||
</div>
|
||||
@endforeach --}}
|
||||
|
||||
<template v-for="(title, key) in form.titles">
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
<label :for="'titles['+title.id+'][value]'"> @{{ 'Title ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'titles['+title.id+'][value]'" :name="'titles['+title.id+'][value]'"
|
||||
v-model="title.value" class="pure-u-23-24">
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{{ Form::label('language', 'Language..') }}
|
||||
{{ Form::text('titles['.$title->id.'][language]', $title->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }}
|
||||
<label :for="'titles['+title.id+'][language]'"> @{{ 'Language for title ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'titles['+title.id+'][language]'" :name="'titles['+title.id+'][language]'"
|
||||
v-model="title.language" class="pure-u-23-24" readonly>
|
||||
</div>
|
||||
@endforeach --}}
|
||||
|
||||
<template v-for="(title, key) in form.titles">
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
<label :for="'titles['+title.id+'][value]'"> @{{ 'Title ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'titles['+title.id+'][value]'" :name="'titles['+title.id+'][value]'" v-model="title.value" class="pure-u-23-24">
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
<label :for="'titles['+title.id+'][language]'"> @{{ 'Language for title ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'titles['+title.id+'][language]'" :name="'titles['+title.id+'][language]'" v-model="title.language" class="pure-u-23-24" readonly>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
|
@ -208,25 +326,29 @@
|
|||
{{-- @foreach($dataset->abstracts as $key => $abstract)
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{{ Form::label('abstract', 'Abstract ' .($key+1).':') }}
|
||||
<!-- Notice this is an array now: -->
|
||||
{{ Form::textarea('abstracts['.$abstract->id.'][value]', $abstract->value, ['class' => 'pure-u-23-24', 'size' => '70x6']) }}
|
||||
<!-- Notice this is an array now: -->
|
||||
{{ Form::textarea('abstracts['.$abstract->id.'][value]', $abstract->value, ['class' => 'pure-u-23-24', 'size' => '70x6']) }}
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{{ Form::label('language', 'Language..') }}
|
||||
{{ Form::text('abstracts['.$abstract->id.'][language]', $abstract->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }}
|
||||
</div>
|
||||
@endforeach --}}
|
||||
|
||||
<template v-for="(abstract, key) in form.abstracts">
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
<label :for="'abstracts['+abstract.id+'][value]'"> @{{ 'Title ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'abstracts['+abstract.id+'][value]'" :name="'abstracts['+abstract.id+'][value]'"
|
||||
v-model="abstract.value" class="pure-u-23-24">
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{{ Form::label('language', 'Language..') }}
|
||||
{{ Form::text('abstracts['.$abstract->id.'][language]', $abstract->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }}
|
||||
<label :for="'abstracts['+abstract.id+'][language]'">
|
||||
@{{ 'Language for abstract ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'abstracts['+abstract.id+'][language]'"
|
||||
:name="'abstracts['+abstract.id+'][language]'" v-model="abstract.language" class="pure-u-23-24"
|
||||
readonly>
|
||||
</div>
|
||||
@endforeach --}}
|
||||
|
||||
<template v-for="(abstract, key) in form.abstracts">
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
<label :for="'abstracts['+abstract.id+'][value]'"> @{{ 'Title ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'abstracts['+abstract.id+'][value]'" :name="'abstracts['+abstract.id+'][value]'" v-model="abstract.value" class="pure-u-23-24">
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
<label :for="'abstracts['+abstract.id+'][language]'"> @{{ 'Language for abstract ' + (key + 1) + ':' }}</label>
|
||||
<input type="text" :id="'abstracts['+abstract.id+'][language]'" :name="'abstracts['+abstract.id+'][language]'" v-model="abstract.language" class="pure-u-23-24" readonly>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
|
@ -237,38 +359,41 @@
|
|||
<div class="pure-control-group checkboxlist">
|
||||
{{-- @foreach ($licenses as $license)
|
||||
<label for={{ "license". $license->id }} class="pure-checkbox">
|
||||
@if ($loop->first)
|
||||
<input name="licenses" value={{ $license->id }} v-model="form.checkedLicenses" {{ (in_array($license->id, $checkeds)) ? 'checked=checked' : '' }}
|
||||
type="radio" class="form-check-input" v-validate="'required'" data-vv-as="Licence">
|
||||
<a href="{{ $license->link_licence }}" target="_blank">{{ $license->name_long }}</a>
|
||||
@else
|
||||
<input name="licenses" value={{ $license->id }} v-model="form.checkedLicenses" {{ (in_array($license->id, $checkeds)) ? 'checked=checked' : '' }}
|
||||
type="radio" class="form-check-input">
|
||||
<a href="{{ $license->link_licence }}" target="_blank">{{ $license->name_long }}</a>
|
||||
@endif
|
||||
</label>
|
||||
@if ($loop->first)
|
||||
<input name="licenses" value={{ $license->id }} v-model="form.checkedLicenses"
|
||||
{{ (in_array($license->id, $checkeds)) ? 'checked=checked' : '' }} type="radio" class="form-check-input"
|
||||
v-validate="'required'" data-vv-as="Licence">
|
||||
<a href="{{ $license->link_licence }}" target="_blank">{{ $license->name_long }}</a>
|
||||
@else
|
||||
<input name="licenses" value={{ $license->id }} v-model="form.checkedLicenses"
|
||||
{{ (in_array($license->id, $checkeds)) ? 'checked=checked' : '' }} type="radio" class="form-check-input">
|
||||
<a href="{{ $license->link_licence }}" target="_blank">{{ $license->name_long }}</a>
|
||||
@endif
|
||||
</label>
|
||||
@endforeach --}}
|
||||
<br>
|
||||
{{-- <span>Checked license: @{{ dataset.checkedLicenses }}</span> --}}
|
||||
|
||||
<template v-for="(license, index) in licenses">
|
||||
<label :for="'license'+license.id" class="pure-checkbox">
|
||||
<input name="licenses" :value="license.id" v-model="checkeds" type="radio" class="form-check-input" v-validate="'required'" >
|
||||
<a :href="license.link_licence" target="_blank">@{{ license.name_long }}</a>
|
||||
</label>
|
||||
</template>
|
||||
{{-- <span>old checkeds: @{{ checkeds }}</span> --}}
|
||||
<label :for="'license'+license.id" class="pure-checkbox">
|
||||
<input name="licenses" :value="license.id" v-model="checkeds" type="radio" class="form-check-input"
|
||||
v-validate="'required'">
|
||||
<a :href="license.link_licence" target="_blank">@{{ license.name_long }}</a>
|
||||
</label>
|
||||
</template>
|
||||
{{-- <span>old checkeds: @{{ checkeds }}</span> --}}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="fieldset-references">
|
||||
<legend>Dataset References</legend>
|
||||
<button class="pure-button button-small" @click.prevent="addReference()">Add Reference</button>
|
||||
{{-- <table class="table table-hover" v-if="dataset.keywords.length"> --}}
|
||||
@if ($dataset->references->count() > 0)
|
||||
<table id="references" class="pure-table pure-table-horizontal">
|
||||
{{-- @if ($dataset->references->count() > 0) --}}
|
||||
<table v-show="form.references.length" id="references" class="pure-table pure-table-horizontal">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20px;">Reference value</th>
|
||||
|
@ -279,40 +404,59 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach($dataset->references as $key => $reference)
|
||||
|
||||
{{-- @foreach($dataset->references as $key => $reference) --}}
|
||||
<tr v-for="(item, index) in form.references">
|
||||
<td>
|
||||
{{ Form::text('references['.$reference->id.'][value]', $reference->value, ['class' => 'form-control', 'placeholder' => '[REFERENCE VALUE]']) }}
|
||||
{{-- {{ Form::text('references['.$reference->id.'][value]', $reference->value, ['class' => 'form-control', 'placeholder' => '[REFERENCE VALUE]']) }}
|
||||
--}}
|
||||
<input v-bind:name="'references[' + item.id +'][value]'" class="form-control"
|
||||
placeholder="[REFERENCE VALUE]" v-model="item.value" v-validate="'required'" />
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::text('references['.$reference->id.'][label]', $reference->label, ['class' => 'form-control', 'placeholder' => '[REFERENCE LABEL]']) }}
|
||||
{{-- {{ Form::text('references['.$reference->id.'][label]', $reference->label, ['class' => 'form-control', 'placeholder' => '[REFERENCE LABEL]']) }}
|
||||
--}}
|
||||
<input v-bind:name="'references[' + item.id +'][label]'" class="form-control"
|
||||
placeholder="[REFERENCE LABEL]" v-model="item.label" v-validate="'required'" />
|
||||
</td>
|
||||
<td>
|
||||
{!! Form::select('references['.$reference->id.'][type]', $referenceTypes, $reference->type,
|
||||
['placeholder' => '[reference type]', 'v-model' =>
|
||||
'item.type', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!}
|
||||
{{-- {!! Form::select('references['.$reference->id.'][type]', $referenceTypes, $reference->type,
|
||||
['placeholder' => '[REFERENCE TYPE]', 'v-model' => 'item.type', "v-validate" => "'required'"]) !!} --}}
|
||||
<select v-bind:name="'references[' + item.id +'][type]'" v-model="item.type" class="form-control" v-validate="'required'">
|
||||
<option v-for="option in referenceTypes" :value='option'>
|
||||
@{{ option }}
|
||||
</option>
|
||||
</select>
|
||||
{{-- <span>Selected: @{{ item.type }}</span> --}}
|
||||
</td>
|
||||
<td>
|
||||
{!! Form::select('references['.$reference->id.'][relation]', $relationTypes, $reference->relation,
|
||||
['placeholder' => '[relation type]', 'v-model' =>
|
||||
'item.relation', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!}
|
||||
{{-- {!! Form::select('references['.$reference->id.'][relation]', $relationTypes, $reference->relation,
|
||||
['placeholder' => '[REFERENCE TYPE]', 'v-model' => 'item.relation', "v-validate" => "'required'"]) !!} --}}
|
||||
<select v-bind:name="'references[' + item.id +'][relation]'" v-model="item.relation" class="form-control" v-validate="'required'">
|
||||
<option v-for="option in relationTypes" :value='option'>
|
||||
@{{ option }}
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<button v-if="item.id == undefined" class="pure-button button-small is-warning"
|
||||
@click.prevent="removeReference(index)">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
{{-- @endforeach --}}
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
{{-- @else
|
||||
<span>...there are no references</span>
|
||||
@endif
|
||||
@endif --}}
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="fieldset-keywords">
|
||||
<legend>Dataset Keywords</legend>
|
||||
{{-- <table class="table table-hover" v-if="dataset.keywords.length"> --}}
|
||||
<button class="pure-button button-small" @click.prevent="addKeyword()">Add Keyword</button>
|
||||
@if ($dataset->subjects->count() > 0)
|
||||
<table id="keywords" class="pure-table pure-table-horizontal">
|
||||
<thead>
|
||||
|
@ -322,28 +466,33 @@
|
|||
<th style="width: 130px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody>
|
||||
{{-- @foreach($dataset->subjects as $key => $keyword) --}}
|
||||
<tr>
|
||||
<tr v-for="(item, index) in form.subjects" :key="item.id">
|
||||
<tr v-for="(item, index) in form.subjects" :key="item.id">
|
||||
<td>
|
||||
<input v-bind:name="'subjects[' + item.id +'][value]'" class="form-control" placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" />
|
||||
{{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }} --}}
|
||||
<input v-bind:name="'subjects[' + item.id +'][value]'" class="form-control"
|
||||
placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" />
|
||||
{{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }}
|
||||
--}}
|
||||
</td>
|
||||
<td>
|
||||
{{-- {!! Form::select('keywords['.$keyword->id.'][type]', $keywordTypes, $keyword->type, ['placeholder'
|
||||
=> '[keyword type]', 'v-model' =>
|
||||
'item.type', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!} --}}
|
||||
'item.type', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!} --}}
|
||||
{{-- <select v-bind:name="'keywords[' + item.id +'][type]'" v-model="item.type" class="form-control">
|
||||
<option value="" disabled>[keyword type]</option>
|
||||
@foreach($keywordTypes as $option)
|
||||
<option value="{{ $option }}">{{ $option }}</option>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</select> --}}
|
||||
<input v-bind:name="'subjects[' + item.id +'][type]'" readonly class="form-control" placeholder="[KEYWORD TYPE]" v-model="item.type" v-validate="'required'" />
|
||||
<input v-bind:name="'subjects[' + item.id +'][type]'" readonly class="form-control"
|
||||
placeholder="[KEYWORD TYPE]" v-model="item.type" v-validate="'required'" />
|
||||
</td>
|
||||
<td>
|
||||
{{-- <button class="pure-button button-small is-warning" @click.prevent="removeKeyword(index)">Remove</button> --}}
|
||||
<button v-if="item.id == undefined" class="pure-button button-small is-warning"
|
||||
@click.prevent="removeKeyword(index)">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{{-- @endforeach --}}
|
||||
|
@ -372,11 +521,14 @@
|
|||
@else
|
||||
<span class="alert">missing file: {{ $file->path_name }}</span>
|
||||
@endif --}}
|
||||
<a v-if="'storage/' + file.path_name" v-bind:src= " '/settings/file/download/' + file.id ">@{{ file.path_name }}</a>
|
||||
<a v-if="'storage/' + file.path_name"
|
||||
v-bind:src=" '/settings/file/download/' + file.id ">@{{ file.path_name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{-- {{ Form::text('files['.$file->id.'][label]', $file->label, ['class' => 'form-control', 'placeholder' => '[FILE LABEL]']) }} --}}
|
||||
<input v-bind:name="'files[' + file.id +'][label]'" class="form-control" placeholder="[FILE LABEL]" v-model="file.label" v-validate="'required'" />
|
||||
<td>
|
||||
{{-- {{ Form::text('files['.$file->id.'][label]', $file->label, ['class' => 'form-control', 'placeholder' => '[FILE LABEL]']) }}
|
||||
--}}
|
||||
<input v-bind:name="'files[' + file.id +'][label]'" class="form-control" placeholder="[FILE LABEL]"
|
||||
v-model="file.label" v-validate="'required'" />
|
||||
</td>
|
||||
</tr>
|
||||
{{-- @endforeach --}}
|
||||
|
|
|
@ -54,7 +54,9 @@
|
|||
'form' => $dataset,
|
||||
'projects' => $projects,
|
||||
'licenses' => $licenses,
|
||||
'checkeds' => $checkeds
|
||||
'checkeds' => $checkeds,
|
||||
'referenceTypes' => $referenceTypes,
|
||||
'relationTypes' => $relationTypes
|
||||
]); ?>
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue