add geolocation for datacite metadata anf for backend

This commit is contained in:
Arno Kaimbacher 2019-01-07 11:16:18 +01:00
parent e7d8dc21a0
commit ba38fc1ed1
16 changed files with 3833 additions and 6047 deletions

View file

@ -1,44 +1,62 @@
<script>
// <script>
import Vue from "vue";
let dataset = new Vue({
//outside of the component:
function initialState() {
return {
type: "",
state: "",
rights: null,
project_id: "",
creating_corporation: "GBA",
embargo_date: "",
belongs_to_bibliography: 0,
title_main: {
value: "",
language: ""
},
abstract_main: {
value: "",
language: ""
},
geolocation: {
xmin: "",
ymin: "",
xmax: "",
ymax: ""
},
checkedAuthors: [],
checkedLicenses: [], // [],
files: [],
references: [],
checkedContributors: [],
checkedSubmitters: [],
persons: [],
contributors: [],
submitters: []
};
}
const dataset = new Vue({
data: function() {
return {
type: "",
state: "",
rights: null,
project_id: "",
creating_corporation: "GBA",
embargo_date: "",
belongs_to_bibliography: 0,
title_main: {
value: "",
language: ""
},
abstract_main: {
value: "",
language: ""
},
checkedAuthors: [],
checkedLicenses: [], // [],
files: [],
references: [],
checkedContributors: [],
checkedSubmitters: [],
persons: [],
contributors: [],
submitters: []
};
return initialState();
},
created() {
let json = JSON.stringify(this.$data);
this.reset = () => {
Object.assign(this.$data, JSON.parse(json));
};
created: function() {
// let json = JSON.stringify(this.$data);
// this.reset = () => {
// Object.assign(this.$data, JSON.parse(json));
// };
// this.reset(json);
},
methods: {
reset() {
Object.assign(this.$data, initialState());
}
}
});
export { dataset };
export default dataset;
//export { dataset };
</script>

View file

@ -30,7 +30,7 @@ import axios from 'axios';
//Vue.component('my-autocomplete', require('./components/MyAutocomplete.vue'));
import MyAutocomplete from './components/MyAutocomplete.vue';
import VeeValidate from 'vee-validate';
import { dataset } from './components/Dataset';
import dataset from './components/Dataset';
// import { Validator } from 'vee-validate';
Vue.use(VeeValidate);
@ -179,6 +179,11 @@ const app = new Vue({
formData.append('abstract_main[value]', this.dataset.abstract_main.value);
formData.append('abstract_main[language]', this.dataset.abstract_main.language);
formData.append('geolocation[xmin]', this.dataset.geolocation.xmin);
formData.append('geolocation[ymin]', this.dataset.geolocation.ymin);
formData.append('geolocation[xmax]', this.dataset.geolocation.xmax);
formData.append('geolocation[ymax]', this.dataset.geolocation.ymax);
for (var i = 0; i < this.dataset.checkedLicenses.length; i++) {
formData.append('licenses[' + i + ']', this.dataset.checkedLicenses[i]);
}

View file

@ -139,6 +139,32 @@
</div>
</fieldset>
<fieldset id="fieldset-titles">
<legend>Bounding Box</legend>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Xmin', 'xmin: ') !!}
{!! Form::text('GeoLocation[xmin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmin']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Ymin', 'ymin: ') !!}
{!! Form::text('GeoLocation[ymin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymin']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Xmax', 'xmax: ') !!}
{!! Form::text('GeoLocation[xmax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmax']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Ymax', 'ymax: ') !!}
{!! Form::text('GeoLocation[ymax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymax']) !!}
</div>
</div>
</fieldset>
<fieldset id="fieldset-titles">
<legend>Main Title & Abstract</legend>
<div class="pure-g">