Compare commits
No commits in common. "37dccdd4db2ff8abb2a09062d9c2046f162be5b1" and "0593fcdb9aae5e18063620c0c46109d063605865" have entirely different histories.
37dccdd4db
...
0593fcdb9a
|
@ -148,7 +148,3 @@ label.sidebar-toggle > .oi {
|
||||||
.item-content > .raw-content {
|
.item-content > .raw-content {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-table tr > .date {
|
|
||||||
min-width: 200px;
|
|
||||||
}
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ defmodule FrenzyWeb.ItemController do
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
def read(conn, params) do
|
def read(conn, _params) do
|
||||||
item = conn.assigns[:item] |> Repo.preload(:feed)
|
item = conn.assigns[:item] |> Repo.preload(:feed)
|
||||||
|
|
||||||
changeset =
|
changeset =
|
||||||
|
@ -42,11 +42,10 @@ defmodule FrenzyWeb.ItemController do
|
||||||
})
|
})
|
||||||
|
|
||||||
{:ok, item} = Repo.update(changeset)
|
{:ok, item} = Repo.update(changeset)
|
||||||
path = Map.get(params, "redirect") || Routes.item_path(Endpoint, :show, item.id)
|
redirect(conn, to: Routes.item_path(Endpoint, :show, item.id))
|
||||||
redirect(conn, to: path)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def unread(conn, params) do
|
def unread(conn, _params) do
|
||||||
item = conn.assigns[:item] |> Repo.preload(:feed)
|
item = conn.assigns[:item] |> Repo.preload(:feed)
|
||||||
|
|
||||||
changeset =
|
changeset =
|
||||||
|
@ -55,8 +54,7 @@ defmodule FrenzyWeb.ItemController do
|
||||||
read_date: nil
|
read_date: nil
|
||||||
})
|
})
|
||||||
|
|
||||||
{:ok, item} = Repo.update(changeset)
|
Repo.update(changeset)
|
||||||
path = Map.get(params, "redirect") || Routes.item_path(Endpoint, :show, item.id)
|
redirect(conn, to: Routes.item_path(Endpoint, :show, item.id))
|
||||||
redirect(conn, to: path)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,32 +25,19 @@
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<table class="table table-striped item-table">
|
<table class="table table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<%= for item <- @items do %>
|
<%= for item <- @items do %>
|
||||||
<tr <%= if item.read do %>class="item-read"<% end %>>
|
<tr <%= if item.read do %>class="item-read"<% end %>>
|
||||||
<td>
|
<td>
|
||||||
<a href="<%= Routes.item_path(@conn, :show, item.id) %>"><%= item.title || "(Untitled)" %></a>
|
<a href="<%= Routes.item_path(@conn, :show, item.id) %>"><%= item.title || "(Untitled)" %></a>
|
||||||
</td>
|
</td>
|
||||||
<td class="date">
|
<td>
|
||||||
<%= if item.date do %>
|
<%= if item.date do %>
|
||||||
<% {:ok, date} = Timex.format(item.date, "{YYYY}-{0M}-{0D} {0h12}:{m} {AM}") %>
|
<% {:ok, date} = Timex.format(item.date, "{YYYY}-{0M}-{0D} {0h12}:{m} {AM}") %>
|
||||||
<%= date %>
|
<%= date %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="py-0 align-middle">
|
|
||||||
<%= if item.read do %>
|
|
||||||
<%= form_tag Routes.item_path(@conn, :unread, item.id), method: :post do %>
|
|
||||||
<input type="hidden" name="redirect" value="<%=Routes.feed_path(@conn, :show, @feed.id) %>">
|
|
||||||
<%= submit "Unread", class: "btn btn-sm btn-secondary" %>
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
|
||||||
<%= form_tag Routes.item_path(@conn, :read, item.id), method: :post do %>
|
|
||||||
<input type="hidden" name="redirect" value="<%=Routes.feed_path(@conn, :show, @feed.id) %>">
|
|
||||||
<%= submit "Read", class: "btn btn-sm btn-secondary" %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<table class="table table-striped item-table">
|
<table class="table table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<%= for item <- @items do %>
|
<%= for item <- @items do %>
|
||||||
<tr <%= if item.read do %>class="item-read"<% end %>>
|
<tr <%= if item.read do %>class="item-read"<% end %>>
|
||||||
|
@ -15,33 +15,20 @@
|
||||||
<%= item.title || "(Untitled)" %>
|
<%= item.title || "(Untitled)" %>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
<td>
|
||||||
<a href="<%= Routes.feed_path(@conn, :show, item.feed.id) %>" style="white-space: nowrap;">
|
<a href="<%= Routes.feed_path(@conn, :show, item.feed.id) %>">
|
||||||
<%= if item.feed.favicon do %>
|
<%= if item.feed.favicon do %>
|
||||||
<img src="<%= item.feed.favicon %>" alt="<%= item.feed.title %> favicon" class="favicon">
|
<img src="<%= item.feed.favicon %>" alt="<%= item.feed.title %> favicon" class="favicon">
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= item.feed.title || "(Untitled)" %>
|
<%= item.feed.title || "(Untitled)" %>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="date align-middle">
|
<td>
|
||||||
<%= if item.date do %>
|
<%= if item.date do %>
|
||||||
<% {:ok, date} = Timex.format(item.date, "{YYYY}-{0M}-{0D} {0h12}:{m} {AM}") %>
|
<% {:ok, date} = Timex.format(item.date, "{YYYY}-{0M}-{0D} {0h12}:{m} {AM}") %>
|
||||||
<%= date %>
|
<%= date %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="py-0 align-middle">
|
|
||||||
<%= if item.read do %>
|
|
||||||
<%= form_tag Routes.item_path(@conn, :unread, item.id), method: :post do %>
|
|
||||||
<input type="hidden" name="redirect" value="<%=Routes.group_path(@conn, :read, @group.id) %>">
|
|
||||||
<%= submit "Unread", class: "btn btn-sm btn-secondary" %>
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
|
||||||
<%= form_tag Routes.item_path(@conn, :read, item.id), method: :post do %>
|
|
||||||
<input type="hidden" name="redirect" value="<%=Routes.group_path(@conn, :read, @group.id) %>">
|
|
||||||
<%= submit "Read", class: "btn btn-sm btn-secondary" %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue