cull warnings

This commit is contained in:
byte[] 2019-09-30 20:41:51 -04:00
parent e90033f2e1
commit d1b329eb76
15 changed files with 0 additions and 224 deletions

View file

@ -1,62 +0,0 @@
defmodule PhilomenaWeb.CommentController do
use PhilomenaWeb, :controller
alias Philomena.Comments
alias Philomena.Comments.Comment
def index(conn, _params) do
comments = Comments.list_comments()
render(conn, "index.html", comments: comments)
end
def new(conn, _params) do
changeset = Comments.change_comment(%Comment{})
render(conn, "new.html", changeset: changeset)
end
def create(conn, %{"comment" => comment_params}) do
case Comments.create_comment(comment_params) do
{:ok, comment} ->
conn
|> put_flash(:info, "Comment created successfully.")
|> redirect(to: Routes.comment_path(conn, :show, comment))
{:error, %Ecto.Changeset{} = changeset} ->
render(conn, "new.html", changeset: changeset)
end
end
def show(conn, %{"id" => id}) do
comment = Comments.get_comment!(id)
render(conn, "show.html", comment: comment)
end
def edit(conn, %{"id" => id}) do
comment = Comments.get_comment!(id)
changeset = Comments.change_comment(comment)
render(conn, "edit.html", comment: comment, changeset: changeset)
end
def update(conn, %{"id" => id, "comment" => comment_params}) do
comment = Comments.get_comment!(id)
case Comments.update_comment(comment, comment_params) do
{:ok, comment} ->
conn
|> put_flash(:info, "Comment updated successfully.")
|> redirect(to: Routes.comment_path(conn, :show, comment))
{:error, %Ecto.Changeset{} = changeset} ->
render(conn, "edit.html", comment: comment, changeset: changeset)
end
end
def delete(conn, %{"id" => id}) do
comment = Comments.get_comment!(id)
{:ok, _comment} = Comments.delete_comment(comment)
conn
|> put_flash(:info, "Comment deleted successfully.")
|> redirect(to: Routes.comment_path(conn, :index))
end
end

View file

@ -21,23 +21,6 @@ defmodule PhilomenaWeb.ImageController do
render(conn, "index.html", images: images)
end
def new(conn, _params) do
changeset = Images.change_image(%Image{})
render(conn, "new.html", changeset: changeset)
end
def create(conn, %{"image" => image_params}) do
case Images.create_image(image_params) do
{:ok, image} ->
conn
|> put_flash(:info, "Image created successfully.")
|> redirect(to: Routes.image_path(conn, :show, image))
{:error, %Ecto.Changeset{} = changeset} ->
render(conn, "new.html", changeset: changeset)
end
end
def show(conn, %{"id" => id}) do
image = Images.get_image!(id)
render(conn, "show.html", image: image)

View file

@ -2,61 +2,14 @@ defmodule PhilomenaWeb.TagController do
use PhilomenaWeb, :controller
alias Philomena.Tags
alias Philomena.Tags.Tag
def index(conn, _params) do
tags = Tags.list_tags()
render(conn, "index.html", tags: tags)
end
def new(conn, _params) do
changeset = Tags.change_tag(%Tag{})
render(conn, "new.html", changeset: changeset)
end
def create(conn, %{"tag" => tag_params}) do
case Tags.create_tag(tag_params) do
{:ok, tag} ->
conn
|> put_flash(:info, "Tag created successfully.")
|> redirect(to: Routes.tag_path(conn, :show, tag))
{:error, %Ecto.Changeset{} = changeset} ->
render(conn, "new.html", changeset: changeset)
end
end
def show(conn, %{"id" => id}) do
tag = Tags.get_tag!(id)
render(conn, "show.html", tag: tag)
end
def edit(conn, %{"id" => id}) do
tag = Tags.get_tag!(id)
changeset = Tags.change_tag(tag)
render(conn, "edit.html", tag: tag, changeset: changeset)
end
def update(conn, %{"id" => id, "tag" => tag_params}) do
tag = Tags.get_tag!(id)
case Tags.update_tag(tag, tag_params) do
{:ok, tag} ->
conn
|> put_flash(:info, "Tag updated successfully.")
|> redirect(to: Routes.tag_path(conn, :show, tag))
{:error, %Ecto.Changeset{} = changeset} ->
render(conn, "edit.html", tag: tag, changeset: changeset)
end
end
def delete(conn, %{"id" => id}) do
tag = Tags.get_tag!(id)
{:ok, _tag} = Tags.delete_tag(tag)
conn
|> put_flash(:info, "Tag deleted successfully.")
|> redirect(to: Routes.tag_path(conn, :index))
end
end

View file

@ -1,5 +0,0 @@
<h1>Edit Comment</h1>
<%= render "form.html", Map.put(assigns, :action, Routes.comment_path(@conn, :update, @comment)) %>
<span><%= link "Back", to: Routes.comment_path(@conn, :index) %></span>

View file

@ -1,11 +0,0 @@
<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div>
<%= submit "Save" %>
</div>
<% end %>

View file

@ -1,24 +0,0 @@
<h1>Listing Comments</h1>
<table>
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<%= for comment <- @comments do %>
<tr>
<td>
<%= link "Show", to: Routes.comment_path(@conn, :show, comment) %>
<%= link "Edit", to: Routes.comment_path(@conn, :edit, comment) %>
<%= link "Delete", to: Routes.comment_path(@conn, :delete, comment), method: :delete, data: [confirm: "Are you sure?"] %>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= link "New Comment", to: Routes.comment_path(@conn, :new) %></span>

View file

@ -1,5 +0,0 @@
<h1>New Comment</h1>
<%= render "form.html", Map.put(assigns, :action, Routes.comment_path(@conn, :create)) %>
<span><%= link "Back", to: Routes.comment_path(@conn, :index) %></span>

View file

@ -1,8 +0,0 @@
<h1>Show Comment</h1>
<ul>
</ul>
<span><%= link "Edit", to: Routes.comment_path(@conn, :edit, @comment) %></span>
<span><%= link "Back", to: Routes.comment_path(@conn, :index) %></span>

View file

@ -1,5 +0,0 @@
<h1>Edit Image</h1>
<%= render "form.html", Map.put(assigns, :action, Routes.image_path(@conn, :update, @image)) %>
<span><%= link "Back", to: Routes.image_path(@conn, :index) %></span>

View file

@ -1,11 +0,0 @@
<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div>
<%= submit "Save" %>
</div>
<% end %>

View file

@ -1,5 +0,0 @@
<h1>New Image</h1>
<%= render "form.html", Map.put(assigns, :action, Routes.image_path(@conn, :create)) %>
<span><%= link "Back", to: Routes.image_path(@conn, :index) %></span>

View file

@ -1,5 +0,0 @@
<h1>Edit Tag</h1>
<%= render "form.html", Map.put(assigns, :action, Routes.tag_path(@conn, :update, @tag)) %>
<span><%= link "Back", to: Routes.tag_path(@conn, :index) %></span>

View file

@ -1,11 +0,0 @@
<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div>
<%= submit "Save" %>
</div>
<% end %>

View file

@ -1,5 +0,0 @@
<h1>New Tag</h1>
<%= render "form.html", Map.put(assigns, :action, Routes.tag_path(@conn, :create)) %>
<span><%= link "Back", to: Routes.tag_path(@conn, :index) %></span>

View file

@ -1,3 +0,0 @@
defmodule PhilomenaWeb.CommentView do
use PhilomenaWeb, :view
end