From 27e6d08e73b0d0877a28f2f0c30b6182ce9c09e5 Mon Sep 17 00:00:00 2001 From: Torsten Date: Wed, 18 Jan 2023 12:40:19 +0200 Subject: [PATCH] little button work --- app/views/layouts/_footer.haml | 2 +- app/views/members/show.html.haml | 2 +- app/views/stories/edit.html.haml | 9 ++------- app/views/stories/index.html.haml | 5 ++++- app/views/stories/show.html.haml | 10 +++++++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/views/layouts/_footer.haml b/app/views/layouts/_footer.haml index 33d8e4c..0b69d55 100644 --- a/app/views/layouts/_footer.haml +++ b/app/views/layouts/_footer.haml @@ -25,7 +25,7 @@ %ul.space-y-4.text-sm %li %a.text-gray-700.transition.hover:opacity-75{:href => "/members"} - People + Volunteers .col-span-2.sm:col-span-1 %p.font-medium.text-gray-900 News %nav.mt-6{"aria-label" => "Footer Navigation - Downloads"} diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 8335db3..2942d6f 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -13,7 +13,7 @@ .prose= markdown(@member.bio) - if current_member == @member - .flex.justify-around + .flex.justify-around.ml-20 = link_to edit_member_path(@member) do %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 Edit diff --git a/app/views/stories/edit.html.haml b/app/views/stories/edit.html.haml index b87efb4..ca3044e 100644 --- a/app/views/stories/edit.html.haml +++ b/app/views/stories/edit.html.haml @@ -2,13 +2,8 @@ %div %div %h1 Editing story - = form_for @story do |f| - - if @story.errors.any? - #error_explanation - %h2= "#{pluralize(@story.errors.count, "error")} prohibited this story from being saved:" - %ul - - @story.errors.full_messages.each do |message| - %li= message + = simple_form_for @story do |f| + = f.error_notification = f.input :picture , as: :file , label: (@story.picture.blank? ? "Add picture" : "Change picture") = f.input :header diff --git a/app/views/stories/index.html.haml b/app/views/stories/index.html.haml index ab7cd96..7b9d194 100644 --- a/app/views/stories/index.html.haml +++ b/app/views/stories/index.html.haml @@ -4,4 +4,7 @@ %br -= link_to 'New Story', new_story_path +.flex.ml-20 + = link_to new_story_path do + %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 + New Story diff --git a/app/views/stories/show.html.haml b/app/views/stories/show.html.haml index 3df621c..91401f6 100644 --- a/app/views/stories/show.html.haml +++ b/app/views/stories/show.html.haml @@ -1,5 +1,9 @@ = render_story @story -= link_to 'Edit', edit_story_path(@story) -\| -= link_to 'Back', stories_path +.mx-20.flex.justify-between + = link_to edit_story_path(@story) do + %button.mt-6.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 + Edit + = link_to stories_path do + %button.mt-6.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 + Back