allow vorstand to send mail + notifications #601
@ -16,7 +16,7 @@ use crate::tera::Config;
|
|||||||
#[get("/mail")]
|
#[get("/mail")]
|
||||||
async fn index(
|
async fn index(
|
||||||
db: &State<SqlitePool>,
|
db: &State<SqlitePool>,
|
||||||
admin: AdminUser,
|
admin: VorstandUser,
|
||||||
flash: Option<FlashMessage<'_>>,
|
flash: Option<FlashMessage<'_>>,
|
||||||
) -> Template {
|
) -> Template {
|
||||||
let mut context = Context::new();
|
let mut context = Context::new();
|
||||||
@ -65,7 +65,7 @@ async fn update(
|
|||||||
db: &State<SqlitePool>,
|
db: &State<SqlitePool>,
|
||||||
data: Form<MailToSend<'_>>,
|
data: Form<MailToSend<'_>>,
|
||||||
config: &State<Config>,
|
config: &State<Config>,
|
||||||
admin: AdminUser,
|
admin: VorstandUser,
|
||||||
) -> Flash<Redirect> {
|
) -> Flash<Redirect> {
|
||||||
let d = data.into_inner();
|
let d = data.into_inner();
|
||||||
Log::create(db, format!("{admin:?} trying to send this mail: {d:?}")).await;
|
Log::create(db, format!("{admin:?} trying to send this mail: {d:?}")).await;
|
||||||
|
@ -2,7 +2,7 @@ use crate::model::{
|
|||||||
log::Log,
|
log::Log,
|
||||||
notification::Notification,
|
notification::Notification,
|
||||||
role::Role,
|
role::Role,
|
||||||
user::{AdminUser, User, UserWithDetails},
|
user::{AdminUser, User, UserWithDetails, VorstandUser},
|
||||||
};
|
};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use rocket::{
|
use rocket::{
|
||||||
@ -18,7 +18,7 @@ use sqlx::SqlitePool;
|
|||||||
#[get("/notification")]
|
#[get("/notification")]
|
||||||
async fn index(
|
async fn index(
|
||||||
db: &State<SqlitePool>,
|
db: &State<SqlitePool>,
|
||||||
user: AdminUser,
|
user: VorstandUser,
|
||||||
flash: Option<FlashMessage<'_>>,
|
flash: Option<FlashMessage<'_>>,
|
||||||
) -> Template {
|
) -> Template {
|
||||||
let mut context = Context::new();
|
let mut context = Context::new();
|
||||||
@ -62,7 +62,7 @@ pub struct NotificationToSendUser {
|
|||||||
async fn send_group(
|
async fn send_group(
|
||||||
db: &State<SqlitePool>,
|
db: &State<SqlitePool>,
|
||||||
data: Form<NotificationToSendGroup>,
|
data: Form<NotificationToSendGroup>,
|
||||||
admin: AdminUser,
|
admin: VorstandUser,
|
||||||
) -> Flash<Redirect> {
|
) -> Flash<Redirect> {
|
||||||
let d = data.into_inner();
|
let d = data.into_inner();
|
||||||
Log::create(
|
Log::create(
|
||||||
@ -89,7 +89,7 @@ async fn send_group(
|
|||||||
async fn send_user(
|
async fn send_user(
|
||||||
db: &State<SqlitePool>,
|
db: &State<SqlitePool>,
|
||||||
data: Form<NotificationToSendUser>,
|
data: Form<NotificationToSendUser>,
|
||||||
admin: AdminUser,
|
admin: VorstandUser,
|
||||||
) -> Flash<Redirect> {
|
) -> Flash<Redirect> {
|
||||||
let d = data.into_inner();
|
let d = data.into_inner();
|
||||||
Log::create(
|
Log::create(
|
||||||
|
@ -155,6 +155,13 @@
|
|||||||
<a href="/board/boathouse"
|
<a href="/board/boathouse"
|
||||||
class="block w-100 py-2 hover:text-primary-600">Bootshaus</a>
|
class="block w-100 py-2 hover:text-primary-600">Bootshaus</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="py-1">
|
||||||
|
<a href="/admin/mail" class="block w-100 py-2 hover:text-primary-600">Mail ausschicken</a>
|
||||||
|
</li>
|
||||||
|
<li class="py-1">
|
||||||
|
<a href="/admin/notification"
|
||||||
|
class="block w-100 py-2 hover:text-primary-600">Nachricht ausschreiben</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -169,19 +176,12 @@
|
|||||||
<li class="py-1">
|
<li class="py-1">
|
||||||
<a href="/admin/user" class="block w-100 py-2 hover:text-primary-600">User</a>
|
<a href="/admin/user" class="block w-100 py-2 hover:text-primary-600">User</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="py-1">
|
|
||||||
<a href="/admin/mail" class="block w-100 py-2 hover:text-primary-600">Mail</a>
|
|
||||||
</li>
|
|
||||||
<li class="py-1">
|
<li class="py-1">
|
||||||
<a href="/admin/rss" class="block w-100 py-2 hover:text-primary-600">Logs</a>
|
<a href="/admin/rss" class="block w-100 py-2 hover:text-primary-600">Logs</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="py-1">
|
<li class="py-1">
|
||||||
<a href="/admin/list" class="block w-100 py-2 hover:text-primary-600">Fingerabdruck-Liste überprüfen</a>
|
<a href="/admin/list" class="block w-100 py-2 hover:text-primary-600">Fingerabdruck-Liste überprüfen</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="py-1">
|
|
||||||
<a href="/admin/notification"
|
|
||||||
class="block w-100 py-2 hover:text-primary-600">Nachricht ausschreiben</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user