mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
use struct instead of keyword
This commit is contained in:
parent
19c9bcb3c0
commit
0a62a3d5ce
3 changed files with 17 additions and 7 deletions
|
@ -18,7 +18,7 @@ defmodule Philomena.Textile.Renderer do
|
|||
parsed =
|
||||
posts
|
||||
|> Enum.map(fn post ->
|
||||
Parser.parse(@parser, post[:body])
|
||||
Parser.parse(@parser, post.body)
|
||||
end)
|
||||
|
||||
images =
|
||||
|
|
|
@ -22,20 +22,20 @@ defmodule PhilomenaWeb.CommissionController do
|
|||
|
||||
item_descriptions =
|
||||
commission.items
|
||||
|> Enum.map(&[body: &1.description])
|
||||
|> Enum.map(&%{body: &1.description})
|
||||
|> Renderer.render_collection()
|
||||
|
||||
item_add_ons =
|
||||
commission.items
|
||||
|> Enum.map(&[body: &1.add_ons])
|
||||
|> Enum.map(&%{body: &1.add_ons})
|
||||
|> Renderer.render_collection()
|
||||
|
||||
[information, contact, will_create, will_not_create] =
|
||||
Renderer.render_collection([
|
||||
[body: commission.information],
|
||||
[body: commission.contact],
|
||||
[body: commission.will_create],
|
||||
[body: commission.will_not_create]
|
||||
%{body: commission.information},
|
||||
%{body: commission.contact},
|
||||
%{body: commission.will_create},
|
||||
%{body: commission.will_not_create}
|
||||
])
|
||||
|
||||
rendered =
|
||||
|
|
10
lib/philomena_web/controllers/topic/post_controller.ex
Normal file
10
lib/philomena_web/controllers/topic/post_controller.ex
Normal file
|
@ -0,0 +1,10 @@
|
|||
defmodule PhilomenaWeb.Topic.PostController do
|
||||
use PhilomenaWeb, :controller
|
||||
|
||||
#alias Philomena.{Forums.Forum}
|
||||
#alias Philomena.Posts
|
||||
|
||||
plug PhilomenaWeb.FilterBannedUsersPlug
|
||||
plug PhilomenaWeb.CanaryMapPlug, create: :show, edit: :show, update: :show
|
||||
plug :load_and_authorize_resource, model: Forum, id_field: "short_name", id_name: "forum_id", persisted: true
|
||||
end
|
Loading…
Reference in a new issue