mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +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)
|
Images.reindex_image(conn.assigns.image)
|
||||||
UserStatistics.inc_stat(conn.assigns.current_user, :comments_posted)
|
UserStatistics.inc_stat(conn.assigns.current_user, :comments_posted)
|
||||||
|
|
||||||
conn
|
index(conn, %{"comment_id" => comment.id})
|
||||||
|> put_flash(:info, "Comment created successfully.")
|
|
||||||
|> redirect(to: Routes.image_path(conn, :show, image) <> "#comment_#{comment.id}")
|
|
||||||
|
|
||||||
_error ->
|
_error ->
|
||||||
conn
|
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
|
= if @changeset.action do
|
||||||
.alert.alert-danger
|
.alert.alert-danger
|
||||||
p Oops, something went wrong! Please check the errors below.
|
p Oops, something went wrong! Please check the errors below.
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
= render PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn
|
= render PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn
|
||||||
|
|
||||||
- @image.commenting_allowed ->
|
- @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 ->
|
- true ->
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue