diff --git a/app/models/facilitator.rb b/app/models/facilitator.rb index e2f69a48d..392958a91 100644 --- a/app/models/facilitator.rb +++ b/app/models/facilitator.rb @@ -2,6 +2,7 @@ class Facilitator < ApplicationRecord belongs_to :created_by, class_name: "User" belongs_to :updated_by, class_name: "User" has_one :user, inverse_of: :facilitator, dependent: :nullify + has_many :bookmarks, as: :bookmarkable, dependent: :destroy has_many :sectorable_items, as: :sectorable, dependent: :destroy has_many :sectors, through: :sectorable_items has_many :stories_as_spotlighted_facilitator, inverse_of: :spotlighted_facilitator, class_name: "Story", diff --git a/app/models/project.rb b/app/models/project.rb index a78c0a35e..998081331 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -4,6 +4,7 @@ class Project < ApplicationRecord belongs_to :location, optional: true # TODO - remove Location if unused belongs_to :windows_type, optional: true has_many :addresses, as: :addressable, dependent: :destroy + has_many :bookmarks, as: :bookmarkable, dependent: :destroy has_many :project_users, dependent: :restrict_with_error has_many :users, through: :project_users has_many :reports, through: :users diff --git a/app/views/facilitators/show.html.erb b/app/views/facilitators/show.html.erb index f32b77caa..911f9f309 100644 --- a/app/views/facilitators/show.html.erb +++ b/app/views/facilitators/show.html.erb @@ -2,8 +2,11 @@
-
- <%= link_to "Facilitators", facilitators_path, class: "btn btn-secondary-outline mr-2" %> +
+ <%= link_to "Facilitators", facilitators_path, class: "btn btn-secondary-outline" %> + + <%= render "bookmarks/editable_bookmark_button", resource: @facilitator.object %> + <% if current_user.super_user? || current_user == @facilitator.user %> <%= link_to "Edit", edit_facilitator_path(@facilitator), class: "admin-only bg-green-50 btn btn-primary-outline" %> @@ -75,7 +78,7 @@ <% if pu.title.present? || pu.position.present? %> <%= pu.title.presence || pu.position.humanize %> - <% end %> - <%= link_to pu.project.name, authenticated_root_path(pu.project), + <%= link_to pu.project.name, project_path(pu.project), class: "text-blue-600 hover:underline font-medium" %> <% end %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index ed263269e..343dd8fbe 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -2,8 +2,12 @@
-
- <%= link_to "Organizations", projects_path, class: "btn btn-secondary-outline mr-2" %> +
+ + <%= link_to "Organizations", projects_path, class: "btn btn-secondary-outline" %> + + <%= render "bookmarks/editable_bookmark_button", resource: @project %> + <% if current_user.super_user? %> <%= link_to "Edit", edit_project_path(@project), class: "admin-only bg-green-100 btn btn-primary-outline" %>