diff --git a/app/controllers/organizations/tasks_controller.rb b/app/controllers/organizations/tasks_controller.rb index 977013ca2..657e7edb4 100644 --- a/app/controllers/organizations/tasks_controller.rb +++ b/app/controllers/organizations/tasks_controller.rb @@ -1,5 +1,5 @@ class Organizations::TasksController < Organizations::BaseController - before_action :set_pet, only: [:new, :create, :edit, :update] + before_action :set_pet, only: [:new, :create, :edit, :update, :destroy] before_action :set_task, only: [:edit, :update] def new diff --git a/app/views/organizations/tasks/_applications.html.erb b/app/views/organizations/tasks/_applications.html.erb new file mode 100644 index 000000000..9813163c7 --- /dev/null +++ b/app/views/organizations/tasks/_applications.html.erb @@ -0,0 +1,33 @@ +
+
+
+
+
+
+
+

Summary

+
+ +
+ + + + Settings + <%= link_to t('general.edit'), edit_pet_path(@pet), class: 'dropdown-item' %> + <%= link_to t('general.delete'), pet_path(@pet), class: 'dropdown-item', + data: + { + turbo_method: :delete, + turbo_confirm: t('organization_pets.show.are_you_sure_delete') + } %> + + +
+
+
+
+
+
+
diff --git a/app/views/organizations/tasks/_edit.html.erb b/app/views/organizations/tasks/_edit.html.erb new file mode 100644 index 000000000..b2be0fa1d --- /dev/null +++ b/app/views/organizations/tasks/_edit.html.erb @@ -0,0 +1,15 @@ +<%= form_with(model: [@pet, @task], local: true) do |form| %> +
+ <%= form.label :name %> + <%= form.text_field :name, class: 'form-control', placeholder: 'Enter task name' %> +
+ +
+ <%= form.label :description %> + <%= form.text_area :description, class: 'form-control', placeholder: 'Enter task description' %> +
+ +
+ <%= form.submit 'Update Task', class: 'btn btn-primary' %> +
+<% end %> diff --git a/app/views/organizations/tasks/_files.html.erb b/app/views/organizations/tasks/_files.html.erb new file mode 100644 index 000000000..b41472de0 --- /dev/null +++ b/app/views/organizations/tasks/_files.html.erb @@ -0,0 +1,34 @@ +
+
+
+
+
+
+
+

Summary

+
+ +
+ + + + Settings + <%= link_to t('general.edit'), edit_pet_path(@pet), class: 'dropdown-item' %> + <%= link_to t('general.delete'), pet_path(@pet), class: 'dropdown-item', + data: + { + turbo_method: :delete, + turbo_confirm: t('organization_pets.show.are_you_sure_delete') + } %> + + +
+
+
+
+
+
+
+ diff --git a/app/views/organizations/tasks/_form.html.erb b/app/views/organizations/tasks/_form.html.erb new file mode 100644 index 000000000..8ccf6c7c0 --- /dev/null +++ b/app/views/organizations/tasks/_form.html.erb @@ -0,0 +1,9 @@ +
+
+
+

Add New Task?????????

+
+
+
+
+
diff --git a/app/views/organizations/tasks/_overview.html.erb b/app/views/organizations/tasks/_overview.html.erb new file mode 100644 index 000000000..6aad85464 --- /dev/null +++ b/app/views/organizations/tasks/_overview.html.erb @@ -0,0 +1,111 @@ +
+
+
+
+
+
+
+

Summary

+
+ +
+ + + + Settings + <%= link_to t('general.edit'), edit_pet_path(@pet), class: 'dropdown-item' %> + <%= link_to t('general.delete'), pet_path(@pet), class: 'dropdown-item', + data: + { + turbo_method: :delete, + turbo_confirm: t('organization_pets.show.are_you_sure_delete') + } %> + + +
+
+ + +
+
+

<%= @pet.description %>

+ +
    +
  • +
    +
    + +
    +
    Sex
    +
    +
    +
    +
    +

    <%= @pet.sex %>

    +
    +
    +
    +
  • +
  • +
    +
    + +
    +
    Breed
    +
    +
    +
    +
    +

    <%= @pet.breed %>

    +
    +
    +
    +
  • +
  • +
    +
    + +
    +
    Weight
    +
    +
    +
    +
    +

    <%= "#{@pet.weight_from} - #{@pet.weight_to} #{@pet.weight_unit}" %>

    +
    +
    +
    +
  • +
  • +
    +
    + +
    +
    Application Status
    +
    +
    +
    +
    +

    + <%= @pet.application_paused == false ? t('.application.active') : t('.application.paused') %> +

    +
    +
    +
    +
  • + +
+
+
+
+
+
\ No newline at end of file diff --git a/app/views/organizations/tasks/_tasks.html.erb b/app/views/organizations/tasks/_tasks.html.erb new file mode 100644 index 000000000..94dfc9c4a --- /dev/null +++ b/app/views/organizations/tasks/_tasks.html.erb @@ -0,0 +1,76 @@ +
+
+
+
+
+
+
+

Summary

+
+ +
+ + + + Settings + <%= link_to t('general.edit'), edit_pet_path(@pet), class: 'dropdown-item' %> + <%= link_to t('general.delete'), pet_path(@pet), class: 'dropdown-item', + data: { + turbo_method: :delete, + turbo_confirm: t('organization_pets.show.are_you_sure_delete') + } %> + + +
+
+
+ +
+
Tasks
+ +
    + <% @pet.tasks.each do |task| %> +
  • +
    +
    + +
    +
    <%= task.name %>
    +
    +
    +
    +

    + <%= task.completed? ? "Completed" : "Pending" %> +

    + <%= link_to 'Edit', edit_pet_task_path(@pet, task), class: 'btn btn-warning mr-4' %> + <%= link_to 'Delete', pet_task_path(@pet, task), class: 'btn btn-danger', data: { turbo_method: "delete", turbo_confirm: 'Are you sure?' } %> +
    +
    +
  • + <% end %> + +
+ + +
+
+
+
+
diff --git a/app/views/organizations/tasks/edit.html.erb b/app/views/organizations/tasks/edit.html.erb new file mode 100644 index 000000000..77bf3b380 --- /dev/null +++ b/app/views/organizations/tasks/edit.html.erb @@ -0,0 +1,18 @@ +

Edit Task!!

+ + +<%= form_with(model: [@pet, @task], local: true) do |form| %> +
+ <%= form.label :name, class: 'form-label' %> + <%= form.text_field :name, class: 'form-control', placeholder: 'Enter task name' %> +
+ +
+ <%= form.label :description, class: 'form-label' %> + <%= form.text_area :description, class: 'form-control', placeholder: 'Enter task description' %> +
+ + <%= form.submit 'Update Task', class: 'btn btn-primary' %> +<% end %> + +<%= link_to 'Back to Task List', pet_path(@pet), class: 'btn btn-secondary' %>