- edit Dataset before release to editor

- robots.txt avoid search bots
- adapt Dataset.ts and LocationsMap.ts for edit form
- edit createForm for new dataset attributes
- vue-countdown.vue 1800 seconds
This commit is contained in:
Arno Kaimbacher 2019-12-20 11:44:40 +01:00
parent 37a77d019b
commit 43d98a1f82
27 changed files with 1139 additions and 353 deletions

View File

@ -16,11 +16,13 @@ use App\Models\File;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\View\View; // use Illuminate\View\View;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
// use App\Models\Coverage; // use App\Models\Coverage;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Carbon\Carbon; use Carbon\Carbon;
use \Exception;
class EditorController extends Controller class EditorController extends Controller
{ {
@ -34,7 +36,7 @@ class EditorController extends Controller
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function index(): View public function index(): \Illuminate\Contracts\View\View
{ {
$user = Auth::user(); $user = Auth::user();
$user_id = $user->id; $user_id = $user->id;
@ -50,7 +52,7 @@ class EditorController extends Controller
}) })
->orderBy('server_date_modified', 'desc') ->orderBy('server_date_modified', 'desc')
->get(); ->get();
return view('workflow.editor.index', compact('datasets')); return View::make('workflow.editor.index', compact($datasets));
} }
/** /**
@ -59,11 +61,11 @@ class EditorController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function receive($id): View public function receive($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::with('user:id,login')->findOrFail($id); $dataset = Dataset::with('user:id,login')->findOrFail($id);
return view('workflow.editor.receive', [ return View::make('workflow.editor.receive', [
'dataset' => $dataset, 'dataset' => $dataset,
]); ]);
} }
@ -90,7 +92,7 @@ class EditorController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function edit($id): View public function edit($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::findOrFail($id); $dataset = Dataset::findOrFail($id);
$dataset->load('licenses', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references'); $dataset->load('licenses', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references');
@ -109,8 +111,13 @@ class EditorController extends Controller
->pluck('part1', 'part1'); ->pluck('part1', 'part1');
//$options = License::all(); //$options = License::all();
$options = License::all('id', 'name_long'); // $options = License::all('id', 'name_long');
$checkeds = $dataset->licenses->pluck('id')->toArray(); $licenses = License::select('id', 'name_long', 'link_licence')
->orderBy('sort_order')
->get();
//$checkeds = $dataset->licenses->pluck('id')->toArray();
$checkeds = $dataset->licenses->first()->id;
$keywordTypes = ['uncontrolled' => 'uncontrolled', 'swd' => 'swd']; $keywordTypes = ['uncontrolled' => 'uncontrolled', 'swd' => 'swd'];
$referenceTypes = ["rdr-id", "arXiv", "bibcode", "DOI", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISSN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "URL", "URN"]; $referenceTypes = ["rdr-id", "arXiv", "bibcode", "DOI", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISSN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "URL", "URN"];
@ -121,12 +128,12 @@ class EditorController extends Controller
$relationTypes = array_combine($relationTypes, $relationTypes); $relationTypes = array_combine($relationTypes, $relationTypes);
return view( return View::make(
'workflow.editor.edit', 'workflow.editor.edit',
compact( compact(
'dataset', 'dataset',
'projects', 'projects',
'options', 'licenses',
'checkeds', 'checkeds',
'years', 'years',
'languages', 'languages',
@ -168,7 +175,7 @@ class EditorController extends Controller
], ],
]; ];
$validator = Validator::make($request->all(), $rules); $validator = Validator::make($request->all(), $rules);
if ($validator->passes()) { if (!$validator->fails()) {
$dataset = Dataset::findOrFail($id); $dataset = Dataset::findOrFail($id);
$data = $request->all(); $data = $request->all();
$input = $request->except('abstracts', 'licenses', 'titles', 'coverage', '_method', '_token'); $input = $request->except('abstracts', 'licenses', 'titles', 'coverage', '_method', '_token');
@ -271,7 +278,7 @@ class EditorController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function approve($id): View public function approve($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::with('user:id,login')->findOrFail($id); $dataset = Dataset::with('user:id,login')->findOrFail($id);
@ -279,7 +286,7 @@ class EditorController extends Controller
$q->where('name', 'reviewer'); $q->where('name', 'reviewer');
})->pluck('login', 'id'); })->pluck('login', 'id');
return view('workflow.editor.approve', [ return View::make('workflow.editor.approve', [
'dataset' => $dataset, 'dataset' => $dataset,
'reviewers' => $reviewers, 'reviewers' => $reviewers,
]); ]);
@ -320,17 +327,17 @@ class EditorController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function reject($id): View public function reject($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::with('user:id,login')->findOrFail($id); $dataset = Dataset::with('user:id,login')->findOrFail($id);
return view('workflow.editor.reject', [ return View::make('workflow.editor.reject', [
'dataset' => $dataset, 'dataset' => $dataset,
]); ]);
} }
public function rejectUpdate(Request $request, $id) public function rejectUpdate(Request $request, $id)
{ {
$this->validate(request(), [ $this->validate($request, [
'reject_editor_note' => 'required|min:10|max:500', 'reject_editor_note' => 'required|min:10|max:500',
'server_state' => 'required' 'server_state' => 'required'
]); ]);
@ -353,7 +360,7 @@ class EditorController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function publish($id): View public function publish($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::query() $dataset = Dataset::query()
->with([ ->with([
@ -363,7 +370,7 @@ class EditorController extends Controller
} }
])->findOrFail($id); ])->findOrFail($id);
return view('workflow.editor.publish', [ return View::make('workflow.editor.publish', [
'dataset' => $dataset, 'dataset' => $dataset,
]); ]);
} }

View File

@ -9,7 +9,8 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\View\View; // use Illuminate\View\View;
use Illuminate\Support\Facades\View;
// for edit actions: // for edit actions:
use App\Models\Project; use App\Models\Project;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@ -20,6 +21,8 @@ use App\Models\Title;
use App\Models\Description; use App\Models\Description;
use App\Models\File; use App\Models\File;
use App\Models\Subject; use App\Models\Subject;
use App\Models\DatasetReference;
use Exception;
class SubmitController extends Controller class SubmitController extends Controller
{ {
@ -28,7 +31,7 @@ class SubmitController extends Controller
//$this->middleware('auth'); //$this->middleware('auth');
} }
public function index(): View public function index(): \Illuminate\Contracts\View\View
{ {
$user = Auth::user(); $user = Auth::user();
$user_id = $user->id; $user_id = $user->id;
@ -42,7 +45,7 @@ class SubmitController extends Controller
->with('user:id,login') ->with('user:id,login')
->orderBy('server_date_modified', 'desc') ->orderBy('server_date_modified', 'desc')
->get(); ->get();
return view('workflow.submitter.index', [ return View::make('workflow.submitter.index', [
'datasets' => $myDatasets, 'datasets' => $myDatasets,
]); ]);
} }
@ -53,7 +56,7 @@ class SubmitController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function edit($id): View public function edit($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::findOrFail($id); $dataset = Dataset::findOrFail($id);
$dataset->load('licenses', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references'); $dataset->load('licenses', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references');
@ -70,26 +73,30 @@ class SubmitController extends Controller
$languages = DB::table('languages') $languages = DB::table('languages')
->where('active', true) ->where('active', true)
->pluck('part1', 'part1'); ->pluck('part1', 'part1');
//$options = License::all(); // $options = License::all('id', 'name_long');
$options = License::all('id', 'name_long'); $licenses = License::select('id', 'name_long', 'link_licence')
$checkeds = $dataset->licenses->pluck('id')->toArray(); ->orderBy('sort_order')
->get();
// $checkeds = $dataset->licenses->pluck('id')->toArray();
$checkeds = $dataset->licenses->first()->id;
$keywordTypes = ['uncontrolled' => 'uncontrolled', 'swd' => 'swd']; $keywordTypes = ['uncontrolled' => 'uncontrolled', 'swd' => 'swd'];
$referenceTypes = ["rdr-id", "arXiv", "bibcode", "DOI", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISSN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "URL", "URN"]; $referenceTypes = ["rdr-id", "arXiv", "bibcode", "DOI", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISSN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "URL", "URN"];
$referenceTypes = array_combine($referenceTypes, $referenceTypes); $referenceTypes = array_combine($referenceTypes, $referenceTypes);
$relationTypes = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "HasMetadata", "IsMetadataFor","IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsReferencedBy", "References"]; $relationTypes = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "HasMetadata", "IsMetadataFor","IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsReferencedBy", "References", "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf"];
// "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf"];
$relationTypes = array_combine($relationTypes, $relationTypes); $relationTypes = array_combine($relationTypes, $relationTypes);
return view( return View::make(
'workflow.submitter.edit', 'workflow.submitter.edit',
compact( compact(
'dataset', 'dataset',
'projects', 'projects',
'options', 'licenses',
'checkeds', 'checkeds',
'years', 'years',
'languages', 'languages',
@ -129,12 +136,18 @@ class SubmitController extends Controller
'nullable', 'nullable',
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/' 'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
], ],
'keywords.*.value' => 'required|string',
'keywords.*.type' => 'required|string',
'files.*.label' => 'required|string',
]; ];
$validator = Validator::make($request->all(), $rules); $customMessages = [
if ($validator->passes()) { 'keywords.*.type.required' => 'The types of all keywords are required.'
];
$validator = Validator::make($request->all(), $rules, $customMessages);
if (!$validator->fails()) {
$dataset = Dataset::findOrFail($id); $dataset = Dataset::findOrFail($id);
$data = $request->all(); $data = $request->all();
$input = $request->except('abstracts', 'licenses', 'titles', 'coverage', '_method', '_token'); $input = $request->except('abstracts', 'licenses', 'titles', 'coverage', 'subjects', 'files', '_method', '_token');
$licenses = $request->input('licenses'); $licenses = $request->input('licenses');
//$licenses = $input['licenses']; //$licenses = $input['licenses'];
@ -147,7 +160,9 @@ class SubmitController extends Controller
$title = Title::findOrFail($key); $title = Title::findOrFail($key);
$title->value = $formTitle['value']; $title->value = $formTitle['value'];
$title->language = $formTitle['language']; $title->language = $formTitle['language'];
$title->save(); if ($title->isDirty()) {
$title->save();
}
} }
} }
@ -158,7 +173,9 @@ class SubmitController extends Controller
$abstract = Description::findOrFail($key); $abstract = Description::findOrFail($key);
$abstract->value = $formAbstract['value']; $abstract->value = $formAbstract['value'];
$abstract->language = $formAbstract['language']; $abstract->language = $formAbstract['language'];
$abstract->save(); if ($abstract->isDirty()) {
$abstract->save();
}
} }
} }
@ -171,18 +188,22 @@ class SubmitController extends Controller
$reference->label = $formReference['label']; $reference->label = $formReference['label'];
$reference->type = $formReference['type']; $reference->type = $formReference['type'];
$reference->relation = $formReference['relation']; $reference->relation = $formReference['relation'];
$reference->save(); if ($reference->isDirty()) {
$reference->save();
}
} }
} }
//save the keywords: //save the keywords:
$keywords = $request->input('keywords'); $keywords = $request->input('subjects');
if (is_array($keywords) && count($keywords) > 0) { if (is_array($keywords) && count($keywords) > 0) {
foreach ($keywords as $key => $formKeyword) { foreach ($keywords as $key => $formKeyword) {
$subject = Subject::findOrFail($key); $subject = Subject::findOrFail($key);
$subject->value = $formKeyword['value']; $subject->value = $formKeyword['value'];
$subject->type = $formKeyword['type']; $subject->type = $formKeyword['type'];
$subject->save(); if ($subject->isDirty()) {
$subject->save();
}
} }
} }
@ -192,20 +213,28 @@ class SubmitController extends Controller
foreach ($files as $key => $formFile) { foreach ($files as $key => $formFile) {
$file = File::findOrFail($key); $file = File::findOrFail($key);
$file->label = $formFile['label']; $file->label = $formFile['label'];
$file->save(); if ($file->isDirty()) {
$file->save();
}
} }
} }
// save coverage // save coverage
if (isset($data['coverage'])) { if (isset($data['coverage']) && !$this->containsOnlyNull($data['coverage'])) {
$formCoverage = $request->input('coverage'); $formCoverage = $request->input('coverage');
$coverage = $dataset->coverage()->updateOrCreate( $coverage = $dataset->coverage()->updateOrCreate(
['dataset_id' => $dataset->id], ['dataset_id' => $dataset->id],
$formCoverage $formCoverage
); );
} elseif (isset($data['coverage']) && $this->containsOnlyNull($data['coverage'])
&& !is_null($dataset->coverage)) {
$dataset->coverage()->delete();
} }
if (!$dataset->isDirty(dataset::UPDATED_AT)) { $dataset->fill($input);
// $dataset->creating_corporation = "Peter";
if (!$dataset->isDirty()) {
$time = new \Illuminate\Support\Carbon(); $time = new \Illuminate\Support\Carbon();
$dataset->setUpdatedAt($time); $dataset->setUpdatedAt($time);
} }
@ -222,12 +251,19 @@ class SubmitController extends Controller
// 'success' => false, // 'success' => false,
// 'errors' => $validator->errors()->all(), // 'errors' => $validator->errors()->all(),
// ], 422); // ], 422);
return back() return back()->withInput()
->withErrors($validator->errors()->all()); ->withErrors($validator->errors()->all());
} }
throw new GeneralException(trans('exceptions.backend.dataset.update_error')); throw new GeneralException(trans('exceptions.backend.dataset.update_error'));
} }
private function containsOnlyNull($input)
{
return empty(array_filter($input, function ($a) {
return $a !== null;
}));
}
/** /**
* Display the specified resource. * Display the specified resource.
@ -235,7 +271,7 @@ class SubmitController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function release($id): View public function release($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::with('user:id,login')->findOrFail($id); $dataset = Dataset::with('user:id,login')->findOrFail($id);
@ -244,7 +280,7 @@ class SubmitController extends Controller
})->pluck('login', 'id'); })->pluck('login', 'id');
//$editors = Role::where('name', 'editor')->first()->users()->get(); //$editors = Role::where('name', 'editor')->first()->users()->get();
return view('workflow.submitter.release', [ return View::make('workflow.submitter.release', [
'dataset' => $dataset, 'dataset' => $dataset,
'editors' => $editors, 'editors' => $editors,
]); ]);
@ -288,11 +324,11 @@ class SubmitController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function delete($id): View public function delete($id): \Illuminate\Contracts\View\View
{ {
$dataset = Dataset::with('user:id,login')->findOrFail($id); $dataset = Dataset::with('user:id,login')->findOrFail($id);
return view('workflow.submitter.delete', [ return View::make('workflow.submitter.delete', [
'dataset' => $dataset 'dataset' => $dataset
]); ]);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@
"/backend/publish/datasetPublish.js": "/backend/publish/datasetPublish.js", "/backend/publish/datasetPublish.js": "/backend/publish/datasetPublish.js",
"/css/app1.css": "/css/app1.css", "/css/app1.css": "/css/app1.css",
"/css/font-awesome.css": "/css/font-awesome.css", "/css/font-awesome.css": "/css/font-awesome.css",
"/backend/publish/mainEditDataset.js": "/backend/publish/mainEditDataset.js",
"/backend/publish/releaseDataset.js": "/backend/publish/releaseDataset.js", "/backend/publish/releaseDataset.js": "/backend/publish/releaseDataset.js",
"/js/app.js": "/js/app.js", "/js/app.js": "/js/app.js",
"/js/lib.js": "/js/lib.js", "/js/lib.js": "/js/lib.js",

View File

@ -1,2 +1,2 @@
User-agent: * User-agent: *
Disallow: Disallow: /

144
resources/js/EditDataset.js Normal file
View File

@ -0,0 +1,144 @@
import { Component, Vue, Watch } from 'vue-property-decorator';
import axios from 'axios';
import VeeValidate from 'vee-validate';
Vue.use(VeeValidate);
import LocationsMap from './components/locations-map.vue';
import Dataset from './components/Dataset';
@Component({
components: {
LocationsMap
}
})
export default class EditDataset extends Vue {
// form: {},
projects = [];
checkeds = '';
form = new Dataset();
// form = {
// // reject_reviewer_note: '',
// language: '',
// type: '',
// project_id: '',
// creating_corporation: 'TETHYS Repository',
// embargo_date: '',
// coverage: {
// xmin: "",
// ymin: "",
// xmax: "",
// ymax: "",
// elevation_min: "",
// elevation_max: "",
// elevation_absolut: "",
// depth_min: "",
// depth_max: "",
// depth_absolut: "",
// time_min: "",
// time_max: "",
// time_absolut: ""
// },
// // checkedAuthors: [],
// // checkedLicenses: [],
// // files: [],
// // keywords: [],
// // references: [],
// titles: [],
// abstratcs: [],
// clicenses : []
// // checkedContributors: []
// };
allErros = [];
success = false;
beforeMount() {
// this.form = window.Laravel.form;
this.realMerge(this.form, window.Laravel.form);
this.projects = window.Laravel.projects;
this.licenses = window.Laravel.licenses;
this.checkeds = window.Laravel.checkeds;
}
/*
* Recursively merge properties of two objects
*/
realMerge(from, dbObject) {
for (var prop in dbObject) {
try {
if (typeof dbObject[prop] !== 'object') {
from[prop] = dbObject[prop];
} else if (this.isObject(dbObject[prop])) {
from[prop] = this.realMerge(from[prop], dbObject[prop]);
}
else if (this.isObject(dbObject[prop]) || this.isObject(from[prop])) {
// coverage relation if null from dbObject
from[prop] = from[prop];
}
else if (Array.isArray(dbObject[prop])) {
from[prop] = dbObject[prop];
}
else {
from[prop] = null;
}
} catch (e) {
// Property in destination object not set; create it and set its value.
from[prop] = dbObject[prop];
}
}
if (from.embargo_date) {
from.embargo_date = this.formatDateFormat(new Date(from.embargo_date), 'yyyy-MM-dd');
}
return from;
}
formatDateFormat(x, y) {
var z = {
M: x.getMonth() + 1,
d: x.getDate(),
h: x.getHours(),
m: x.getMinutes(),
s: x.getSeconds()
};
y = y.replace(/(M+|d+|h+|m+|s+)/g, function (v) {
return ((v.length > 1 ? "0" : "") + eval('z.' + v.slice(-1))).slice(-2)
});
return y.replace(/(y+)/g, function (v) {
return x.getFullYear().toString().slice(-v.length)
});
}
isObject(item) {
return (typeof item === "object" && !Array.isArray(item) && item !== null);
}
onSubmit() {
// var dataform = new FormData();
// dataform.append('name', this.form.name);
// // dataform.append('comments', this.form.comments);
// console.log(this.form.name);
// axios.post('/vuevalidation/form', dataform).then(response => {
// console.log(response);
// this.allerros = [];
// this.form.name = '';
// this.form.comments = [];
// this.success = true;
// }).catch((error) => {
// this.allerros = error.response.data.errors;
// this.success = false;
// });
this.submitted = true;
this.$validator.validate().then(result => {
if (result) {
// console.log('From Submitted!');
document.getElementById("submitEditForm").submit();
return;
}
});
}
}

View File

@ -4,7 +4,7 @@ import { Component, Vue, Watch } from 'vue-property-decorator';
function initialState() { function initialState() {
return { return {
type: "", type: "",
state: "", server_state: "",
rights: null, rights: null,
project_id: "", project_id: "",
@ -28,27 +28,27 @@ function initialState() {
// ymax: "" // ymax: ""
// }, // },
coverage: { coverage: {
xmin: "", x_min: null,
ymin: "", y_min:null,
xmax: "", x_max: null,
ymax: "", y_max: null,
elevation_min: "", elevation_min: null,
elevation_max: "", elevation_max: null,
elevation_absolut: "", elevation_absolut: null,
depth_min: "", depth_min: null,
depth_max: "", depth_max: null,
depth_absolut: "", depth_absolut: null,
time_min: "", time_min: null,
time_max: "", time_max: null,
time_absolut: "" time_absolut: null
}, },
checkedAuthors: [], checkedAuthors: [],
checkedLicenses: [], // [], checkedLicenses: [], // [],
files: [], files: [],
keywords: [], subjects: [],
references: [], references: [],
titles: [], titles: [],
descriptions: [], abstratcs: [],
checkedContributors: [], checkedContributors: [],
// checkedSubmitters: [], // checkedSubmitters: [],
@ -66,7 +66,7 @@ export default class Dataset extends Vue {
// } // }
initialState = {}; initialState = {};
type = ""; type = "";
state = ""; server_state = "";
rights = null; rights = null;
project_id = ""; project_id = "";
@ -90,10 +90,10 @@ export default class Dataset extends Vue {
// ymax: "" // ymax: ""
// }, // },
coverage = { coverage = {
xmin: "", x_min: "",
ymin: "", y_min: "",
xmax: "", x_max: "",
ymax: "", y_max: "",
elevation_min: "", elevation_min: "",
elevation_max: "", elevation_max: "",
elevation_absolut: "", elevation_absolut: "",
@ -107,10 +107,10 @@ export default class Dataset extends Vue {
checkedAuthors = []; checkedAuthors = [];
checkedLicenses = []; checkedLicenses = [];
files = []; files = [];
keywords = []; subjects = [];
references = []; references = [];
titles = []; titles = [];
descriptions = []; abstracts = [];
checkedContributors = []; checkedContributors = [];
// checkedSubmitters: [], // checkedSubmitters: [],

View File

@ -7,7 +7,6 @@ export default class DeleteButton extends L.Control {
faIcon: 'fa-trash', faIcon: 'fa-trash',
id: "", id: "",
text: "" text: ""
// faIcon: 'fa-check-circle'
}; };
geolocation = null; geolocation = null;
@ -16,16 +15,6 @@ export default class DeleteButton extends L.Control {
_map = null; _map = null;
_container = null; _container = null;
//constructor:
// initialize(options) {
// //util.mixin(this.options, options);
// L.Util.setOptions(this, options);
// // properties
// this.geolocation = options.geolocation;
// this.drawnItems = options.drawnItems;
// this.bounds = options.bounds;
// }
constructor(options) { constructor(options) {
super(); super();
//util.mixin(this.options, options); //util.mixin(this.options, options);
@ -47,11 +36,6 @@ export default class DeleteButton extends L.Control {
this._container.style.width = "30px"; this._container.style.width = "30px";
this._container.style.height = "30px"; this._container.style.height = "30px";
this._buildButton(); this._buildButton();
// container.onclick = function() {
// console.log("buttonClicked");
// };
return this._container; return this._container;
} }
@ -68,10 +52,10 @@ export default class DeleteButton extends L.Control {
} }
L.DomEvent.on(_link, 'click', function (ev) { L.DomEvent.on(_link, 'click', function (ev) {
this.drawnItems.clearLayers(); this.drawnItems.clearLayers();
this.options.geolocation.xmin = ""; this.options.geolocation.x_min = "";
this.options.geolocation.ymin = ""; this.options.geolocation.y_min = "";
this.options.geolocation.xmax = ""; this.options.geolocation.x_max = "";
this.options.geolocation.ymax = ""; this.options.geolocation.y_max = "";
this._map.fitBounds(this.bounds); this._map.fitBounds(this.bounds);
}, },
this); this);

View File

@ -136,11 +136,11 @@ export default class LocationsMap extends Vue {
// if (type === "rectancle") { // if (type === "rectancle") {
// layer.bindPopup("A popup!" + layer.getBounds().toBBoxString()); // layer.bindPopup("A popup!" + layer.getBounds().toBBoxString());
var bounds = layer.getBounds(); var bounds = layer.getBounds();
this.geolocation.xmin = bounds.getSouthWest().lng; this.geolocation.x_min = bounds.getSouthWest().lng;
this.geolocation.ymin = bounds.getSouthWest().lat; this.geolocation.y_min = bounds.getSouthWest().lat;
// console.log(this.geolocation.xmin); // console.log(this.geolocation.xmin);
this.geolocation.xmax = bounds.getNorthEast().lng; this.geolocation.x_max = bounds.getNorthEast().lng;
this.geolocation.ymax = bounds.getNorthEast().lat; this.geolocation.y_max = bounds.getNorthEast().lat;
// } // }
drawnItems.addLayer(layer); drawnItems.addLayer(layer);
@ -166,7 +166,7 @@ export default class LocationsMap extends Vue {
} }
get validBoundingBox(): boolean { get validBoundingBox(): boolean {
if (this.geolocation.xmin != "" && this.geolocation.ymin != "" && this.geolocation.xmax != "" && this.geolocation.ymax != "" ) { if (this.geolocation.x_min != "" && this.geolocation.y_min != "" && this.geolocation.x_max != "" && this.geolocation.y_max != "" ) {
return true; return true;
} }
return false; return false;

View File

@ -90,7 +90,7 @@ import { Component, Inject, Vue, Prop, Watch } from "vue-property-decorator";
components: { draggable } components: { draggable }
}) })
export default class PersonTable extends Vue { export default class PersonTable extends Vue {
@Inject("$validator") readonly $validator!: string; @Inject("$validator") readonly $validator;
// inject: { // inject: {
// $validator: "$validator" // $validator: "$validator"
// }, // },

View File

@ -8,10 +8,10 @@
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
<label for="xmin">xmin:</label> <label for="xmin">xmin:</label>
<input <input
name="xmin" name="coverage[x_min]"
type="text" type="text"
class="pure-u-23-24" class="pure-u-23-24"
v-model="geolocation.xmin" v-model="geolocation.x_min"
data-vv-scope="step-2" data-vv-scope="step-2"
id="xmin" id="xmin"
v-validate="'decimal'" v-validate="'decimal'"
@ -21,10 +21,10 @@
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
<label for="ymin">ymin:</label> <label for="ymin">ymin:</label>
<input <input
name="ymin" name="coverage[y_min]"
type="text" type="text"
class="pure-u-23-24" class="pure-u-23-24"
v-model="geolocation.ymin" v-model="geolocation.y_min"
data-vv-scope="step-2" data-vv-scope="step-2"
id="ymin" id="ymin"
v-validate="'decimal'" v-validate="'decimal'"
@ -34,10 +34,10 @@
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
<label for="xmax">xmax:</label> <label for="xmax">xmax:</label>
<input <input
name="xmax" name="coverage[x_max]"
type="text" type="text"
class="pure-u-23-24" class="pure-u-23-24"
v-model="geolocation.xmax" v-model="geolocation.x_max"
data-vv-scope="step-2" data-vv-scope="step-2"
id="xmax" id="xmax"
v-validate="'decimal'" v-validate="'decimal'"
@ -47,10 +47,10 @@
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
<label for="ymax">ymax:</label> <label for="ymax">ymax:</label>
<input <input
name="ymax" name="coverage[y_max]"
type="text" type="text"
class="pure-u-23-24" class="pure-u-23-24"
v-model="geolocation.ymax" v-model="geolocation.y_max"
data-vv-scope="step-2" data-vv-scope="step-2"
id="ymax" id="ymax"
v-validate="'decimal'" v-validate="'decimal'"

View File

@ -1,5 +1,5 @@
<template> <template>
<div v-show="warningSeconds <= 600" class="vue-countdown"> <div v-show="warningSeconds <= 1800" class="vue-countdown">
<div class="vue-countdown--time"> <div class="vue-countdown--time">
remaining time: {{ time }} remaining time: {{ time }}
</div> </div>

View File

@ -150,7 +150,7 @@ const app = new Vue({
}, },
computed: { computed: {
keywords_length() { keywords_length() {
return this.dataset.keywords.length; return this.dataset.subjects.length;
}, },
isInitial() { isInitial() {
return this.currentStatus === STATUS_INITIAL; return this.currentStatus === STATUS_INITIAL;
@ -249,7 +249,7 @@ const app = new Vue({
formData.append('server_state', status); formData.append('server_state', status);
formData.append('type', this.dataset.type); formData.append('type', this.dataset.type);
formData.append('language', this.dataset.language); formData.append('language', this.dataset.language);
// formData.append('server_state', this.dataset.state); // formData.append('server_state', this.dataset.server_state);
formData.append('rights', Number(this.dataset.rights)); formData.append('rights', Number(this.dataset.rights));
formData.append('creating_corporation', this.dataset.creating_corporation); formData.append('creating_corporation', this.dataset.creating_corporation);
formData.append('project_id', this.dataset.project_id); formData.append('project_id', this.dataset.project_id);
@ -262,10 +262,10 @@ const app = new Vue({
if (this.dataset.coverage.xmin !== "" && this.dataset.coverage.ymin != '' && if (this.dataset.coverage.xmin !== "" && this.dataset.coverage.ymin != '' &&
this.dataset.coverage.xmax !== '' && this.dataset.coverage.ymax !== '') { this.dataset.coverage.xmax !== '' && this.dataset.coverage.ymax !== '') {
formData.append('coverage[x_min]', this.dataset.coverage.xmin); formData.append('coverage[x_min]', this.dataset.coverage.x_min);
formData.append('coverage[y_min]', this.dataset.coverage.ymin); formData.append('coverage[y_min]', this.dataset.coverage.y_min);
formData.append('coverage[x_max]', this.dataset.coverage.xmax); formData.append('coverage[x_max]', this.dataset.coverage.x_max);
formData.append('coverage[y_max]', this.dataset.coverage.ymax); formData.append('coverage[y_max]', this.dataset.coverage.y_max);
} }
if (this.isElevationAbsolut) { if (this.isElevationAbsolut) {
@ -337,8 +337,8 @@ const app = new Vue({
formData.append('references[' + i + '][relation]', reference.relation); formData.append('references[' + i + '][relation]', reference.relation);
} }
for (var i = 0; i < this.dataset.keywords.length; i++) { for (var i = 0; i < this.dataset.subjects.length; i++) {
let keyword = this.dataset.keywords[i]; let keyword = this.dataset.subjects[i];
formData.append('keywords[' + i + '][value]', keyword.value); formData.append('keywords[' + i + '][value]', keyword.value);
formData.append('keywords[' + i + '][type]', keyword.type); formData.append('keywords[' + i + '][type]', keyword.type);
formData.append('keywords[' + i + '][language]', keyword.language); formData.append('keywords[' + i + '][language]', keyword.language);
@ -351,8 +351,8 @@ const app = new Vue({
formData.append('titles[' + i + '][type]', title.type); formData.append('titles[' + i + '][type]', title.type);
} }
for (var i = 0; i < this.dataset.descriptions.length; i++) { for (var i = 0; i < this.dataset.abstracts.length; i++) {
let description = this.dataset.descriptions[i]; let description = this.dataset.abstracts[i];
formData.append('descriptions[' + i + '][value]', description.value); formData.append('descriptions[' + i + '][value]', description.value);
formData.append('descriptions[' + i + '][language]', description.language); formData.append('descriptions[' + i + '][language]', description.language);
formData.append('descriptions[' + i + '][type]', description.type); formData.append('descriptions[' + i + '][type]', description.type);
@ -453,13 +453,13 @@ const app = new Vue({
addKeyword() { addKeyword() {
let newKeyword = { value: '', type: 'uncontrolled', language: this.dataset.language }; let newKeyword = { value: '', type: 'uncontrolled', language: this.dataset.language };
//this.dataset.files.push(uploadedFiles[i]); //this.dataset.files.push(uploadedFiles[i]);
this.dataset.keywords.push(newKeyword); this.dataset.subjects.push(newKeyword);
}, },
/* /*
Removes a selected keyword Removes a selected keyword
*/ */
removeKeyword(key) { removeKeyword(key) {
this.dataset.keywords.splice(key, 1); this.dataset.subjects.splice(key, 1);
}, },
addTitle() { addTitle() {
let newTitle = { value: '', language: '', type: '' }; let newTitle = { value: '', language: '', type: '' };
@ -475,13 +475,13 @@ const app = new Vue({
addDescription() { addDescription() {
let newTitle = { value: '', language: '', type: '' }; let newTitle = { value: '', language: '', type: '' };
//this.dataset.files.push(uploadedFiles[i]); //this.dataset.files.push(uploadedFiles[i]);
this.dataset.descriptions.push(newTitle); this.dataset.abstracts.push(newTitle);
}, },
/* /*
Removes a selected description Removes a selected description
*/ */
removeDescription(key) { removeDescription(key) {
this.dataset.descriptions.splice(key, 1); this.dataset.abstracts.splice(key, 1);
}, },
filesChange(fieldName, fileList) { filesChange(fieldName, fileList) {
this.fileCount = fileList.length this.fileCount = fileList.length

View File

@ -0,0 +1,5 @@
import EditDataset from './EditDataset';
const app = new EditDataset({
el: '#app1'
})

View File

@ -152,7 +152,7 @@
<button class="pure-button button-small" @click.prevent="addDescription()">+</button> <button class="pure-button button-small" @click.prevent="addDescription()">+</button>
</div> </div>
</div> </div>
<table class="pure-table pure-table-horizontal" v-if="dataset.descriptions.length"> <table class="pure-table pure-table-horizontal" v-if="dataset.abstracts.length">
<thead> <thead>
<tr> <tr>
<th style="width: 20px;">Description</th> <th style="width: 20px;">Description</th>
@ -162,7 +162,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item, index) in dataset.descriptions"> <tr v-for="(item, index) in dataset.abstracts">
<td> <td>
<textarea rows="3" cols="40" name="Description[Value]" class="form-control" placeholder="[DESCRIPTION]" v-model="item.value" data-vv-as="Additional Description" v-validate="'required|min:4'" data-vv-scope="step-1"></textarea> <textarea rows="3" cols="40" name="Description[Value]" class="form-control" placeholder="[DESCRIPTION]" v-model="item.value" data-vv-as="Additional Description" v-validate="'required|min:4'" data-vv-scope="step-1"></textarea>
</td> </td>
@ -253,35 +253,23 @@
<input class="form-checkbox" name="rights" id="rights" type="checkbox" v-model="dataset.rights" v-validate="'required'" data-vv-scope="step-1"> <input class="form-checkbox" name="rights" id="rights" type="checkbox" v-model="dataset.rights" v-validate="'required'" data-vv-scope="step-1">
terms and conditions terms and conditions
</label> </label>
<i class="fas fa-info-circle" @click="showModal" style="font-size:24px"></i>
{{-- <button @click="showModal" class="pure-button button-small is-success">
{!! trans('validation.attributes.backend.create-dataset.terms_and_conditions').'*' !!}
</button> --}}
<!-- use the modal component, pass in the prop -->
{{-- <button type="button" class="btn" @click="showModal">
Open Modal!
</button> --}}
<Modal v-if="isModalVisible" @close="closeModal" >
<template slot="header">
{!! trans('validation.attributes.backend.create-dataset.terms_and_conditions').'*' !!}
</template>
<template slot="body">
Die im GBA-RDR veröffentlichten Informationen und Metadaten unterliegen grundsätzlich den Open-Access-Bedingungen, wenn nicht anders angegeben. Die publizierten Datensets unterliegen einem definierten Zugriffs- sowie Nutzungsrecht welche in den Metadaten eindeutig beschrieben sind.
</template>
</Modal>
<i class="fas fa-info-circle" @click="showModal" style="font-size:24px"></i>
<Modal v-if="isModalVisible" @close="closeModal" >
<template slot="header">
{!! trans('validation.attributes.backend.create-dataset.terms_and_conditions').'*' !!}
</template>
<template slot="body">
Die im GBA-RDR veröffentlichten Informationen und Metadaten unterliegen grundsätzlich den Open-Access-Bedingungen, wenn nicht anders angegeben. Die publizierten Datensets unterliegen einem definierten Zugriffs- sowie Nutzungsrecht welche in den Metadaten eindeutig beschrieben sind.
</template>
</Modal>
<br />
<i v-show="errors.has('step-1.rights')" class="fas fa-exclamation-circle"></i>
<span v-show="errors.has('step-1.rights')" class="text-danger">@{{ errors.first('step-1.rights') }}</span>
<br /> <span class="help-block">You must agree to continue</span>
<i v-show="errors.has('step-1.rights')" class="fas fa-exclamation-circle"></i>
<span v-show="errors.has('step-1.rights')" class="text-danger">@{{ errors.first('step-1.rights') }}</span>
<span class="help-block">You must agree to continue</span>
</div> </div>
<br /> <br />
@ -517,7 +505,7 @@
<legend>Dataset Keywords</legend> <legend>Dataset Keywords</legend>
<input type="hidden" v-validate:keywords_length="'min_value:3'" data-vv-scope="step-2" data-vv-as="keyword list" name="keywords_list"> <input type="hidden" v-validate:keywords_length="'min_value:3'" data-vv-scope="step-2" data-vv-as="keyword list" name="keywords_list">
<button class="pure-button button-small" @click.prevent="addKeyword()">Add Keyword</button> <button class="pure-button button-small" @click.prevent="addKeyword()">Add Keyword</button>
<table class="table table-hover" v-if="dataset.keywords.length"> <table class="table table-hover" v-if="dataset.subjects.length">
<thead> <thead>
<tr> <tr>
<th style="width: 20px;">Keyword</th> <th style="width: 20px;">Keyword</th>
@ -527,9 +515,9 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item, index) in dataset.keywords"> <tr v-for="(item, index) in dataset.subjects">
<td> <td>
<input name="Keyword Value" class="form-control" placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="{required: true, unique: [dataset.keywords, index, 'value']}" <input name="Keyword Value" class="form-control" placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="{required: true, unique: [dataset.subjects, index, 'value']}"
data-vv-scope="step-2" /> data-vv-scope="step-2" />
</td> </td>
<td> <td>
@ -628,12 +616,7 @@
Uploading @{{ fileCount }} files... Uploading @{{ fileCount }} files...
</p> </p>
</div> </div>
{{-- <button @click.prevent="resetDropbox()" v-bind:disabled="isInitial" class="pure-button is-warning">Reset Dropbox</button> --}} {{--
<ul class="list-unstyled">
<li v-for="(item, index) in dataset.files">
@{{ item.name }} <i class="fa fa-remove"></i><span class="remove-file" v-on:click="removeFile(index)"> Remove</span>
</li>
</ul> --}}
<table class="table table-hover" v-if="dataset.files.length"> <table class="table table-hover" v-if="dataset.files.length">
<thead> <thead>

View File

@ -1,146 +1,202 @@
<fieldset id="fieldset-General"> <fieldset id="fieldset-State">
<legend>General</legend> <legend>State & notes</legend>
<div class="pure-g"> <div class="pure-g">
@if(!empty($reject_reviewer_note))
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('type', 'Type..') !!} {!! Form::label('reject_reviewer_note', 'editor reject note..') !!}
<div class="select pure-u-23-24"> {{-- {!! Form::select('server_state', Config::get('enums.server_states'), null, ['id' => 'server_state', 'placeholder' => '-- select server state --']) !!} --}}
{!! Form::select('type', Lang::get('doctypes'), null, ['id' => 'type', 'placeholder' => '-- select type --']) !!} {!! Form::textarea('reject_editor_note', null, ['class'=>'pure-u-23-24','readonly', 'v-model' => 'form.reject_editor_note']) !!}
</div> </div>
</div> @endif
<div class="pure-u-1 pure-u-md-1-2 pure-div">
<div class="pure-u-1 pure-u-md-1-2 pure-div"> {!! Form::label('server_state', 'Status..') !!}
{!! Form::label('project_id', 'Project..') !!} {{-- {!! Form::select('server_state', Config::get('enums.server_states'), null, ['id' => 'server_state', 'placeholder' => '-- select server state --']) !!} --}}
<div class="select pure-u-23-24"> {!! Form::text('server_state', null, ['class'=>'pure-u-23-24','readonly', 'v-model' => 'form.server_state']) !!}
{!! Form::select('project_id', $projects, null, ['id' => 'project_id', 'placeholder' => '--no project--']) !!} </div>
</div> </div>
<small id="projectHelp" class="pure-form-message-inline">project is optional</small> </fieldset>
<fieldset id="fieldset-General">
<legend>General</legend>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Language', 'Language..') !!}
<div class="select pure-u-23-24">
{!! Form::select('language', $languages, null, ['placeholder' => '[language]', 'v-model' =>
'form.language', "data-vv-as" => "Language", "v-validate" => "'required'"]) !!}
</div>
<small id="languageHelp" class="pure-form-message-inline">select dataset main language</small>
</div>
<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 --',
'v-model' => 'form.type', "v-validate" => "'required'"]) !!}
</div>
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('project_id', 'Project..') !!}
<div class="select pure-u-23-24">
{{-- {!! Form::select('project_id', $projects, null, ['id' => 'project_id', 'placeholder' => '--no
project--', 'v-model' => 'form.project_id']) !!} --}}
<select name="project_id" v-model="form.project_id">
<option :value="null" selected hidden disabled>--no project--</option>
<option v-for="(item, key) in projects" :value="key">@{{item}}</option>
</select>
</div>
<small id="projectHelp" class="pure-form-message-inline">project is optional</small>
</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>
</div>
</div> </div>
</fieldset>
<fieldset id="fieldset-dates">
<legend>Date(s)</legend>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <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']) !!}
</div>
<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']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('embargo_date', 'Embargo Date') !!} {!! Form::label('embargo_date', 'Embargo Date') !!}
{!! Form::date('embargo_date', null, ['placeholder' => date('y-m-d'), 'class' => 'pure-u-23-24']) !!} {!! Form::date('embargo_date', null, ['placeholder' => date('y-m-d'), 'class'
<small id="projectHelp" class="pure-form-message-inline">embargo_date is optional</small> => 'pure-u-23-24', 'v-model' => 'form.embargo_date']) !!}
<small id="projectHelp" class="pure-form-message-inline">EmbargoDate 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' => 'dataset.creating_corporation', "v-validate" => "'required'", 'data-vv-scope' => 'step-1']) !!}
</div>
</div>
</fieldset> </fieldset>
<fieldset id="fieldset-geolocation"> <fieldset id="fieldset-geolocation">
<legend>Geo Location</legend>
<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>
</fieldset>
{{-- <fieldset id="fieldset-geolocation">
<legend>Coverage: Geolocation, Elevation, Depth, Time</legend> <legend>Coverage: Geolocation, Elevation, Depth, Time</legend>
<div class="pure-g"> <div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('xmin', 'xmin: ') !!} {!! Form::label('xmin', 'xmin: ') !!}
{!! Form::text('coverage[xmin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.xmin']) !!} {!! Form::text('coverage[xmin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.xmin'])
!!}
</div> </div>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('ymin', 'ymin: ') !!} {!! Form::label('ymin', 'ymin: ') !!}
{!! Form::text('coverage[ymin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.ymin']) !!} {!! Form::text('coverage[ymin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.ymin'])
!!}
</div> </div>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('xmax', 'xmax: ') !!} {!! Form::label('xmax', 'xmax: ') !!}
{!! Form::text('coverage[xmax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.xmax']) !!} {!! Form::text('coverage[xmax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.xmax'])
!!}
</div> </div>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('ymax', 'ymax: ') !!} {!! Form::label('ymax', 'ymax: ') !!}
{!! Form::text('coverage[ymax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.ymax']) !!} {!! Form::text('coverage[ymax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.ymax'])
!!}
</div> </div>
@if (isset($dataset->elevation_absolut)) @if (isset($dataset->elevation_absolut))
<div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_absolut', 'elevation absolut: ') !!} {!! Form::label('elevation_absolut', 'elevation absolut: ') !!}
{!! Form::text('coverage[elevation_absolut]', null, {!! Form::text('coverage[elevation_absolut]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.elevation_absolut', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!}
</div> </div>
@elseif (isset($dataset->elevation_min) && isset($dataset->elevation_max)) @elseif (isset($dataset->elevation_min) && isset($dataset->elevation_max))
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_min', 'elevation min: ') !!} {!! Form::label('elevation_min', 'elevation min: ') !!}
{!! Form::text('coverage[elevation_min]', null, {!! Form::text('coverage[elevation_min]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.elevation_min', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div> </div>
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_max', 'elevation max: ') !!} {!! Form::label('elevation_max', 'elevation max: ') !!}
{!! Form::text('coverage[elevation_max]', null, {!! Form::text('coverage[elevation_max]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.elevation_max', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div> </div>
@endif @endif
@if (isset($dataset->depth_absolut)) @if (isset($dataset->depth_absolut))
<div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_absolut', 'depth absolut: ') !!} {!! Form::label('depth_absolut', 'depth absolut: ') !!}
{!! Form::text('coverage[depth_absolut]', null, {!! Form::text('coverage[depth_absolut]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.depth_absolut', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!}
</div> </div>
@elseif (isset($dataset->elevation_min) && isset($dataset->elevation_max)) @elseif (isset($dataset->elevation_min) && isset($dataset->elevation_max))
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_min', 'depth min: ') !!} {!! Form::label('depth_min', 'depth min: ') !!}
{!! Form::text('coverage[depth_min]', null, {!! Form::text('coverage[depth_min]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.depth_min', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div> </div>
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_max', 'depth max: ') !!} {!! Form::label('depth_max', 'depth max: ') !!}
{!! Form::text('coverage[depth_max]', null, {!! Form::text('coverage[depth_max]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.depth_max', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div> </div>
@endif @endif
@if (isset($dataset->depth_absolut)) @if (isset($dataset->depth_absolut))
<div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('time_absolut', 'time absolut: ') !!} {!! Form::label('time_absolut', 'time absolut: ') !!}
{!! Form::text('coverage[time_absolut]', null, {!! Form::text('coverage[time_absolut]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.time_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.time_absolut', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!}
</div> </div>
@elseif (isset($dataset->elevation_min) && isset($dataset->elevation_max)) @elseif (isset($dataset->elevation_min) && isset($dataset->elevation_max))
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('time_min', 'time min: ') !!} {!! Form::label('time_min', 'time min: ') !!}
{!! Form::text('coverage[time_min]', null, {!! Form::text('coverage[time_min]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.time_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.time_min', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div> </div>
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('time_max', 'time max: ') !!} {!! Form::label('time_max', 'time max: ') !!}
{!! Form::text('coverage[time_max]', null, {!! Form::text('coverage[time_max]', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.time_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'form.coverage.time_max', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div> </div>
@endif, @endif,
</div> </div>
</fieldset> </fieldset> --}}
<fieldset id="fieldset-titles"> <fieldset id="fieldset-titles">
<legend>Title</legend> <legend>Title</legend>
<div class="pure-g"> <div class="pure-g">
@foreach($dataset->titles as $key => $title) {{-- @foreach($dataset->titles as $key => $title)
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{{ Form::label('title', 'Title ' .($key+1).':') }} {{ Form::label('title', 'Title ' .($key+1).':') }}
<!-- Notice this is an array now: --> {{ Form::text('titles['.$title->id.'][value]', $title->value, ['class' => 'pure-u-23-24']) }}
{{ Form::text('titles['.$title->id.'][value]', $title->value, ['class' => 'pure-u-23-24']) }} </div>
</div> <div class="pure-u-1 pure-u-md-1-2 pure-div">
<div class="pure-u-1 pure-u-md-1-2 pure-div"> {{ Form::label('language', 'Language..') }}
{{ Form::label('language', 'Language..') }} {{ Form::text('titles['.$title->id.'][language]', $title->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }}
{{ Form::text('titles['.$title->id.'][language]', $title->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }} </div>
</div> @endforeach --}}
@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>
</div> </div>
</fieldset> </fieldset>
@ -149,17 +205,28 @@
<legend>Abstract</legend> <legend>Abstract</legend>
<div class="pure-g"> <div class="pure-g">
@foreach($dataset->abstracts as $key => $abstract) {{-- @foreach($dataset->abstracts as $key => $abstract)
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{{ Form::label('abstract', 'Abstract ' .($key+1).':') }} {{ Form::label('abstract', 'Abstract ' .($key+1).':') }}
<!-- Notice this is an array now: --> <!-- Notice this is an array now: -->
{{ Form::textarea('abstracts['.$abstract->id.'][value]', $abstract->value, ['class' => 'pure-u-23-24', 'size' => '70x6']) }} {{ Form::textarea('abstracts['.$abstract->id.'][value]', $abstract->value, ['class' => 'pure-u-23-24', 'size' => '70x6']) }}
</div> </div>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{{ Form::label('language', 'Language..') }} {{ Form::label('language', 'Language..') }}
{{ Form::text('abstracts['.$abstract->id.'][language]', $abstract->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }} {{ Form::text('abstracts['.$abstract->id.'][language]', $abstract->language, ['placeholder' => '--no language--', 'class' => 'pure-u-23-24', 'readonly']) }}
</div> </div>
@endforeach @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>
</div> </div>
</fieldset> </fieldset>
@ -167,74 +234,87 @@
<fieldset id="fieldset-licenses"> <fieldset id="fieldset-licenses">
<legend>Licenses</legend> <legend>Licenses</legend>
{{-- <div class="form-group">
{!! Form::label('licenses[]', 'Licenses..') !!}
{!! Form::select('licenses[]', $options, array_pluck($dataset->licenses, 'id'), ['multiple' ]) !!}
</div> --}}
<div class="pure-control-group checkboxlist"> <div class="pure-control-group checkboxlist">
@foreach ($options as $license) {{-- @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>
@endforeach --}}
<br>
{{-- <span>Checked license: @{{ dataset.checkedLicenses }}</span> --}}
<label for={{"license". $license->id }} class="pure-checkbox"> <template v-for="(license, index) in licenses">
<input name="licenses[]" value={{ $license->id }} {{ (in_array($license->id, $checkeds)) ? 'checked=checked' : '' }} type="checkbox" class="form-check-input"> <label :for="'license'+license.id" class="pure-checkbox">
{{ $license->name_long }} <input name="licenses" :value="license.id" v-model="checkeds" type="radio" class="form-check-input" v-validate="'required'" >
</label> <a :href="license.link_licence" target="_blank">@{{ license.name_long }}</a>
</label>
</template>
{{-- <span>old checkeds: @{{ checkeds }}</span> --}}
<!--{!! Form::checkbox('licenses[]', $license->id, in_array($license->id, $checkeds) ? true : false) !!}
{!! Form::label('license' . $license->id, $license->name_long) !!}-->
@endforeach
</div> </div>
</fieldset> </fieldset>
<fieldset id="fieldset-references"> <fieldset id="fieldset-references">
<legend>Dataset References</legend> <legend>Dataset References</legend>
{{-- <table class="table table-hover" v-if="dataset.keywords.length"> --}} {{-- <table class="table table-hover" v-if="dataset.keywords.length"> --}}
@if ($dataset->references->count() > 0) @if ($dataset->references->count() > 0)
<table id="references" class="pure-table pure-table-horizontal"> <table id="references" class="pure-table pure-table-horizontal">
<thead> <thead>
<tr> <tr>
<th style="width: 20px;">Reference value</th> <th style="width: 20px;">Reference value</th>
<th style="width: 20px;">Label</th> <th style="width: 20px;">Label</th>
<th>Type</th> <th>Type</th>
<th>Relation</th> <th>Relation</th>
<th style="width: 130px;"></th> <th style="width: 130px;"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{-- <tr v-for="(item, index) in dataset.keywords"> --}}
@foreach($dataset->references as $key => $reference) @foreach($dataset->references as $key => $reference)
<tr> <tr v-for="(item, index) in form.references">
<td> <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]']) }}
</td> </td>
<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]']) }}
</td> </td>
<td> <td>
{!! Form::select('references['.$reference->id.'][type]', $referenceTypes, $reference->type, ['placeholder' => '[reference type]', 'v-model' => {!! Form::select('references['.$reference->id.'][type]', $referenceTypes, $reference->type,
'item.type', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!} ['placeholder' => '[reference type]', 'v-model' =>
</td> 'item.type', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!}
<td> </td>
{!! Form::select('references['.$reference->id.'][relation]', $relationTypes, $reference->relation, ['placeholder' => '[relation type]', 'v-model' => <td>
'item.relation', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!} {!! Form::select('references['.$reference->id.'][relation]', $relationTypes, $reference->relation,
</td> ['placeholder' => '[relation type]', 'v-model' =>
<td> 'item.relation', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!}
</td>
</td> <td>
</tr>
@endforeach </td>
</tbody> </tr>
</table> @endforeach
@else </tbody>
<span>...there are no references</span> </table>
@endif @else
</fieldset> <span>...there are no references</span>
@endif
</fieldset>
<fieldset id="fieldset-keywords"> <fieldset id="fieldset-keywords">
<legend>Dataset Keywords</legend> <legend>Dataset Keywords</legend>
{{-- <table class="table table-hover" v-if="dataset.keywords.length"> --}} {{-- <table class="table table-hover" v-if="dataset.keywords.length"> --}}
@if ($dataset->subjects->count() > 0) @if ($dataset->subjects->count() > 0)
<table id="keywords" class="pure-table pure-table-horizontal"> <table id="keywords" class="pure-table pure-table-horizontal">
<thead> <thead>
<tr> <tr>
<th style="width: 20px;">Keyword</th> <th style="width: 20px;">Keyword</th>
@ -242,24 +322,31 @@
<th style="width: 130px;"></th> <th style="width: 130px;"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{-- <tr v-for="(item, index) in dataset.keywords"> --}} {{-- @foreach($dataset->subjects as $key => $keyword) --}}
@foreach($dataset->subjects as $key => $keyword) <tr>
<tr> <tr v-for="(item, index) in form.subjects" :key="item.id">
<td> <td>
{{-- <input name="Keyword Value" class="form-control" placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" <input v-bind:name="'subjects[' + item.id +'][value]'" class="form-control" placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" />
data-vv-scope="step-2" /> --}} {{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }} --}}
{{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }}
</td> </td>
<td> <td>
{!! Form::select('keywords['.$keyword->id.'][type]', $keywordTypes, $keyword->type, ['placeholder' => '[keyword type]', 'v-model' => {{-- {!! Form::select('keywords['.$keyword->id.'][type]', $keywordTypes, $keyword->type, ['placeholder'
'item.type', "v-validate" => "'required'", 'data-vv-scope' => 'step-2']) !!} => '[keyword type]', 'v-model' =>
'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
</select> --}}
<input v-bind:name="'subjects[' + item.id +'][type]'" readonly class="form-control" placeholder="[KEYWORD TYPE]" v-model="item.type" v-validate="'required'" />
</td> </td>
<td> <td>
{{-- <button class="pure-button button-small is-warning" @click.prevent="removeKeyword(index)">Remove</button> --}} {{-- <button class="pure-button button-small is-warning" @click.prevent="removeKeyword(index)">Remove</button> --}}
</td> </td>
</tr> </tr>
@endforeach {{-- @endforeach --}}
</tbody> </tbody>
</table> </table>
@else @else
@ -275,31 +362,32 @@
<th>Path Name</th> <th>Path Name</th>
<th>Label</th> <th>Label</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($dataset->files as $key => $file) {{-- @foreach($dataset->files as $key => $file) --}}
<tr> <tr v-for="(file, index) in form.files" :key="file.id">
<td> <td>
@if($file->exists() === true) {{-- @if($file->exists() === true)
<a href="{{ route('settings.file.download', ['id' => $file->id]) }}"> {{ $file->path_name }} </a> <a href="{{ route('settings.file.download', ['id' => $file->id]) }}"> {{ $file->path_name }} </a>
@else @else
<span class="alert">missing file: {{ $file->path_name }}</span> <span class="alert">missing file: {{ $file->path_name }}</span>
@endif @endif --}}
<a v-if="'storage/' + file.path_name" v-bind:src= " '/settings/file/download/' + file.id ">@{{ file.path_name }}</a>
</td> </td>
<td> <td>
{{-- {{ $file->label }} --}} {{-- {{ Form::text('files['.$file->id.'][label]', $file->label, ['class' => 'form-control', 'placeholder' => '[FILE LABEL]']) }} --}}
{{ 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> </td>
</tr> </tr>
@endforeach {{-- @endforeach --}}
</tbody> </tbody>
</table> </table>
</fieldset> </fieldset>
<br /> <br />
<div class="pure-controls"> <div class="pure-controls">
<button type="submit" class="pure-button button-small"> <button :disabled="errors.any()" type="submit" class="pure-button button-small">
<i class="fa fa-save"></i> <i class="fa fa-share"></i>
<span>{!! $submitButtonText !!}</span> <span>{!! $submitButtonText !!}</span>
</button> </button>
</div> </div>

View File

@ -6,23 +6,57 @@
<span>Edit Dataset</span> <span>Edit Dataset</span>
</h3> </h3>
</div> </div>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="pure-g box-content"> <div class="pure-g box-content">
<div class="pure-u-1 pure-u-md-3-3"> <div class="pure-u-1 pure-u-md-3-3">
<div> <div>
<a href="{{ route('publish.workflow.submit.index') }}" class="pure-button button-small"> <a href="{{ route('publish.workflow.submit.index') }}" class="pure-button button-small">
<i class="fa fa-chevron-left"></i> <i class="fa fa-chevron-left"></i>
<span>BACK</span> <span>BACK</span>
</a> </a>
</div> </div>
<div> <div id="app1">
{!! Form::model($dataset, ['method' => 'POST', 'route' => ['publish.workflow.submit.update', $dataset->id], 'class' => 'pure-form', 'enctype' => 'multipart/form-data' ]) !!} {!! Form::model($dataset, ['method' => 'POST', 'route' => ['publish.workflow.submit.update', $dataset->id], 'id' => 'submitEditForm',
@include('workflow/submitter/_form', ['submitButtonText' => 'Edit Dataset', 'bookLabel' => 'Edit Dataset.']) 'class' => 'pure-form', 'enctype' => 'multipart/form-data', 'v-on:submit.prevent' => 'onSubmit' ]) !!}
@include('errors._errors') @include('workflow/submitter/_form', ['submitButtonText' => 'Edit Dataset', 'bookLabel' => 'Edit Dataset.'])
{{-- @include('errors._errors') --}}
<div v-if="errors.items.length > 0">
<b>Please correct the following error(s):</b>
<ul class="alert validation-summary-errors">
<li style="margin-left:5px;" v-for="error in errors.items">@{{ error.msg }}</li>
</ul>
</div>
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
</div> </div>
@stop
@section('after-scripts')
<script>
window.Laravel = <?php echo json_encode([
'csrf_token' => csrf_token(),
'form' => $dataset,
'projects' => $projects,
'licenses' => $licenses,
'checkeds' => $checkeds
]); ?>
</script>
<script type="text/javascript" src="{{ asset('backend/publish/mainEditDataset.js') }}"></script>
@stop @stop

View File

@ -19,6 +19,7 @@ mix.js('resources/js/datasetPublish.js', 'public/backend/publish')
.js('resources/js/app.js', 'public/js') .js('resources/js/app.js', 'public/js')
.js('resources/js/lib.js', 'public/js') .js('resources/js/lib.js', 'public/js')
.js('resources/js/releaseDataset.js', 'public/backend/publish') .js('resources/js/releaseDataset.js', 'public/backend/publish')
.js('resources/js/mainEditDataset.js', 'public/backend/publish')
.js('resources/js/approveDataset.js', 'public/backend/publish') .js('resources/js/approveDataset.js', 'public/backend/publish')
.js('resources/js/ckeditor.js', 'public/backend/') .js('resources/js/ckeditor.js', 'public/backend/')
.sass('resources/sass/app1.scss', 'public/css', { implementation: require('node-sass')}) .sass('resources/sass/app1.scss', 'public/css', { implementation: require('node-sass')})