Commit 854f9f75 authored by Emma's avatar Emma

show post/save instead of 'submit' on comment form

parent 1f66aed5
......@@ -48,7 +48,11 @@ final class CommentType extends AbstractType {
$this->addUserFlagOption($builder, $options['forum']);
$builder->add('submit', SubmitType::class);
$editing = $builder->getData() && $builder->getData()->getEntityId();
$builder->add('submit', SubmitType::class, [
'label' => $editing ? 'action.save' : 'action.post',
]);
}
/**
......
......@@ -13,6 +13,11 @@ use Symfony\Component\Validator\Constraints as Assert;
* @NotForumBanned(forumPath="submission.forum", errorPath="body")
*/
class CommentData {
/**
* @var int|null
*/
private $entityId;
/**
* @var Submission
*/
......@@ -34,6 +39,7 @@ class CommentData {
public static function createFromComment(Comment $comment): self {
$self = new self($comment->getSubmission());
$self->entityId = $comment->getId();
$self->submission = $comment->getSubmission();
$self->body = $comment->getBody();
$self->userFlag = $comment->getUserFlag();
......@@ -69,6 +75,10 @@ class CommentData {
}
}
public function getEntityId(): ?int {
return $this->entityId;
}
public function getBody(): ?string {
return $this->body;
}
......
......@@ -53,7 +53,6 @@ comments:
comment_form:
comment: Kommentar
submit: Einreichen
edit_title: Kommentar bearbeiten
create_title: Kommentar einreichen
......
......@@ -69,7 +69,6 @@ comments:
comment_form:
comment: Σχόλιο
submit: Στειλε το
edit_title: Διόρθωση σχολίου
create_title: Γράφω σχόλιο
......
......@@ -26,6 +26,7 @@ action:
create: Create
compare: Compare
add: Add
post: Post
save: Save
add_moderator:
......@@ -76,7 +77,6 @@ comments:
comment_form:
comment: Comment
submit: Submit
edit_title: Editing comment
create_title: Posting a comment
......
......@@ -54,7 +54,6 @@ comments:
comment_form:
comment: Komento
submit: Afiŝi
edit_title: Redaktas komenton
create_title: Skribas komenton
......
......@@ -74,7 +74,6 @@ comments:
comment_form:
comment: Comentar
submit: Publicar
edit_title: Editando comentario
create_title: Publicando un comentario
......
......@@ -54,7 +54,6 @@ comments:
comment_form:
comment: Kommentoi
submit: Lisää
edit_title: Muokataan kommenttia
create_title: Lisätään kommentti
......
......@@ -65,7 +65,6 @@ comments:
comment_form:
comment: Commentaire
submit: Envoyer
edit_title: Modifier commentaire
create_title: Publier un commentaire
......
......@@ -53,7 +53,6 @@ comments:
comment_form:
comment: Kommentar
submit: Send
edit_title: Redigerer en kommentar
create_title: Poster en kommentar
......
......@@ -67,7 +67,6 @@ comments:
comment_form:
comment: Comentar
submit: Enviar
edit_title: Alterando comentário
create_title: Enviando comentário
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment