mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
reenable async commenting
This commit is contained in:
parent
df3467df7b
commit
0da19674d1
3 changed files with 5 additions and 5 deletions
|
@ -53,9 +53,7 @@ defmodule PhilomenaWeb.Image.CommentController do
|
|||
Images.reindex_image(conn.assigns.image)
|
||||
UserStatistics.inc_stat(conn.assigns.current_user, :comments_posted)
|
||||
|
||||
conn
|
||||
|> put_flash(:info, "Comment created successfully.")
|
||||
|> redirect(to: Routes.image_path(conn, :show, image) <> "#comment_#{comment.id}")
|
||||
index(conn, %{"comment_id" => comment.id})
|
||||
|
||||
_error ->
|
||||
conn
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
= form_for @changeset, Routes.image_comment_path(@conn, :create, @image), fn f ->
|
||||
- options = if(assigns[:remote], do: [data: [remote: "true"], id: "js-comment-form"], else: [])
|
||||
|
||||
= form_for @changeset, Routes.image_comment_path(@conn, :create, @image), options, fn f ->
|
||||
= if @changeset.action do
|
||||
.alert.alert-danger
|
||||
p Oops, something went wrong! Please check the errors below.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
= render PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn
|
||||
|
||||
- @image.commenting_allowed ->
|
||||
= render PhilomenaWeb.Image.CommentView, "_form.html", image: @image, changeset: @comment_changeset, conn: @conn
|
||||
= render PhilomenaWeb.Image.CommentView, "_form.html", image: @image, changeset: @comment_changeset, remote: true, conn: @conn
|
||||
|
||||
- true ->
|
||||
|
||||
|
|
Loading…
Reference in a new issue