hiding links for not own

This commit is contained in:
Torsten 2023-01-26 00:02:44 +02:00
parent 8a1c148c12
commit 4a79350836
3 changed files with 13 additions and 11 deletions

View File

@ -32,15 +32,17 @@
- @member.stories.each do |story| - @member.stories.each do |story|
=render_story( story ) =render_story( story )
- if current_member == @member
.flex.justify-around .flex.justify-around
= link_to edit_story_path(story) do = link_to edit_story_path(story) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
Edit Story Edit Story
.mx-20.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-3.gap-8.md:gap-12.lg:gap-16 .mx-20.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-3.xl:grid-cols-4.gap-8.md:gap-12.lg:gap-16
- @member.pictures.each do |picture| - @member.pictures.each do |picture|
%div %div
= render picture , picture: picture = render picture , picture: picture
- if current_member == @member
.flex.justify-around .flex.justify-around
= link_to edit_picture_path(picture) do = link_to edit_picture_path(picture) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400

View File

@ -1,6 +1,6 @@
.group.relative.overflow-hidden .group.relative.overflow-hidden
.flex.justify-between .flex.justify-between
.ml-2=picture.member.name .ml-2= link_to picture.member.name , member_path(picture.member) , class: :underline
.mr-2 .mr-2
= distance_of_time_in_words_to_now picture.happened = distance_of_time_in_words_to_now picture.happened
ago ago

View File

@ -5,7 +5,7 @@
.border-r-4.mx-4 .border-r-4.mx-4
= sort_link(@q, :created_at , class: 'flex flex-nowrap text-md') = sort_link(@q, :created_at , class: 'flex flex-nowrap text-md')
.mx-20.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-3.gap-8.md:gap-12.lg:gap-16 .mx-20.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-3.xl:grid-cols-4.gap-8.md:gap-12.lg:gap-16
- @pictures.each do |picture| - @pictures.each do |picture|
= render picture , picture: picture = render picture , picture: picture