Packages

A spaced-repetition system based on Anki built in Phoenix LiveView which uses Markdown for flashcard content

Current section

Files

Jump to
memorex lib memorex_web live card_live index.html.heex
Raw

lib/memorex_web/live/card_live/index.html.heex

<div>
<h1 class="title"> Cards for deck "<%= @deck.name %>" </h1>
<table>
<thead>
<th> ID </th>
<th> Note ID </th>
<th> Due </th>
<th> Interval </th>
<th> Type </th>
<th> Status </th>
<th> Question </th>
<th> Answer </th>
</thead>
<% length_of_question_and_answer = 50 %>
<tbody>
<%= for card <- @cards do %>
<tr>
<td> <%= live_patch truncate(card.id, length: 12), to: Routes.card_show_path(@socket, :show, card.id) %> </td>
<td> <%= truncate(card.note_id, length: 12) %> </td>
<td> <%= format_iso_datetime(card.due) %> </td>
<td> <%= format(card.interval) %> </td>
<td> :<%= card.card_type %> </td>
<td> :<%= card.card_status %> </td>
<td>
<%= if Card.is_image_card?(card) do %>
<img src={img_src(card)} alt={img_alt(card)} width="50" height="50">
<% else %>
<%= truncate(Card.question(card), length: length_of_question_and_answer) %>
<% end %>
</td>
<td> <%= truncate(Card.answer(card), length: length_of_question_and_answer) %> </td>
</tr>
<% end %>
</tbody>
</table>
</div>