<%= @task.title %>

<%= @task.completed ? '✓ Completed' : '○ Pending' %> Created: <%= @task.created_at.strftime('%B %d, %Y at %I:%M %p') %>

Description

<% if @task.description.present? %>
<%= simple_format(@task.description) %>
<% else %>

No description provided.

<% end %>

Conversations

<%= render 'comments/form', task: @task, comment: Comment.new %>
<%= render partial: 'comments/comment', collection: @task.comments.order(created_at: :desc) %>
<%= form_with(model: @task, local: false, method: :patch, class: "toggle-status-form") do |form| %> <%= form.hidden_field :completed, value: !@task.completed %> <%= form.submit @task.completed ? 'Mark as Pending' : 'Mark as Completed', class: "status-toggle-btn #{@task.completed ? 'pending' : 'completed'}" %> <% end %> <%= link_to 'Edit Task', edit_task_path(@task), class: 'edit-btn' %> <%= link_to 'Back to List', tasks_path, class: 'back-btn' %> <%= link_to 'Delete', @task, method: :delete, data: { confirm: 'Are you sure you want to delete this task?' }, class: 'delete-btn' %>