Skip to content

Commit

Permalink
Fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamieljv committed Dec 1, 2024
1 parent 125f03c commit 63cfbe1
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ActieWijzerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function landing()
{
$questions = Question::active()->get()->toArray();
$dimensions = Dimension::all()->toArray();
$themes = Theme::orderBy('name', 'ASC')->all()->toArray();
$themes = Theme::orderBy('name', 'ASC')->get()->toArray();
$result_route = route('actiewijzer.result');

// SEO
Expand Down
27 changes: 25 additions & 2 deletions app/Notifications/ReportAccepted.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
namespace App\Notifications;

use App\Models\Actie;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;

class ReportAccepted extends Notification
{
use Queueable;

public Actie $actie;
public User $user;

/**
* Create a new notification instance.
*
Expand All @@ -18,6 +23,7 @@ class ReportAccepted extends Notification
public function __construct(Actie $actie)
{
$this->actie = $actie;
$this->user = User::find($actie->user_id);
}

/**
Expand All @@ -28,7 +34,7 @@ public function __construct(Actie $actie)
*/
public function via($notifiable)
{
return ['database'];
return ['database', 'mail'];
}

/**
Expand All @@ -41,9 +47,26 @@ public function toArray($notifiable)
{
return [
'title' => __('reports.accepted_notif_title'),
'icon' => 'bell',
'body' => __('reports.accepted_notif_body', ['title' => $this->actie->title]),
'link' => route('acties.actie', $this->actie->slug),
];
}

/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
$url = config('app.url') . '/actie/' . $this->actie->slug;

return (new MailMessage())
->subject(__("reports.report_accepted_subject") . ' | ' . config('app.name'))
->greeting(__("reports.report_accepted_greeting") . ' ' . $this->user->name . ',')
->line(__("reports.report_accepted_message", ['title' => $this->actie->title]))
->action(__("reports.report_accepted_action"), $url)
->salutation(__('emails.salutation'));
}
}
19 changes: 14 additions & 5 deletions resources/js/components/CoordinatesFormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
<div>
<div class="form-group mb-2">
<div class="w-full text-sm my-2 mb-5 mx-1">
<label>
<input name="hasNoLatLng" v-model="hasNoLatLng" type="checkbox"/>
Deze actie heeft geen specifieke locatie.
</label>
<div v-if="frontend">
<Checkbox v-model="hasNoLatLng" :binary="true" name="hasNoLatLng" id="hasNoLatLng" class="mr-2" />
<label for="hasNoLatLng" class="text-sm text-gray-900">
{{__("reports.has_no_latlng") ?? "Deze actie heeft geen specifieke locatie."}}
</label>
</div>
<div v-else>
<input v-model="hasNoLatLng" type="checkbox" name="hasNoLatLng" id="hasNoLatLng" class="mr-2" />
<label for="hasNoLatLng" class="text-sm text-gray-900">
{{__("reports.has_no_latlng") ?? "Deze actie heeft geen specifieke locatie."}}
</label>
</div>
</div>
<form-autocomplete
v-if="!hasNoLatLng"
Expand Down Expand Up @@ -81,6 +89,8 @@ import FormAutocomplete from '../../views/assets/js/components/formfields/FormAu
import { latLng } from "leaflet"
import { ref, watch } from "vue"
import axios from 'axios';
import _ from 'lodash';
const __ = str => _.get(window.i18n, str)
const emit = defineEmits(['input'])
Expand Down Expand Up @@ -136,7 +146,6 @@ watch(hasNoLatLng, (newVal) => {
lat.value = null
lng.value = null
} else {
console.log(props.defaultCenter)
lat.value = props.defaultCenter[0].lat
lng.value = props.defaultCenter[0].lng
}
Expand Down
9 changes: 8 additions & 1 deletion resources/lang/nl/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,22 @@
'location_human' => 'Locatienaam (bijv. "Museumplein, Amsterdam")',
'organizer' => 'Organisator',
'organizer(s)' => 'Organisator(en)',
'has_no_latlng' => 'Deze actie heeft geen specifieke locatie.',
'date_reported' => 'Wanneer toegevoegd',
'status' => 'Status',
'view' => 'Bekijk',
'user_mismatch' => 'Er is iets misgegaan met het verifiëren van je identiteit. Probeer het opnieuw.',
// ReportAccepted notification
'accepted_notif_title' => 'Toegevoegde actie geaccepteerd',
'accepted_notif_body' => 'De actie \':title\' is geaccepteerd. Klik om te bekijken.',
'user_mismatch' => 'Er is iets misgegaan met het verifiëren van je identiteit. Probeer het opnieuw.',
// ReportReceived email
'report_received_subject' => 'Nieuwe actie aangemeld',
'report_received_greeting' => 'Beste administrator',
'report_received_message' => 'Er is een nieuwe actie aangemeld. Klik op de knop hieronder om de actie te bekijken.',
'report_received_action' => 'Aangemelde actie bekijken',
// ReportAccepted email
'report_accepted_subject' => 'Actie geaccepteerd',
'report_accepted_greeting' => 'Beste',
'report_accepted_message' => 'Je aangemelde actie met de titel \':title\' is geaccepteerd. Klik op de knop hieronder om de actie te bekijken.',
'report_accepted_action' => 'Actie bekijken',
];
5 changes: 2 additions & 3 deletions resources/views/assets/js/components/apps/ActieAgenda.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@
</div>
</div>
</div>
<div>
<!-- see more button -->
<div v-if="enableShowMore && heeftActies && total > perPage && currentPage !== lastPage && !appending" class="flex justify-center">
<!-- see more button -->
<div v-if="enableShowMore && heeftActies && total > perPage && currentPage !== lastPage && !appending" class="flex justify-center">
<button @click="currentPage++; appending=true; getActies()" class="btn secondary">{{__('general.load_more')}}</button>
</div>
<div v-else-if="appending" class="flex justify-center">
Expand Down
1 change: 1 addition & 0 deletions resources/views/assets/js/components/apps/HomeAgenda.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import { ref, computed, onMounted } from 'vue'
import debounce from 'lodash/debounce'
import _ from 'lodash'
import axios from 'axios'
const __ = str => _.get(window.i18n, str)
const props = defineProps({
Expand Down
9 changes: 6 additions & 3 deletions resources/views/assets/js/components/apps/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>

<div v-if="noNotifications" id="notifications-none" class="flex items-center justify-center h-24 w-full text-gray-600 font-medium">
<svg-vue icon="antdesign-inbox-o" class="w-5 h-5 mr-3" />
<InboxIcon class="w-5 h-5 mr-3" />
{{ __("dashboard.no_notifications") }}
</div>

Expand All @@ -29,8 +29,8 @@
>
<div class="flex items-start p-5">
<div class="flex-shrink-0 pt-1">
<div class="flex items-center justify-center text-xl w-10 h-10 rounded-full text-white" :class="{'text-white bg-[color:var(--wkid-blue)]': n.unread, 'bg-gray-100': !n.unread}">
<svg-vue :icon="n.data.icon" style="stroke: currentColor; height: 26px;" />
<div class="flex items-center justify-center text-xl w-10 h-10 rounded-full text-gray-400" :class="{'text-white bg-[color:var(--wkid-blue)]': n.unread, 'bg-gray-100': !n.unread}">
<BellIcon style="stroke: currentColor; height: 26px;" />
</div>
</div>
<div class="flex flex-col items-start flex-1 w-0 ml-3">
Expand Down Expand Up @@ -58,7 +58,10 @@

<script setup lang="ts">
import axios from 'axios';
import moment from 'moment';
import { computed, ref } from 'vue';
import InboxIcon from '&/antdesign-inbox-o.svg';
import BellIcon from '&/bell.svg';
import _ from 'lodash';
const __ = str => _.get(window.i18n, str)
Expand Down
11 changes: 7 additions & 4 deletions resources/views/assets/js/components/apps/Organizers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,15 @@
limit: props.max ?? null
}
}).then((response) => {
if (appending.value) {
organizers.value = organizers.value.concat(response.data.acties.data)
if (props.max) {
organizers.value = response.data.organizers
return
}
else if (appending.value) {
organizers.value = organizers.value.concat(response.data.organizers.data)
} else {
organizers.value = response.data.acties.data
organizers.value = response.data.organizers.data
}
organizers.value = response.data.organizers.data
currentPage.value = response.data.organizers.current_page
lastPage.value = response.data.organizers.last_page
perPage.value = response.data.organizers.per_page
Expand Down
2 changes: 1 addition & 1 deletion resources/views/assets/js/components/apps/Referenties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const props = defineProps({
},
routes: {
type: Object,
required: true,
default: () => {},
},
themes: {
type: Array,
Expand Down
4 changes: 2 additions & 2 deletions resources/views/assets/js/components/partials/Actie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
</ul>
<div
v-if="actie.distance"
class="relative self-start inline-block bg-[color:#8a8a8a7d] px-2 py-1 mr-1 mb-1 text-xs font-medium leading-5 text-gray-400 uppercase bg-gray-100 rounded"
class="relative self-start inline-block px-2 py-1 mr-1 mb-1 text-xs font-medium leading-5 text-gray-400 uppercase bg-gray-100 rounded"
>
<span class="flex items-center text-white" rel="theme">
<span class="flex items-center" rel="theme">
<LocationIcon style="fill: currentColor; width: 14px; height: 14px;" />
&nbsp; {{ actie.distance + ' km' }}<br/>
</span>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/notifications.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class="absolute top-0 left-2 sm:left-auto right-2 sm:right-0 max-w-lg mt-[70px]
<div id="notification-li-{{ $index + 1 }}" class="flex flex-col border-b border-gray-200 @if(!isset($show_all_notifications)){{ 'hover:bg-gray-50' }}@endif">
<div class="flex items-start p-5">
<div class="flex items-center justify-center text-xl w-10 h-10 rounded-full text-gray-400 bg-gray-100">
@svg(@$notification_data->icon, ['style' => 'stroke: currentColor; height: 26px;'])
@svg('bell', ['style' => 'stroke: currentColor; height: 26px;'])
</div>
<div class="flex flex-col items-start flex-1 w-0 ml-3">
<a href="{{ @$notification_data->link }}">
Expand Down

0 comments on commit 63cfbe1

Please sign in to comment.