IMP: task card (#25)
This commit is contained in:
parent
676de86157
commit
a91f1924b2
7 changed files with 89 additions and 27 deletions
|
@ -1,29 +1,9 @@
|
|||
<%= link "new", to: Routes.task_path(@conn, :new), class: "button is-dark" %>
|
||||
|
||||
<div class="table-container">
|
||||
<table class="table is-striped is-hoverable is-fullwidth" style="table-layout: fixed;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>task</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= for task <- @tasks do %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= if not is_nil(task.due_at) do %>
|
||||
<div class="tags mb-0">
|
||||
<span class="tag is-warning">
|
||||
due: <%= task.due_at %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= link to: Routes.task_path(@conn, :show, task.id), class: "has-text-black" do %>
|
||||
<%= md_to_html task.value %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="content">
|
||||
<ul class="tasks">
|
||||
<%= for task <- @tasks do %>
|
||||
<li><%= render "task.html", Map.put(assigns, :task, task) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
19
lib/planner_web/templates/task/task.html.eex
Normal file
19
lib/planner_web/templates/task/task.html.eex
Normal file
|
@ -0,0 +1,19 @@
|
|||
<div>
|
||||
<div class="is-pulled-left">
|
||||
<%= link(to: Routes.task_path(@conn, :update, @task.id), method: :patch) do %>
|
||||
<button type="button" role="checkbox" class="doit"></button>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ml-5-5">
|
||||
<div class="value" onclick="location.href='<%= Routes.task_path(@conn, :show, @task.id) %>'">
|
||||
<%= md_to_html(@task.value) %>
|
||||
</div>
|
||||
<%= if not is_nil(@task.due_at) do %>
|
||||
<div class="tags mb-0">
|
||||
<span class="tag">
|
||||
due: <%= @task.due_at %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue