mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
clickDay
This commit is contained in:
@@ -16,17 +16,26 @@ class MeetupEventTable extends Component
|
|||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.meetup.meetup-event-table', [
|
return view('livewire.meetup.meetup-event-table', [
|
||||||
'events' => MeetupEvent::query()->get()->map(fn($event) => [
|
'events' => MeetupEvent::query()
|
||||||
'startDate' => $event->start,
|
->get()
|
||||||
'endDate' => $event->start->endOfDay(),
|
->map(fn($event) => [
|
||||||
'location' => $event->location,
|
'id' => $event->id,
|
||||||
'description' => $event->description,
|
'startDate' => $event->start,
|
||||||
]),
|
'endDate' => $event->start->endOfDay(),
|
||||||
|
'location' => $event->location,
|
||||||
|
'description' => $event->description,
|
||||||
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function popover($content)
|
public function popover($content, $ids)
|
||||||
{
|
{
|
||||||
$this->notification()->success($content);
|
return to_route('meetup.table.meetupEvent', [
|
||||||
|
'country' => $this->country->code, 'table' => [
|
||||||
|
'filters' => [
|
||||||
|
'byid' => $ids,
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,11 +38,8 @@
|
|||||||
init() {
|
init() {
|
||||||
let events = {{ Js::from($events) }};
|
let events = {{ Js::from($events) }};
|
||||||
events = events.map(function(e){
|
events = events.map(function(e){
|
||||||
console.log(e.startDate);
|
return {id: e.id, startDate: new Date(e.startDate), endDate: new Date(e.endDate), location: e.location, description: e.description}
|
||||||
console.log(e.endDate);
|
|
||||||
return {startDate: new Date(e.startDate), endDate: new Date(e.endDate), location: e.location, description: e.description}
|
|
||||||
})
|
})
|
||||||
console.log(events);
|
|
||||||
|
|
||||||
new Calendar(this.$refs.calendar, {
|
new Calendar(this.$refs.calendar, {
|
||||||
style: 'background',
|
style: 'background',
|
||||||
@@ -51,16 +48,18 @@
|
|||||||
clickDay: function(e) {
|
clickDay: function(e) {
|
||||||
if(e.events.length > 0) {
|
if(e.events.length > 0) {
|
||||||
var content = '';
|
var content = '';
|
||||||
|
var ids = [];
|
||||||
|
|
||||||
for(var i in e.events) {
|
for(var i in e.events) {
|
||||||
|
ids.push(e.events[i].id);
|
||||||
content += '<div class=\'event-tooltip-content\'>'
|
content += '<div class=\'event-tooltip-content\'>'
|
||||||
+ '<div class=\'event-name\'>' + e.events[i].location + '</div>'
|
+ '<div class=\'event-name\'>' + e.events[i].location + '</div>'
|
||||||
+ '<div class=\'event-location\'>' + e.events[i].description + '</div>'
|
+ '<div class=\'event-location\'>' + e.events[i].description + '</div>'
|
||||||
+ '</div>';
|
+ '</div>';
|
||||||
}
|
}
|
||||||
console.log(content);
|
console.log(content);
|
||||||
|
|
||||||
$wire.call('popover', content);
|
$wire.call('popover', content, ids.join(','));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user