Skip to content

Commit

Permalink
#422 mix format 🙄
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Sep 14, 2023
1 parent 3a9a83d commit f212cd5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 27 deletions.
10 changes: 5 additions & 5 deletions lib/app/list.ex
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ defmodule App.List do
def remove_item_from_list(item_cid, list_cid, person_id) do
list = get_list_by_cid!(list_cid)
# get existing list.seq
seq = get_list_seq(list)
# remove the item_cid from the list.seq:
|> Useful.remove_item_from_list(item_cid)
|> Enum.join(",")
seq =
get_list_seq(list)
# remove the item_cid from the list.seq:
|> Useful.remove_item_from_list(item_cid)
|> Enum.join(",")

update_list(list, %{seq: seq, person_id: person_id})
end


# feel free to refactor this to use pattern matching:
def add_papertrail_item_to_all_list(tuple) do
# extract the item from the tuple:
Expand Down
64 changes: 42 additions & 22 deletions lib/app_web/templates/list/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
<div class="sm:flex sm:items-center">
<div class="sm:flex-auto">
<p class="mt-2 text-sm text-gray-700 text-center">
These are <b>your <code>Lists</code></b>.
Use <b><code>Lists</code></b> to <b>organize</b> your <b><code>Items</code></b>. <br />
Easily create a <b><i>New</i> <code>List</code></b>
These are <b>your <code>Lists</code></b>.
Use <b><code>Lists</code></b>
to <b>organize</b>
your <b><code>Items</code></b>. <br /> Easily create a
<b><i>New</i> <code>List</code></b>
for a project or area you need to keep track of.

</p>
</div>
<div class="mt-4 sm:ml-16 sm:mt-0 sm:flex-none">
Expand All @@ -29,31 +30,50 @@
<table class="min-w-full border-separate border-spacing-0">
<thead>
<tr>
<th scope="col" class="sticky top-0 z-10 border-b border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8">Name</th>
<th scope="col" class="sticky top-0 z-10 hidden border-b border-gray-300 bg-white bg-opacity-75 px-3 py-3.5 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:table-cell">Item Count</th>
<th scope="col" class="sticky top-0 z-10 border-b border-gray-300 bg-white bg-opacity-75 py-3.5 pl-3 pr-4 backdrop-blur backdrop-filter sm:pr-6 lg:pr-8">
<th
scope="col"
class="sticky top-0 z-10 border-b border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8"
>
Name
</th>
<th
scope="col"
class="sticky top-0 z-10 hidden border-b border-gray-300 bg-white bg-opacity-75 px-3 py-3.5 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:table-cell"
>
Item Count
</th>
<th
scope="col"
class="sticky top-0 z-10 border-b border-gray-300 bg-white bg-opacity-75 py-3.5 pl-3 pr-4 backdrop-blur backdrop-filter sm:pr-6 lg:pr-8"
>
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody>
<%= for list <- @lists do %>
<tr>
<td class="whitespace-nowrap border-b border-gray-200 py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">
<tr>
<td class="whitespace-nowrap border-b border-gray-200 py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">
<%= String.capitalize(list.name) %>
</td>
<td class="whitespace-nowrap border-b border-gray-200 hidden px-3 py-4 text-sm text-gray-500 sm:table-cell"><%= list_item_count(list) %></td>
<td class="relative whitespace-nowrap border-b border-gray-200 py-4 pr-4 pl-3 text-right text-sm font-medium sm:pr-8 lg:pr-8">
<%= link("Edit", to: Routes.list_path(@conn, :edit, list), class: "") %>
<!-- <a href="#" class="text-indigo-600 hover:text-indigo-900">Edit<span class="sr-only"></span></a> -->
<%= link("Delete",
to: Routes.list_path(@conn, :delete, list),
method: :delete,
data: [confirm: "Are you sure you want to delete this list?"]
) %>
</td>

</tr>
</td>
<td class="whitespace-nowrap border-b border-gray-200 hidden px-3 py-4 text-sm text-gray-500 sm:table-cell">
<%= list_item_count(list) %>
</td>
<td class="relative whitespace-nowrap border-b border-gray-200 py-4 pr-4 pl-3 text-right text-sm font-medium sm:pr-8 lg:pr-8">
<%= link("Edit",
to: Routes.list_path(@conn, :edit, list),
class: ""
) %>
<!-- <a href="#" class="text-indigo-600 hover:text-indigo-900">Edit<span class="sr-only"></span></a> -->
<%= link("Delete",
to: Routes.list_path(@conn, :delete, list),
method: :delete,
data: [
confirm: "Are you sure you want to delete this list?"
]
) %>
</td>
</tr>
<% end %>
<!-- More people... -->
</tbody>
Expand Down

0 comments on commit f212cd5

Please sign in to comment.