Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/facilitator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions app/views/facilitators/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="bg-white border border-gray-200 rounded-2xl shadow-lg p-8">
<!-- Header actions -->
<div class="flex justify-end mb-6">
<%= link_to "Facilitators", facilitators_path, class: "btn btn-secondary-outline mr-2" %>
<div class="flex justify-end mb-6 gap-2">
<%= link_to "Facilitators", facilitators_path, class: "btn btn-secondary-outline" %>
<span class="inline-block text-sm">
<%= render "bookmarks/editable_bookmark_button", resource: @facilitator.object %>
</span>
<% 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" %>
Expand Down Expand Up @@ -75,7 +78,7 @@
<% if pu.title.present? || pu.position.present? %>
<span class="text-gray-600"><%= pu.title.presence || pu.position.humanize %> - </span>
<% 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" %>
</li>
<% end %>
Expand Down
8 changes: 6 additions & 2 deletions app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="bg-white border border-gray-200 rounded-2xl shadow-lg p-8">
<!-- Header actions -->
<div class="flex justify-end mb-6">
<%= link_to "Organizations", projects_path, class: "btn btn-secondary-outline mr-2" %>
<div class="flex justify-end mb-6 gap-2">

<%= link_to "Organizations", projects_path, class: "btn btn-secondary-outline" %>
<span class="inline-block text-sm">
<%= render "bookmarks/editable_bookmark_button", resource: @project %>
</span>
<% if current_user.super_user? %>
<%= link_to "Edit", edit_project_path(@project),
class: "admin-only bg-green-100 btn btn-primary-outline" %>
Expand Down