mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-06-01 04:38:27 -04:00
* Add collaboration model * Permissions and garden show * List by owner, or where I am a collaborator * Add index * Add permissions * Typo * Typo * Add route * Update schema * Update schema * Add CRUD * Add CRUD * Add CRUD * Factory * Add validations * Rubocop * Rubocop * Rubocop * Unique index * Fix * Make CI more fine grained for faster feedback * Swap order * Fix path, fail-fast * Fix spec * Remove 'significant drop in coverage' as not everything runs in one giant run * Fix tests?
73 lines
3.0 KiB
Plaintext
73 lines
3.0 KiB
Plaintext
- content_for :title, "#{@garden} collaborators"
|
|
|
|
%h1= "#{@garden} collaborators"
|
|
|
|
- content_for :breadcrumbs do
|
|
%li.breadcrumb-item= link_to 'Gardens', gardens_path
|
|
%li.breadcrumb-item.active= link_to @garden, gardens_path(@garden)
|
|
|
|
.row
|
|
.col-md-2
|
|
- if current_member.present?
|
|
.flex-column.nav-pills.layout-nav{"role" => "tablist", "aria-orientation"=>"vertical"}
|
|
- if can?(:create, GardenCollaborator.new(garden: @garden))
|
|
= link_to url_for([@garden, GardenCollaborator.new(garden: @garden), action: :new]), class: 'btn' do
|
|
Add a #{GardenCollaborator.new(garden: @garden).model_name.human}
|
|
- else
|
|
= render 'shared/signin_signup', to: "record your #{model.to_s.pluralize.downcase}"
|
|
|
|
%hr/
|
|
%p.text-center
|
|
#{ENV['GROWSTUFF_SITE_NAME']} helps you track what you're
|
|
harvesting from your home garden and see how productive it is.
|
|
|
|
|
|
.col-md-10
|
|
- if @garden_collaborators.empty?
|
|
%p There are no collaborators to display.
|
|
- if can?(:create, GardenCollaborator) && @owner == current_member
|
|
= link_to 'Add a garden collaborator', new_garden_garden_collaborator_path, class: 'btn btn-primary'
|
|
|
|
- else
|
|
%section
|
|
%h2= page_entries_info @garden_collaborators
|
|
= will_paginate @garden_collaborators
|
|
|
|
- @garden_collaborators.each do |garden_collaborator|
|
|
- member = garden_collaborator.member
|
|
- cache member do
|
|
.card
|
|
.card-body
|
|
- if can?(:destroy, garden_collaborator)
|
|
%div{"style": "float: right"}
|
|
= link_to garden_garden_collaborator_path(@garden, garden_collaborator), method: :delete, class: "btn btn-danger" do
|
|
Remove access
|
|
|
|
%h4.login-name= link_to member, member
|
|
%div
|
|
= render "members/avatar", member: member
|
|
%div
|
|
= link_to "view all #{member}'s gardens", member_gardens_path(member)
|
|
%p
|
|
%small
|
|
Joined
|
|
= distance_of_time_in_words(member.created_at, Time.zone.now)
|
|
ago.
|
|
- if member.location.present?
|
|
= link_to member.location, place_path(member.location)
|
|
.card-footer
|
|
%ul.nav.nav-justified.small
|
|
%li.nav-item.border-right
|
|
= link_to member_plantings_path(member) do
|
|
= localize_plural(member.plantings.active, Planting)
|
|
%li.nav-item.border-right
|
|
= link_to member_harvests_path(member) do
|
|
= localize_plural(member.harvests, Harvest)
|
|
%li.nav-item
|
|
= link_to member_seeds_path(member) do
|
|
= localize_plural(member.seeds.active, Seed)
|
|
|
|
.row
|
|
.col-12= page_entries_info @garden_collaborators
|
|
.col-12= will_paginate @garden_collaborators
|