libraryItem forms added

This commit is contained in:
HolgerHatGarKeineNode
2023-02-11 20:13:16 +01:00
parent fbb1a781cc
commit b528f509dd
24 changed files with 576 additions and 53 deletions

View File

@@ -758,5 +758,10 @@
"Article tweeted": "Artikel getwittert",
"Error tweeting article": "Fehler beim Twittern des Artikels",
"Tweet": "Tweet",
"Are you sure you want to tweet this article?": "Bitte bestätige, dass du diesen Artikel tweeten möchtest."
"Are you sure you want to tweet this article?": "Bitte bestätige, dass du diesen Artikel tweeten möchtest.",
"Markdown Article Extern": "Markdown Artikel",
"twitter_username": "",
"Please classify by type of your entry.": "Bitte klassifiziere deinen Eintrag nach Art.",
"Choose language": "Wähle Sprache",
"File": "Datei"
}

View File

@@ -754,5 +754,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -754,5 +754,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -755,5 +755,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -755,5 +755,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -755,5 +755,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -755,5 +755,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -755,5 +755,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -755,5 +755,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -717,5 +717,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -729,5 +729,10 @@
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": "",
"Are you sure you want to tweet this article?": ""
"Are you sure you want to tweet this article?": "",
"Markdown Article Extern": "",
"twitter_username": "",
"Please classify by type of your entry.": "",
"Choose language": "",
"File": ""
}

View File

@@ -1,5 +1,5 @@
<div class="w-full mb-4 md:w-auto md:mb-0" x-data="{currentUrl: window.location.href}">
<a x-bind:href="'http://localhost/city/form/?fromUrl='+currentUrl">
<a x-bind:href="'/city/form/?fromUrl='+currentUrl">
<x-button>
<i class="fa fa-thin fa-plus"></i>
{{ __('New City') }}

View File

@@ -0,0 +1,87 @@
<div class="container p-4 mx-auto bg-21gray my-2">
<div class="pb-5 flex flex-row justify-between">
<h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('Lecturer/Content Creator') }}</h3>
<div class="flex flex-row space-x-2 items-center">
<div>
<x-button :href="$fromUrl">
<i class="fa fa-thin fa-arrow-left"></i>
{{ __('Back') }}
</x-button>
</div>
</div>
</div>
<form class="space-y-8 divide-y divide-gray-700 pb-24">
<div class="space-y-8 divide-y divide-gray-700 sm:space-y-5">
<div class="mt-6 sm:mt-5 space-y-6 sm:space-y-5">
<x-input.group :for=" md5('image')" :label="__('Main picture')">
<div class="py-4">
@if ($image)
<div class="text-gray-200">{{ __('Preview') }}:</div>
<img class="h-48 object-contain" src="{{ $image->temporaryUrl() }}">
@endif
@if ($lecturer->getFirstMediaUrl('avatar'))
<div class="text-gray-200">{{ __('Current picture') }}:</div>
<img class="h-48 object-contain" src="{{ $lecturer->getFirstMediaUrl('avatar') }}">
@endif
</div>
<input class="text-gray-200" type="file" wire:model="image">
@error('image') <span class="text-red-500">{{ $message }}</span> @enderror
</x-input.group>
<x-input.group :for="md5('lecturer.name')" :label="__('Title')">
<x-input autocomplete="off" wire:model.debounce="lecturer.name"
:placeholder="__('Title')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.subtitle')" :label="__('Subtitle')">
<x-input autocomplete="off" wire:model.debounce="lecturer.subtitle"
:placeholder="__('Subtitle')" :hint="__('This is the subtitle on the landing page.')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.intro')" :label="__('Intro')">
<div
class="text-amber-500 text-xs py-2">{{ __('For images in Markdown, please use eg. Imgur or another provider.') }}</div>
<x-input.simple-mde wire:model.defer="lecturer.intro"/>
@error('lecturer.intro') <span class="text-red-500 py-2">{{ $message }}</span> @enderror
<span class="text-gray-400 text-xs py-2">{{ __('This is the introduction text that is shown on the landing page.') }}</span>
</x-input.group>
<x-input.group :for="md5('lecturer.twitter_username')" :label="__('Twitter Username')">
<x-input autocomplete="off" wire:model.debounce="lecturer.twitter_username"
:placeholder="__('Twitter Username')" :hint="__('Without @')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.website')" :label="__('Website')">
<x-input autocomplete="off" wire:model.debounce="lecturer.website"
:placeholder="__('Website')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.lightning_address')" :label="__('Lightning Address')">
<x-input autocomplete="off" wire:model.debounce="lecturer.lightning_address"
:placeholder="__('Lightning Address')" :hint="__('for example xy@getalby.com')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.lnurl')" :label="__('LNURL')">
<x-input autocomplete="off" wire:model.debounce="lecturer.lnurl"
:placeholder="__('LNURL')" :hint="__('starts with: lnurl1dp68gurn8gh....')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.node_id')" :label="__('Node Id')">
<x-input autocomplete="off" wire:model.debounce="lecturer.node_id"
:placeholder="__('Node Id')"/>
</x-input.group>
<x-input.group :for="md5('meetupEvent.link')" label="">
<x-button primary wire:click="save">
<i class="fa fa-thin fa-save"></i>
{{ __('Save') }}
</x-button>
</x-input.group>
</div>
</div>
</form>
</div>

View File

@@ -188,6 +188,19 @@
<p class="px-0 mb-2 text-lg text-gray-600 md:text-xl lg:px-24">
{{ __('Choose a topic that is right for you.') }}
</p>
@auth
@if(str(request()->route()->getName())->contains('lecturer'))
<x-button :href="route('library.libraryItem.form', ['country' => $c, 'lecturer' => true, 'fromUrl' => url()->route('library.table.libraryItems', ['country' => $country])])">
<i class="fa fa-thin fa-plus"></i>
{{ __('Submit contents') }}
</x-button>
@else
<x-button :href="route('library.libraryItem.form', ['country' => $c, 'fromUrl' => url()->route('library.table.libraryItems', ['country' => $country])])">
<i class="fa fa-thin fa-plus"></i>
{{ __('Submit contents') }}
</x-button>
@endif
@endauth
</div>
@endif

View File

@@ -0,0 +1,158 @@
<div class="container p-4 mx-auto bg-21gray my-2">
<div class="pb-5 flex flex-row justify-between">
<h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('Library Item') }}</h3>
<div class="flex flex-row space-x-2 items-center">
<div>
<x-button :href="$fromUrl">
<i class="fa fa-thin fa-arrow-left"></i>
{{ __('Back') }}
</x-button>
</div>
</div>
</div>
<form class="space-y-8 divide-y divide-gray-700 pb-24">
<div class="space-y-8 divide-y divide-gray-700 sm:space-y-5">
<div class="mt-6 sm:mt-5 space-y-6 sm:space-y-5">
<x-input.group :for="md5('libraryItem.lecturer_id')">
<x-slot name="label">
<div class="flex flex-row space-x-4 items-center">
<div>
{{ __('Author') }}
</div>
<div x-data="{currentUrl: window.location.href}">
<a x-bind:href="'/content-creator/form/?fromUrl='+currentUrl">
<x-button xs>
<i class="fa fa-thin fa-plus"></i>
{{ __('Create new author') }}
</x-button>
</a>
</div>
</div>
</x-slot>
<x-select
:clearable="false"
wire:model="libraryItem.lecturer_id"
:searchable="true"
:async-data="[
'api' => route('api.lecturers.index'),
'method' => 'GET', // default is GET
]"
:template="[
'name' => 'user-option',
'config' => ['src' => 'image']
]"
option-label="name"
option-value="id"
/>
</x-input.group>
<x-input.group :for="md5('libraryItem.type')" label="{{ __('Type') }}">
<x-select
:clearable="false"
wire:model="libraryItem.type"
:options="$types"
option-label="label"
option-value="value"
/>
</x-input.group>
<x-input.group :for="md5('library')" label="{{ __('Library') }}">
<x-select
:disabled="$lecturer"
hint="{{ __('Please classify by type of your entry.') }}"
:clearable="false"
wire:model="library"
:options="$libraries"
option-label="name"
option-value="id"
/>
</x-input.group>
@if($libraryItem->lecturer_id && $libraryItem->type && $library)
<x-input.group :for=" md5('image')" :label="__('Main picture')">
<div class="py-4">
@if ($image)
<div class="text-gray-200">{{ __('Preview') }}:</div>
<img class="h-48 object-contain" src="{{ $image->temporaryUrl() }}">
@endif
@if ($libraryItem->getFirstMediaUrl('main'))
<div class="text-gray-200">{{ __('Current picture') }}:</div>
<img class="h-48 object-contain" src="{{ $libraryItem->getFirstMediaUrl('main') }}">
@endif
</div>
<input class="text-gray-200" type="file" wire:model="image">
@error('image') <span class="text-red-500">{{ $message }}</span> @enderror
</x-input.group>
<x-input.group :for="md5('libraryItem.main_image_caption')" :label="__('Main image caption')">
<x-input autocomplete="off" wire:model.debounce="libraryItem.main_image_caption"
:placeholder="__('Main image caption')"
:cornerHint="__('Ex: Photo by Timothy Vollmer/ CC BY')"/>
</x-input.group>
<x-input.group :for="md5('libraryItem.name')" :label="__('Title')">
<x-input autocomplete="off" wire:model.debounce="libraryItem.name"
:placeholder="__('Title')"/>
</x-input.group>
<x-input.group :for="md5('libraryItem.subtitle')" :label="__('Subtitle')">
<x-input autocomplete="off" wire:model.debounce="libraryItem.subtitle"
:placeholder="__('Subtitle')"/>
</x-input.group>
<x-input.group :for="md5('libraryItem.excerpt')" :label="__('Excerpt')">
<x-textarea autocomplete="off" wire:model.debounce="libraryItem.excerpt"
:placeholder="__('Excerpt')"/>
</x-input.group>
<x-input.group :for="md5('libraryItem.language_code')" :label="__('Language Code')">
<x-select
placeholder="{{ __('Choose language') }}"
wire:model="libraryItem.language_code"
:clearable="false"
:searchable="true"
:async-data="route('api.languages.index')"
option-label="name"
option-value="language"
/>
</x-input.group>
@if($libraryItem->type === App\Enums\LibraryItemType::MarkdownArticleExtern())
<x-input.group :for="md5('libraryItem.value')" :label="__('Article as Markdown')">
<div
class="text-amber-500 text-xs py-2">{{ __('For images in Markdown, please use eg. Imgur or another provider.') }}</div>
<x-input.simple-mde wire:model.defer="libraryItem.value"/>
@error('libraryItem.value') <span class="text-red-500 py-2">{{ $message }}</span> @enderror
</x-input.group>
@elseif($libraryItem->type !== App\Enums\LibraryItemType::DownloadableFile())
<x-input.group :for="md5('libraryItem.value')" :label="__('Link')">
<x-input type="url" autocomplete="off" wire:model.debounce="libraryItem.value"
:placeholder="__('Link')"/>
</x-input.group>
@elseif($libraryItem->type === App\Enums\LibraryItemType::DownloadableFile())
<x-input.group :for="md5('file')" :label="__('File')">
<input class="text-gray-200" type="file" wire:model="file">
@error('file') <span class="text-red-500">{{ $message }}</span> @enderror
</x-input.group>
@endif
<x-input.group :for="md5('libraryItem.read_time')" :label="__('Time to read')">
<x-inputs.number min="1" autocomplete="off" wire:model.debounce="libraryItem.read_time"
:placeholder="__('Time to read')" :hint="__('How many minutes to read?')"/>
</x-input.group>
<x-input.group :for="md5('meetupEvent.link')" label="">
<x-button primary wire:click="save">
<i class="fa fa-thin fa-save"></i>
{{ __('Save') }}
</x-button>
</x-input.group>
@endif
</div>
</div>
</form>
</div>

View File

@@ -108,9 +108,9 @@
</div>
</div>
<div class="ml-3">
<p class="text-sm font-medium text-gray-200">
<div class="text-gray-200">{{ $libraryItem->lecturer->name }}</div>
</p>
<div class="text-sm font-medium text-gray-200">
<div class="text-gray-200">{{ $libraryItem->lecturer->name }}</div>
</div>
<div class="flex space-x-1 text-sm text-gray-400">
<time
datetime="2020-03-16">{{ $libraryItem->created_at->asDateTime() }}</time>
@@ -119,14 +119,24 @@
<span>{{ $libraryItem->read_time }} {{ __('min read') }}</span>
@endif
</div>
<div
class="flex space-x-1 text-sm text-gray-500 justify-end items-end">
<div>
<x-button xs
:href="route('library.libraryItem.form', ['country' => $country, 'libraryItem' => $libraryItem])">
<i class="fa fa-thin fa-edit"></i>
{{ __('Edit') }}
</x-button>
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach
<div
x-data="{
<div
x-data="{
observe () {
let observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
@@ -140,8 +150,8 @@
observer.observe(this.$el)
}
}"
x-init="observe"
></div>
x-init="observe"
></div>
@if($libraryItems->hasMorePages())
<x-button outline wire:click.prevent="loadMore">{{ __('load more...') }}</x-button>

View File

@@ -159,9 +159,10 @@
id: 'attend-event',
icon: 'question',
accept: {label: '{{ __('Yes') }}',
execute: () => $wire.attend()},
execute: () => $wire.attend()},
reject: {label: '{{ __('No, cancel') }}',
execute: () => window.$wireui.notify({'title': '{{ __('You have not confirmed your participation.') }}','icon': 'warning'})}})"
execute: () => window.$wireui.notify({'title': '{{ __('You have not confirmed your participation.') }}','icon': 'warning'})}
})"
>
<i class="fa fa-thin fa-check mr-2"></i>
{{ __('I will show up') }}

View File

@@ -93,8 +93,8 @@
</x-input.group>
<x-input.group :for="md5('libraryItem.value')" :label="__('Article as Markdown')">
<span
class="text-amber-500 text-xs py-2">{{ __('For images in Markdown, please use eg. Imgur or another provider.') }}</span>
<div
class="text-amber-500 text-xs py-2">{{ __('For images in Markdown, please use eg. Imgur or another provider.') }}</div>
<x-input.simple-mde wire:model.defer="libraryItem.value"/>
@error('libraryItem.value') <span class="text-red-500 py-2">{{ $message }}</span> @enderror
</x-input.group>

View File

@@ -49,15 +49,6 @@
</div>
@endif
@if(str(request()->route()->getName())->contains(['library.', 'article.']))
<div>
<x-button xs amber href="/nova/resources/library-items" target="_blank">
<i class="fa fa-thin fa-plus"></i>
{{ __('Submit contents') }}
</x-button>
</div>
@endif
@if(str(request()->route()->getName())->contains('bitcoinEvent.'))
<div>
<x-button xs amber href="/nova/resources/bitcoin-events" target="_blank">
@@ -240,12 +231,6 @@
</x-jet-responsive-nav-link>
@endif
@if(str(request()->route()->getName())->contains('library.'))
<x-jet-responsive-nav-link href="/nova/resources/library-items" :active="false">
{{ __('Submit contents') }}
</x-jet-responsive-nav-link>
@endif
@if(str(request()->route()->getName())->contains('bitcoinEvent.'))
<x-jet-responsive-nav-link href="/nova/resources/bitcoin-events" :active="false">
{{ __('Register event') }}