7 changed files with 120 additions and 7 deletions
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
<?php |
||||
namespace App\Controller; |
||||
|
||||
use App\Util\NostrKeyUtil; |
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
||||
use Symfony\Component\HttpFoundation\Response; |
||||
use Symfony\Component\Routing\Attribute\Route; |
||||
|
||||
class FeedbackController extends AbstractController |
||||
{ |
||||
#[Route('/feedback', name: 'feedback_form', methods: ['GET'])] |
||||
public function form(NostrKeyUtil $keyUtil): Response |
||||
{ |
||||
$recipients = [ |
||||
$keyUtil->npubToHex('npub1ez09adke4vy8udk3y2skwst8q5chjgqzym9lpq4u58zf96zcl7kqyry2lz'), |
||||
$keyUtil->npubToHex('npub1636uujeewag8zv8593lcvdrwlymgqre6uax4anuq3y5qehqey05sl8qpl4'), |
||||
]; |
||||
return $this->render('feedback/form.html.twig', [ |
||||
'recipients' => $recipients, |
||||
]); |
||||
} |
||||
} |
||||
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
{% extends 'layout.html.twig' %} |
||||
{% block title %}Send Feedback{% endblock %} |
||||
|
||||
{% block body %} |
||||
<div class="w-container mt-5"> |
||||
<twig:Atoms:PageHeading heading="Feedback" tagline="Bug reports and feature requests welcome"/> |
||||
<form data-controller="nostr-single-sign" data-nostr-single-sign-event-value='{{ { |
||||
"kind": 24, |
||||
"tags": [...recipients|map(r => ["p", r]), ['client', 'Decent Newsroom']], |
||||
"content": "" |
||||
}|json_encode(constant('JSON_UNESCAPED_SLASHES')) }}' |
||||
data-nostr-single-sign-publish-url-value="/api/nostr/publish" |
||||
data-nostr-single-sign-csrf-token-value="{{ csrf_token('feedback') }}" |
||||
data-action="submit->nostr-single-sign#signAndPublish"> |
||||
<div data-nostr-single-sign-target="status"></div> |
||||
<div class="mb-3"> |
||||
<p>To: |
||||
{% for r in recipients %} |
||||
<twig:Molecules:UserFromNpub :ident="r" /> |
||||
{% if not loop.last %}and {% endif %} |
||||
{% endfor %} |
||||
</p> |
||||
<label for="feedback-message" class="form-label">Your Message</label> |
||||
<textarea id="feedback-message" class="form-control" rows="5" required data-action="input->nostr-single-sign#preparePreview"></textarea> |
||||
</div> |
||||
<div class="actions"> |
||||
<button type="submit" class="btn btn-primary" data-nostr-single-sign-target="publishButton">Send Feedback</button> |
||||
</div> |
||||
<h5 class="mt-4">Preview</h5> |
||||
<pre data-nostr-single-sign-target="computedPreview" class="bg-light p-2"></pre> |
||||
</form> |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
Loading…
Reference in new issue