<%= task.priority_icon %> <%= task.priority.humanize %>
<%= task.status_badge[:text] %>
<%= form_with(model: task, local: false, method: :patch, class: "toggle-form") do |form| %>
<%= form.check_box :status, { checked: task.status == 'completed', onchange: "this.form.submit();" }, { class: "task-checkbox" } %>
<%= task.title %> <% if task.description.present? %> 📝 <% end %>
<% end %>
<% if task.department %> <%= task.department.name %> <% end %> <% if task.assignee %> Assigned to: <%= task.assignee.name %> <% end %> Created: <%= task.created_at.strftime('%m/%d/%Y') %>
<%= link_to 'View', task, class: 'details-btn' %> <% if task.updateable_by?(current_user) %> <%= link_to 'Edit', edit_task_path(task), class: 'edit-btn' %> <% end %> <% if task.assign?(current_user) && !task.assignee %> <%= link_to 'Assign', assign_task_path(task), method: :patch, class: 'assign-btn' %> <% end %> <% if task.updateable_by?(current_user) || current_user.admin? %> <%= link_to 'Delete', task, method: :delete, data: { confirm: 'Are you sure?' }, class: 'delete-btn' %> <% end %>