Browse Source

rename user to sign

main
ghost 11 months ago
parent
commit
b1dd356235
  1. 2
      src/Controller/ModuleController.php
  2. 2
      src/Controller/RoomController.php
  3. 16
      templates/default/module/post.html.twig

2
src/Controller/ModuleController.php

@ -156,7 +156,7 @@ class ModuleController extends AbstractController @@ -156,7 +156,7 @@ class ModuleController extends AbstractController
[
'enabled' => in_array($request->get('namespace'), $public),
'namespace' => $request->get('namespace'),
'user' => $request->get('user'),
'sign' => $request->get('sign'),
'error' => $request->get('error'),
'message' => $message,
'ip' => $request->getClientIp()

2
src/Controller/RoomController.php

@ -382,7 +382,7 @@ class RoomController extends AbstractController @@ -382,7 +382,7 @@ class RoomController extends AbstractController
sprintf(
'%s@%s',
time(), // @TODO save timestamp as part of key to keep timing actual for the chat feature
$request->get('user') === 'ip' ? $request->getClientIp() : 'anon'
$request->get('sign') === 'ip' ? $request->getClientIp() : 'anon'
),
$request->get('message')
)

16
templates/default/module/post.html.twig

@ -4,20 +4,20 @@ @@ -4,20 +4,20 @@
<output name="error" for="form-post-message">{{ error }}</output>
{% endif %}
<textarea name="message" id="form-post-message" placeholder="{{ 'enter your message...' | trans }}">{{ message }}</textarea>
{% if user == 'anon' or user != 'ip' %}
<input type="radio" name="user" value="anon" id="form-post-user-anon" checked="checked" />
{% if sign == 'anon' or sign != 'ip' %}
<input type="radio" name="sign" value="anon" id="form-post-sign-anon" checked="checked" />
{% else %}
<input type="radio" name="user" value="anon" id="form-post-user-anon" />
<input type="radio" name="sign" value="anon" id="form-post-sign-anon" />
{% endif %}
<label for="form-post-user-anon">
<label for="form-post-sign-anon">
{{ 'anon' | trans }}
</label>
{% if user == 'ip' %}
<input type="radio" name="user" value="ip" id="form-post-user-ip" checked="checked" />
{% if sign == 'ip' %}
<input type="radio" name="sign" value="ip" id="form-post-sign-ip" checked="checked" />
{% else %}
<input type="radio" name="user" value="ip" id="form-post-user-ip" />
<input type="radio" name="sign" value="ip" id="form-post-sign-ip" />
{% endif %}
<label for="form-post-user-ip">
<label for="form-post-sign-ip">
@{{ ip }}
</label>
<button type="submit">{{ 'send' | trans }}</button>

Loading…
Cancel
Save