fix menues

This commit is contained in:
Torsten 2023-01-21 23:34:57 +02:00
parent 0a07042797
commit 10bdfa39cd
4 changed files with 34 additions and 15 deletions

View File

@ -54,4 +54,22 @@ module ApplicationHelper
rows
end
def main_menu
[["/members" , "Volunteers"],["/stories" , "Stories"], ["/info" , "Info"],
["/arriving" , "Arriving"],["/about" , "About"], ]
end
def member_memu
items =[["/forum" ,"Forum"] , [main_app.member_path(current_member) , "Settings"]]
if current_member.admin? and !Rails.env.production?
items << [merged.pages_path(), "CMS" ]
end
items
end
def mobile_menu
if current_member
member_memu
else
[main_app.member_session_path, "Login"]
end
end
end

View File

@ -4,11 +4,9 @@
= image_tag("feenix_lintu.webp" , class: "h-20")
%span.ml-2.text-xl.font-bold.tracking-wide.text-gray-800.uppercase Hub Feenix
%ul.flex.items-center.hidden.space-x-8.lg:flex
%li
%a.font-medium.tracking-wide.text-gray-700.transition-colors.duration-400.hover:text-cyan-800{"aria-label" => "Our product", :href => "/members", :title => "Volunteers"} Volunteers
- [ :stories , :info , :arriving, :about].each do |link|
- main_menu.each do |link , text|
%li
%a.font-medium.tracking-wide.text-gray-700.transition-colors.duration-400.hover:text-cyan-800{"aria-label" => "Our product", :href => "/#{link}", :title => link.capitalize}= link.capitalize
%a.font-medium.tracking-wide.text-gray-700.transition-colors.duration-400.hover:text-cyan-800{"aria-label" => "Our product", :href => link, :title => text}= text
%li
= link_to "https://www.facebook.com/hubfeenix" , :target => "_blank" do
= image_tag("fb.webp" , class: "h-10 rounded-md")

View File

@ -1,12 +1,8 @@
#menu-dropdown.hidden.absolute.right-0.z-10.mt-4.w-36.origin-top-right.rounded-md.border.border-gray-100.bg-white.shadow-lg{:role => "menu"}
.p-2
%a.block.rounded-lg.px-4.py-2.text-sm.text-gray-500.hover:bg-gray-50.hover:text-gray-700{:href => "/forum", :role => "menuitem"}
Forum
%a.block.rounded-lg.px-4.py-2.text-sm.text-gray-500.hover:bg-gray-50.hover:text-gray-700{:href => main_app.member_path(current_member), :role => "menuitem"}
Profile
- unless Rails.env.production?
%a.block.rounded-lg.px-4.py-2.text-sm.text-gray-500.hover:bg-gray-50.hover:text-gray-700{:href => merged.pages_path(), :role => "menuitem"}
CMS
- member_memu.each do |link , text|
%a.block.rounded-lg.px-4.py-2.text-sm.text-gray-500.hover:bg-gray-50.hover:text-gray-700{:href => link, :role => "menuitem"}
=text
= form_tag( main_app.destroy_member_session_path , {method: :delete } ) do
%button.flex.w-full.items-center.gap-2.rounded-lg.px-4.py-2.text-sm.text-blue-700.hover:bg-red-50{:role => "menuitem", :type => "submit"}
%svg.h-4.w-4{:fill => "none", :stroke => "currentColor", "stroke-width" => "2", :viewbox => "0 0 24 24", :xmlns => "http://www.w3.org/2000/svg"}

View File

@ -1,4 +1,4 @@
#mobile-menu.absolute.top-0.left-0.w-full.hidden
#mobile-menu.absolute.top-0.left-0.w-full.hidden.z-10
.p-5.bg-white.border.rounded.shadow-sm
.flex.items-center.justify-between.mb-4
%div
@ -10,10 +10,17 @@
%svg.w-5.text-gray-600{:viewbox => "0 0 24 24"}
%path{:d => "M19.7,4.3c-0.4-0.4-1-0.4-1.4,0L12,10.6L5.7,4.3c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l6.3,6.3l-6.3,6.3 c-0.4,0.4-0.4,1,0,1.4C4.5,19.9,4.7,20,5,20s0.5-0.1,0.7-0.3l6.3-6.3l6.3,6.3c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3 c0.4-0.4,0.4-1,0-1.4L13.4,12l6.3-6.3C20.1,5.3,20.1,4.7,19.7,4.3z", :fill => "currentColor"}
%nav
%ul.space-y-6.px-20
- [:volunteers , :stories , :info , :arriving, :about].each do |link|
%ul.space-y-6.px-20.w-lg.text-center
- main_menu.each do |link , text|
%li
%a.font-medium.tracking-wide.text-xl{ :href => "/#{link}" , :title => link.capitalize}= link.capitalize
%a.w-full.h-full.block.tracking-wide.text-xl.p-2.rounded-lg.hover:bg-cyan-200{ :href => link , :title => text}
= text
%li
%hr
- mobile_menu.each do |link , text|
%li
%a.w-full.h-full.block.tracking-wide.text-xl.p-2.rounded-lg.hover:bg-cyan-200{ :href => link , :title => text}
= text
:javascript
var drop_hidden = true;
function menu_on() {