- add message class for help texts
- add migrations for message class - load messages into vue form for dataset publishing - check unique email of authors during dataset creation - adaptions in create-step1.blade.php for tooltip colors - updated package.json
This commit is contained in:
parent
a773fe2a1d
commit
0f6260f358
|
@ -19,10 +19,13 @@ use Illuminate\Support\Facades\Auth;
|
|||
// use Illuminate\View\View;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
// use App\Models\Coverage;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Carbon\Carbon;
|
||||
use \Exception;
|
||||
use App\Rules\RdrFiletypes;
|
||||
use App\Rules\RdrFilesize;
|
||||
use App\Models\Person;
|
||||
|
||||
class EditorController extends Controller
|
||||
{
|
||||
|
@ -97,7 +100,7 @@ class EditorController extends Controller
|
|||
*/
|
||||
public function edit($id): \Illuminate\Contracts\View\View
|
||||
{
|
||||
$dataset = Dataset::findOrFail($id);
|
||||
$dataset = Dataset::findOrFail($id);
|
||||
$dataset->load('licenses', 'authors', 'contributors', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references');
|
||||
|
||||
$titleTypes = ['Main' => 'Main', 'Sub' => 'Sub', 'Alternative' => 'Alternative', 'Translated' => 'Translated', 'Other' => 'Other'];
|
||||
|
|
|
@ -55,6 +55,9 @@ class IndexController extends Controller
|
|||
->pluck('part1', 'part1');
|
||||
// ->toArray();
|
||||
|
||||
$messages = DB::table('messages')
|
||||
->pluck('help_text', 'metadata_element');
|
||||
|
||||
$projects = Project::pluck('label', 'id');
|
||||
$relatedIdentifierTypes = ["doi", "handle", "isbn", "issn", "url", "urn"];
|
||||
$relatedIdentifierTypes = array_combine($relatedIdentifierTypes, $relatedIdentifierTypes);
|
||||
|
@ -73,7 +76,7 @@ class IndexController extends Controller
|
|||
//$relationTypes = array('updates' => 'updates', 'updated-by' => 'updated-by', 'other' => 'other');
|
||||
return view(
|
||||
'publish.create-step1',
|
||||
compact('licenses', 'languages', 'projects', 'relatedIdentifierTypes', 'relationTypes', 'titleTypes', 'keywordTypes', 'descriptionTypes', 'page')
|
||||
compact('licenses', 'languages', 'messages', 'projects', 'relatedIdentifierTypes', 'relationTypes', 'titleTypes', 'keywordTypes', 'descriptionTypes', 'page')
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -243,7 +246,7 @@ class IndexController extends Controller
|
|||
// ]);
|
||||
$rules = [
|
||||
// 'server_state' => 'required',
|
||||
'type' => 'required|min:5',
|
||||
'type' => 'required|min:3',
|
||||
'rights' => 'required|boolean|in:1',
|
||||
'belongs_to_bibliography' => 'required|boolean',
|
||||
'title_main.value' => 'required|min:4|max:255',
|
||||
|
@ -273,12 +276,22 @@ class IndexController extends Controller
|
|||
'keywords.*.type' => 'required|string',
|
||||
'files' => 'required|array|min:1',
|
||||
'files.*.label' => 'required|string',
|
||||
// 'authors.*.email' => 'required|email|max:50|unique:persons,email',
|
||||
];
|
||||
$customMessages = [
|
||||
'keywords.required' => 'Minimal three keywords are required.',
|
||||
'keywords.*.type.required' => 'The types of all keywords are required.',
|
||||
'files.min' => 'Minimal one file is required.',
|
||||
'authors.*.email.unique' => 'email of new author is not unique in database.',
|
||||
];
|
||||
if (isset($data['authors'])) {
|
||||
foreach ($request->get('authors') as $index => $person) {
|
||||
// echo "Item at index {$index} has sm_id value {$item->sm_id}";
|
||||
if ($person['status'] == false) {
|
||||
$rules['authors.' . $index . '.email'] = ['email', 'required', 'unique:persons,email'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null != $request->file('files')) {
|
||||
$files = count($request->file('files')) - 1;
|
||||
foreach (range(0, $files) as $index) {
|
||||
|
|
10
app/Message.php
Normal file
10
app/Message.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Message extends Model
|
||||
{
|
||||
//
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateMessagesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('messages', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('metadata_element', 255);
|
||||
$table->text('help_text');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('messages');
|
||||
}
|
||||
}
|
15
package-lock.json
generated
15
package-lock.json
generated
|
@ -10351,6 +10351,21 @@
|
|||
"resolved": "https://registry.npmjs.org/vue-datetime-picker/-/vue-datetime-picker-0.2.1.tgz",
|
||||
"integrity": "sha1-e3JN3jty1TFkWifWWXWJ1tiCrTs="
|
||||
},
|
||||
"vue-directive-tooltip": {
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-directive-tooltip/-/vue-directive-tooltip-1.6.3.tgz",
|
||||
"integrity": "sha512-aSdlBIdibctL+Tw+2j+IVUtz/fOZPLMQz0xxSoIGOA223WsPahiybSykJHx6QxtPzWq2phE/OZaCTmvMOVPyeA==",
|
||||
"requires": {
|
||||
"popper.js": "1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"popper.js": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.15.0.tgz",
|
||||
"integrity": "sha512-w010cY1oCUmI+9KwwlWki+r5jxKfTFDVoadl7MSrIujHU5MJ5OR6HTDj6Xo8aoR/QsA56x8jKjA59qGH4ELtrA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"vue-events": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/vue-events/-/vue-events-3.1.0.tgz",
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
"datatables.net-buttons": "^1.5.6",
|
||||
"easytimer": "^1.1.1",
|
||||
"single-page-nav": "^1.0.0",
|
||||
"vue-datetime-picker": "^0.2.1"
|
||||
"vue-datetime-picker": "^0.2.1",
|
||||
"vue-directive-tooltip": "^1.6.3"
|
||||
}
|
||||
}
|
||||
|
|
2
public/backend/ckeditor.js
vendored
2
public/backend/ckeditor.js
vendored
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
|
@ -29,7 +29,7 @@
|
|||
v-bind:name="heading+'['+index+'][id]'"
|
||||
class="form-control"
|
||||
v-model="item.id"
|
||||
v-bind:readonly="item.status==1"
|
||||
readonly
|
||||
data-vv-scope="step-1"
|
||||
/></td>
|
||||
<td>
|
||||
|
|
|
@ -43,6 +43,12 @@ import VueToast from 'vue-toast-notification';
|
|||
import 'vue-toast-notification/dist/index.css';
|
||||
Vue.use(VueToast);
|
||||
|
||||
// import VTooltip from 'v-tooltip';
|
||||
// Vue.use(VTooltip);
|
||||
import Tooltip from 'vue-directive-tooltip';
|
||||
import 'vue-directive-tooltip/dist/vueDirectiveTooltip.css';
|
||||
Vue.use(Tooltip);
|
||||
|
||||
const dict = {
|
||||
custom: {
|
||||
keyword_list: {
|
||||
|
@ -147,6 +153,10 @@ const app = new Vue({
|
|||
mounted() {
|
||||
//this.step = 2;
|
||||
this.reset();
|
||||
console.log(this.messages);
|
||||
},
|
||||
beforeMount() {
|
||||
this.messages = window.Laravel.messages;
|
||||
},
|
||||
computed: {
|
||||
keywords_length() {
|
||||
|
@ -544,14 +554,6 @@ const app = new Vue({
|
|||
this.$toast.success("person has been successfully added as contributor");
|
||||
}
|
||||
},
|
||||
// onAddSubmitter(person) {
|
||||
// //if person is not in submitters array
|
||||
// //if (this.submitters.includes(person) == false) {
|
||||
// if (this.dataset.submitters.filter(e => e.id === person.id).length == 0) {
|
||||
// this.dataset.submitters.push(person);
|
||||
// this.dataset.checkedSubmitters.push(person.id);
|
||||
// }
|
||||
// },
|
||||
/*
|
||||
Removes a select file the user has uploaded
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,18 @@
|
|||
|
||||
@section('title', 'Publish')
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
.vue-tooltip.tooltip-custom {
|
||||
background-color: #00a9d8;
|
||||
z-index: 9999;
|
||||
}
|
||||
.vue-tooltip.tooltip-custom .tooltip-content {
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="header">
|
||||
<h3 class="header-title">
|
||||
|
@ -69,16 +81,21 @@
|
|||
</div>
|
||||
</div> --}}
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
<label for="documentType">Dataset Type<span class="required" title="Dieses Feld muss ausgefüllt werden."> *</span></label>
|
||||
<label for="documentType">Dataset Type<span class="required" title="Dieses Feld muss ausgefüllt werden.">
|
||||
* <i v-tooltip="{ content: messages.dataset_type, class: 'tooltip-custom tooltip-other-custom' }" class="far fa-lg fa-question-circle"></i>
|
||||
</span>
|
||||
</label>
|
||||
<div class="select pure-u-23-24" title="Bitte wählen Sie einen Datensatztyp aus der Liste aus.">
|
||||
{!! Form::select('Type', Lang::get('doctypes'), null, ['id' => 'type', 'placeholder' => '-- select type --', 'v-model' =>
|
||||
'dataset.type', "v-validate" => "'required'", 'data-vv-scope' => 'step-1']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<fieldset id="fieldset-titles">
|
||||
<legend>Title(s)</legend>
|
||||
<legend>Title(s) <i v-tooltip="{ content: messages.titles, class: 'tooltip-custom tooltip-other-custom' }" class="far fa-lg fa-question-circle"></i> </legend>
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1 pure-u-md-1-2 pure-div">
|
||||
{!! Form::label('TitleMain', 'Main Title ') !!}
|
||||
|
@ -734,11 +751,13 @@
|
|||
|
||||
|
||||
@stop
|
||||
@section('after-scripts') {{--
|
||||
<script type="text/javascript" src="{{ asset('js/lib.js') }}"></script> --}} {{--
|
||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue"></script>--}} {{--
|
||||
<script type="text/javascript" src="{{ resource_path('assets\js\datasetPublish.js') }}"></script> --}}
|
||||
@section('after-scripts')
|
||||
<script>
|
||||
window.Laravel = <?php echo json_encode([
|
||||
'languages' => $languages,
|
||||
'messages' => $messages,
|
||||
]); ?>
|
||||
</script>
|
||||
<script type="text/javascript" src="{{ asset('backend/publish/datasetPublish.js') }}"></script>
|
||||
|
||||
@stop
|
Loading…
Reference in New Issue
Block a user