From 66c3c1570d409fcbe1a6be7d1b76c9731473eb1a Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Thu, 16 Jun 2022 13:40:37 +0300 Subject: [PATCH] Remove those ridiculous helper functions --- views/modal.qtpl | 88 ++++---- views/modal.qtpl.go | 511 ++++++++++++++++++++------------------------ 2 files changed, 276 insertions(+), 323 deletions(-) diff --git a/views/modal.qtpl b/views/modal.qtpl index 30994d6..c692862 100644 --- a/views/modal.qtpl +++ b/views/modal.qtpl @@ -6,44 +6,61 @@ {% code lc := l18n.FromRequest(rq) %} -{%= modalBegin( - "delete", - hyphaName, - ` method="post"`, - fmt.Sprintf(lc.Get("ui.ask_delete"), beautifulLink(hyphaName))) %} - -

{%s lc.Get("ui.ask_delete_tip") %}

-{%= modalEnd(hyphaName, true, lc) %} +
+ +
{% endfunc %} {% func RemoveMediaAsk(rq *http.Request, hyphaName string) %} {% code lc := l18n.FromRequest(rq) %} -{%= modalBegin( - "remove-media", - hyphaName, - ` method="post"`, - fmt.Sprintf(lc.Get("ui.ask_remove_media"), beautifulLink(hyphaName))) %} - -{%= modalEnd(hyphaName, true, lc) %} +
+ +
{% endfunc %} -bloody hell !! - {% func RenameAsk(rq *http.Request, hyphaName string) %} {% code lc := l18n.FromRequest(rq) %} -{%= modalBegin( - "rename", - hyphaName, - ` method="post" enctype="multipart/form-data"`, - fmt.Sprintf(lc.Get("ui.ask_rename"), beautifulLink(hyphaName))) %} +
+