lots of name fixes to get views to work in the app

This commit is contained in:
Torsten 2022-11-29 01:13:05 +02:00
parent d063f58636
commit 8ddc7a01c8
30 changed files with 49 additions and 231 deletions

View File

@ -6,7 +6,7 @@ gemspec
gem 'sprockets-rails', require: 'sprockets/railtie'
gem 'rspec-rails' , require: "rspec-rails"
gem 'haml-rails'
gem 'haml-rails' , require: "haml-rails"
group :development, :test do
end

View File

@ -1 +1,2 @@
//= link_directory ../stylesheets/merged .css
//= link merged/application.css

View File

@ -2,25 +2,25 @@ module Merged
class PagesController < MergedController
before_action :set_page, only: %i[ show edit update destroy ]
# GET /merge/pages
# GET /merged/pages
def index
@pages = Merged::Page.all
end
# GET /merge/pages/1
# GET /merged/pages/1
def show
end
# GET /merge/pages/new
# GET /merged/pages/new
def new
@page = Merged::Page.new
end
# GET /merge/pages/1/edit
# GET /merged/pages/1/edit
def edit
end
# POST /merge/pages
# POST /merged/pages
def create
@page = Merged::Page.new(page_params)
@ -31,7 +31,7 @@ module Merged
end
end
# PATCH/PUT /merge/pages/1
# PATCH/PUT /merged/pages/1
def update
if @page.update(page_params)
redirect_to @page, notice: "Page was successfully updated."
@ -40,7 +40,7 @@ module Merged
end
end
# DELETE /merge/pages/1
# DELETE /merged/pages/1
def destroy
@page.destroy
redirect_to page_url, notice: "Page was successfully destroyed."

View File

@ -1,10 +1,10 @@
module Merged
class ViewController < ApplicationController
class ViewController < ::ApplicationController
def view
page = params[:id]
# assert file exists
@data = YAML.load_file(Rails.root.join('merge' , "#{page}.yaml"))
@data = YAML.load_file(Rails.root.join('cms' , "#{page}.yaml"))
#assert data is an array (of hashes?)
end

View File

@ -2,16 +2,16 @@ module Merged
module ViewHelper
# section should be hash with at least 'template' key
def find_template(section)
"sections/" + section["template"]
"merged/view/" + section["template"]
end
def bg(section)
#{'background-image' => url('#{image_url('merge/' + section['image'])}')}
img = image_url "merge/house.jpg"
puts "--#{Image.root}/#{section['image']}--"
img = asset_url( "#{Image.root}/#{section['image']}" )
"background-image: url('#{img}');"
end
def image_for(section , classes)
image_tag("merge/#{section['image']}" , class: classes)
image_tag("#{Image.root}/#{section['image']}" , class: classes)
end
def has_button(section)
section['button']

View File

@ -1,5 +0,0 @@
module Merged
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
end

View File

@ -11,7 +11,7 @@ module Merged
def initialize(filename)
puts "New Image #{filename}"
@name , @type = filename.split(".")
file = File.new(Rails.root.join(Image.root,filename))
file = File.new(Rails.root.join(Image.asset_root,filename))
@created_at = file.birthtime
@updated_at = file.ctime
@size = (file.size/1024).to_i
@ -19,7 +19,7 @@ module Merged
def self.all
return @@images unless @@images.empty?
Dir[Rails.root.join Image.root + "*.*"].each do |f|
Dir[Rails.root.join Image.asset_root + "*.*"].each do |f|
file = f.split("/").last
self.add( file )
end
@ -31,14 +31,18 @@ module Merged
original , ending = io.original_filename.split("/").last.split(".")
filename = original if( filename.blank? )
full_filename = filename + "." + ending
File.open(Rails.root.join(Image.root, full_filename), "wb") do |f|
File.open(Rails.root.join(Image.asset_root, full_filename), "wb") do |f|
f.write( io.read )
end
self.add( full_filename )
end
def self.asset_root
"app/assets/images/" + root
end
def self.root
"app/assets/images/merge/"
"cms"
end
private

View File

@ -4,7 +4,8 @@ module Merged
include ActiveModel::Conversion
extend ActiveModel::Naming
@@files = Set.new Dir.new(Rails.root.join("merge")).children
@@root
@@files = Set.new Dir.new(Rails.root.join(@@root)).children
attr_reader :name , :content
@ -16,7 +17,7 @@ module Merged
def initialize file_name
@name = file_name.split(".").first
@content = YAML.load_file(Rails.root.join("merge" , file_name))
@content = YAML.load_file(Rails.root.join(@@root , file_name))
end
def sections
@ -47,7 +48,7 @@ module Merged
end
def save
file_name = Rails.root.join("merge" , name + ".yaml")
file_name = Rails.root.join(@root , name + ".yaml")
File.write( file_name , @content.to_yaml)
end

View File

@ -1,133 +0,0 @@
%footer.bg-white{"aria-label" => "Site Footer"}
.max-w-screen-xl.px-4.py-16.mx-auto.sm:px-6.lg:px-8
.lg:flex.lg:items-start.lg:gap-8
.text-teal-600
%svg.h-8{:fill => "none", :viewBox => "0 0 28 24"}
%path{:d => "M0.41 10.3847C1.14777 7.4194 2.85643 4.7861 5.2639 2.90424C7.6714 1.02234 10.6393 0 13.695 0C16.7507 0 19.7186 1.02234 22.1261 2.90424C24.5336 4.7861 26.2422 7.4194 26.98 10.3847H25.78C23.7557 10.3549 21.7729 10.9599 20.11 12.1147C20.014 12.1842 19.9138 12.2477 19.81 12.3047H19.67C19.5662 12.2477 19.466 12.1842 19.37 12.1147C17.6924 10.9866 15.7166 10.3841 13.695 10.3841C11.6734 10.3841 9.6976 10.9866 8.02 12.1147C7.924 12.1842 7.8238 12.2477 7.72 12.3047H7.58C7.4762 12.2477 7.376 12.1842 7.28 12.1147C5.6171 10.9599 3.6343 10.3549 1.61 10.3847H0.41ZM23.62 16.6547C24.236 16.175 24.9995 15.924 25.78 15.9447H27.39V12.7347H25.78C24.4052 12.7181 23.0619 13.146 21.95 13.9547C21.3243 14.416 20.5674 14.6649 19.79 14.6649C19.0126 14.6649 18.2557 14.416 17.63 13.9547C16.4899 13.1611 15.1341 12.7356 13.745 12.7356C12.3559 12.7356 11.0001 13.1611 9.86 13.9547C9.2343 14.416 8.4774 14.6649 7.7 14.6649C6.9226 14.6649 6.1657 14.416 5.54 13.9547C4.4144 13.1356 3.0518 12.7072 1.66 12.7347H0V15.9447H1.61C2.39051 15.924 3.154 16.175 3.77 16.6547C4.908 17.4489 6.2623 17.8747 7.65 17.8747C9.0377 17.8747 10.392 17.4489 11.53 16.6547C12.1468 16.1765 12.9097 15.9257 13.69 15.9447C14.4708 15.9223 15.2348 16.1735 15.85 16.6547C16.9901 17.4484 18.3459 17.8738 19.735 17.8738C21.1241 17.8738 22.4799 17.4484 23.62 16.6547ZM23.62 22.3947C24.236 21.915 24.9995 21.664 25.78 21.6847H27.39V18.4747H25.78C24.4052 18.4581 23.0619 18.886 21.95 19.6947C21.3243 20.156 20.5674 20.4049 19.79 20.4049C19.0126 20.4049 18.2557 20.156 17.63 19.6947C16.4899 18.9011 15.1341 18.4757 13.745 18.4757C12.3559 18.4757 11.0001 18.9011 9.86 19.6947C9.2343 20.156 8.4774 20.4049 7.7 20.4049C6.9226 20.4049 6.1657 20.156 5.54 19.6947C4.4144 18.8757 3.0518 18.4472 1.66 18.4747H0V21.6847H1.61C2.39051 21.664 3.154 21.915 3.77 22.3947C4.908 23.1889 6.2623 23.6147 7.65 23.6147C9.0377 23.6147 10.392 23.1889 11.53 22.3947C12.1468 21.9165 12.9097 21.6657 13.69 21.6847C14.4708 21.6623 15.2348 21.9135 15.85 22.3947C16.9901 23.1884 18.3459 23.6138 19.735 23.6138C21.1241 23.6138 22.4799 23.1884 23.62 22.3947Z", :fill => "currentColor"}
.grid.grid-cols-2.gap-8.mt-8.lg:mt-0.lg:grid-cols-5.lg:gap-y-16
.col-span-2
%div
%h2.text-2xl.font-bold.text-gray-900
Get the latest news!
%p.mt-4.text-gray-500
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Esse non
cupiditate quae nam molestias.
.col-span-2.lg:col-span-3.lg:flex.lg:items-end
%form.w-full
%label.sr-only{:for => "UserEmail"} Email
.p-2.border.border-gray-100.focus-within:ring.sm:flex.sm:items-center.sm:gap-4
%input#UserEmail.w-full.border-none.focus:border-transparent.focus:ring-transparent.sm:text-sm{:placeholder => "john@rhcp.com", :type => "email"}/
%button.w-full.px-6.py-3.mt-1.text-sm.font-bold.tracking-wide.text-white.uppercase.transition-none.bg-teal-500.hover:bg-teal-600.sm:mt-0.sm:w-auto.sm:flex-shrink-0
Sign Up
.col-span-2.sm:col-span-1
%p.font-medium.text-gray-900 Services
%nav.mt-6{"aria-label" => "Footer Navigation - Services"}
%ul.space-y-4.text-sm
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
1on1 Coaching
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Company Review
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Accounts Review
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
HR Consulting
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
SEO Optimisation
.col-span-2.sm:col-span-1
%p.font-medium.text-gray-900 Company
%nav.mt-6{"aria-label" => "Footer Navigation - Company"}
%ul.space-y-4.text-sm
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
About
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Meet the Team
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Accounts Review
.col-span-2.sm:col-span-1
%p.font-medium.text-gray-900 Helpful Links
%nav.mt-6{"aria-label" => "Footer Navigation - Company"}
%ul.space-y-4.text-sm
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Contact
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
FAQs
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Live Chat
.col-span-2.sm:col-span-1
%p.font-medium.text-gray-900 Legal
%nav.mt-6{"aria-label" => "Footer Navigation - Legal"}
%ul.space-y-4.text-sm
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Accessibility
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Returns Policy
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Refund Policy
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Hiring Statistics
.col-span-2.sm:col-span-1
%p.font-medium.text-gray-900 Downloads
%nav.mt-6{"aria-label" => "Footer Navigation - Downloads"}
%ul.space-y-4.text-sm
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
Marketing Calendar
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "#"}
SEO Infographics
%ul.flex.justify-start.col-span-2.gap-6.lg:col-span-5.lg:justify-end
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "/", :rel => "noreferrer", :target => "_blank"}
%span.sr-only Facebook
%svg.w-6.h-6{"aria-hidden" => "true", :fill => "currentColor", :viewBox => "0 0 24 24"}
%path{"clip-rule" => "evenodd", :d => "M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z", "fill-rule" => "evenodd"}
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "/", :rel => "noreferrer", :target => "_blank"}
%span.sr-only Instagram
%svg.w-6.h-6{"aria-hidden" => "true", :fill => "currentColor", :viewBox => "0 0 24 24"}
%path{"clip-rule" => "evenodd", :d => "M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z", "fill-rule" => "evenodd"}
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "/", :rel => "noreferrer", :target => "_blank"}
%span.sr-only Twitter
%svg.w-6.h-6{"aria-hidden" => "true", :fill => "currentColor", :viewBox => "0 0 24 24"}
%path{:d => "M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"}
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "/", :rel => "noreferrer", :target => "_blank"}
%span.sr-only GitHub
%svg.w-6.h-6{"aria-hidden" => "true", :fill => "currentColor", :viewBox => "0 0 24 24"}
%path{"clip-rule" => "evenodd", :d => "M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z", "fill-rule" => "evenodd"}
%li
%a.text-gray-700.transition.hover:opacity-75{:href => "/", :rel => "noreferrer", :target => "_blank"}
%span.sr-only Dribbble
%svg.w-6.h-6{"aria-hidden" => "true", :fill => "currentColor", :viewBox => "0 0 24 24"}
%path{"clip-rule" => "evenodd", :d => "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10c5.51 0 10-4.48 10-10S17.51 2 12 2zm6.605 4.61a8.502 8.502 0 011.93 5.314c-.281-.054-3.101-.629-5.943-.271-.065-.141-.12-.293-.184-.445a25.416 25.416 0 00-.564-1.236c3.145-1.28 4.577-3.124 4.761-3.362zM12 3.475c2.17 0 4.154.813 5.662 2.148-.152.216-1.443 1.941-4.48 3.08-1.399-2.57-2.95-4.675-3.189-5A8.687 8.687 0 0112 3.475zm-3.633.803a53.896 53.896 0 013.167 4.935c-3.992 1.063-7.517 1.04-7.896 1.04a8.581 8.581 0 014.729-5.975zM3.453 12.01v-.26c.37.01 4.512.065 8.775-1.215.25.477.477.965.694 1.453-.109.033-.228.065-.336.098-4.404 1.42-6.747 5.303-6.942 5.629a8.522 8.522 0 01-2.19-5.705zM12 20.547a8.482 8.482 0 01-5.239-1.8c.152-.315 1.888-3.656 6.703-5.337.022-.01.033-.01.054-.022a35.318 35.318 0 011.823 6.475 8.4 8.4 0 01-3.341.684zm4.761-1.465c-.086-.52-.542-3.015-1.659-6.084 2.679-.423 5.022.271 5.314.369a8.468 8.468 0 01-3.655 5.715z", "fill-rule" => "evenodd"}
.pt-8.mt-8.border-t.border-gray-100
.grid.grid-cols-1.gap-8.lg:grid-cols-2
%p.text-xs.text-left.text-gray-500
2022. Company Name. All rights reserved.
%nav{"aria-label" => "Footer Navigation - Support"}
%ul.flex.flex-wrap.justify-start.gap-4.text-xs.lg:justify-end
%li
%a.text-gray-500.transition.hover:opacity-75{:href => "#"}
Terms Conditions
%li
%a.text-gray-500.transition.hover:opacity-75{:href => "#"}
Privacy Policy
%li
%a.text-gray-500.transition.hover:opacity-75{:href => "#"}
Cookies

View File

@ -1,40 +0,0 @@
%header.bg-white{"aria-label" => "Site Header"}
.mx-auto.max-w-screen-xl.px-4.sm:px-6.lg:px-8
.flex.h-16.items-center.justify-between
.flex-1.md:flex.md:items-center.md:gap-12
%a.block.text-teal-600{:href => "/"}
%span.sr-only Home
%svg.h-8{:fill => "none", :viewbox => "0 0 28 24", :xmlns => "http://www.w3.org/2000/svg"}
%path{:d => "M0.41 10.3847C1.14777 7.4194 2.85643 4.7861 5.2639 2.90424C7.6714 1.02234 10.6393 0 13.695 0C16.7507 0 19.7186 1.02234 22.1261 2.90424C24.5336 4.7861 26.2422 7.4194 26.98 10.3847H25.78C23.7557 10.3549 21.7729 10.9599 20.11 12.1147C20.014 12.1842 19.9138 12.2477 19.81 12.3047H19.67C19.5662 12.2477 19.466 12.1842 19.37 12.1147C17.6924 10.9866 15.7166 10.3841 13.695 10.3841C11.6734 10.3841 9.6976 10.9866 8.02 12.1147C7.924 12.1842 7.8238 12.2477 7.72 12.3047H7.58C7.4762 12.2477 7.376 12.1842 7.28 12.1147C5.6171 10.9599 3.6343 10.3549 1.61 10.3847H0.41ZM23.62 16.6547C24.236 16.175 24.9995 15.924 25.78 15.9447H27.39V12.7347H25.78C24.4052 12.7181 23.0619 13.146 21.95 13.9547C21.3243 14.416 20.5674 14.6649 19.79 14.6649C19.0126 14.6649 18.2557 14.416 17.63 13.9547C16.4899 13.1611 15.1341 12.7356 13.745 12.7356C12.3559 12.7356 11.0001 13.1611 9.86 13.9547C9.2343 14.416 8.4774 14.6649 7.7 14.6649C6.9226 14.6649 6.1657 14.416 5.54 13.9547C4.4144 13.1356 3.0518 12.7072 1.66 12.7347H0V15.9447H1.61C2.39051 15.924 3.154 16.175 3.77 16.6547C4.908 17.4489 6.2623 17.8747 7.65 17.8747C9.0377 17.8747 10.392 17.4489 11.53 16.6547C12.1468 16.1765 12.9097 15.9257 13.69 15.9447C14.4708 15.9223 15.2348 16.1735 15.85 16.6547C16.9901 17.4484 18.3459 17.8738 19.735 17.8738C21.1241 17.8738 22.4799 17.4484 23.62 16.6547ZM23.62 22.3947C24.236 21.915 24.9995 21.664 25.78 21.6847H27.39V18.4747H25.78C24.4052 18.4581 23.0619 18.886 21.95 19.6947C21.3243 20.156 20.5674 20.4049 19.79 20.4049C19.0126 20.4049 18.2557 20.156 17.63 19.6947C16.4899 18.9011 15.1341 18.4757 13.745 18.4757C12.3559 18.4757 11.0001 18.9011 9.86 19.6947C9.2343 20.156 8.4774 20.4049 7.7 20.4049C6.9226 20.4049 6.1657 20.156 5.54 19.6947C4.4144 18.8757 3.0518 18.4472 1.66 18.4747H0V21.6847H1.61C2.39051 21.664 3.154 21.915 3.77 22.3947C4.908 23.1889 6.2623 23.6147 7.65 23.6147C9.0377 23.6147 10.392 23.1889 11.53 22.3947C12.1468 21.9165 12.9097 21.6657 13.69 21.6847C14.4708 21.6623 15.2348 21.9135 15.85 22.3947C16.9901 23.1884 18.3459 23.6138 19.735 23.6138C21.1241 23.6138 22.4799 23.1884 23.62 22.3947Z", :fill => "currentColor"}
.md:flex.md:items-center.md:gap-12
%nav.hidden.md:block{"aria-label" => "Site Nav"}
%ul.flex.items-center.gap-6.text-sm
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
About
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
Careers
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
History
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
Services
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
Projects
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
Blog
.flex.items-center.gap-4
.sm:flex.sm:gap-4
%a.rounded-md.bg-teal-600.px-5.text-sm.font-medium.text-white.shadow{:class => "py-2.5", :href => "/"}
Login
.hidden.sm:flex
%a.rounded-md.bg-gray-100.px-5.text-sm.font-medium.text-teal-600{:class => "py-2.5", :href => "/"}
Register
.block.md:hidden
%button.rounded.bg-gray-100.p-2.text-gray-600.transition{:class => "hover:text-gray-600/75"}
%svg.h-5.w-5{:fill => "none", :stroke => "currentColor", "stroke-width" => "2", :viewbox => "0 0 24 24", :xmlns => "http://www.w3.org/2000/svg"}
%path{:d => "M4 6h16M4 12h16M4 18h16", "stroke-linecap" => "round", "stroke-linejoin" => "round"}

View File

@ -1,16 +0,0 @@
!!!
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title Gateway
%meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
= csrf_meta_tags
= csp_meta_tag
%link{:href => "https://cdn.jsdelivr.net/npm/tw-elements/dist/css/index.min.css", :rel => "stylesheet"}
= stylesheet_link_tag "application"
= stylesheet_link_tag "tailwind"
= javascript_importmap_tags
%body
=render "layouts/header"
= yield
=render "layouts/footer"

View File

@ -29,7 +29,7 @@
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => merge_images_path}
Images
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/merge/styles"}
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/merged/styles"}
Styles
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/changes"}

View File

@ -10,7 +10,7 @@
= submit_tag 'Submit'
-@images.each do |name , image|
.relative.block.border.border-gray-100
=image_tag("merge/#{name}" , class: "h-56 w-full object-contain lg:h-72")
=image_tag("cms/#{name}" , class: "h-56 w-full object-contain lg:h-72")
.p-3
%strong.inline-block.bg-yellow-400.px-3.py-1.text-md.font-medium
= "#{image.size}k"

View File

@ -21,4 +21,4 @@
%button.mt-4.rounded-lg.bg-red-400.p-4
=link_to "Delete" , "/index"
-section.content.each do |key , value|
= render "merge/sections/overview/#{key}", section: section , key: key , value: value
= render "merged/sections/overview/#{key}", section: section , key: key , value: value

View File

@ -4,4 +4,4 @@
%p #{section.content['cards'].length} cards
%p view cards (index)
.relative.block.border.border-gray-100
=image_tag("merge/card_preview/#{value}" , class: "w-full object-contain")
=image_tag("merged/card_preview/#{value}" , class: "w-full object-contain")

View File

@ -10,4 +10,4 @@
-if( value.blank? )
No image
-else
= image_tag( "merge/" + value)
= image_tag( "cms/" + value)

View File

@ -2,4 +2,4 @@
%h3.mt-4.text-lg.font-bold= key.upcase
%p= value
.relative.block.border.border-gray-100
=image_tag("merge/section_preview/#{section.template}" , class: "w-full object-contain")
=image_tag("merged/section_preview/#{section.template}" , class: "w-full object-contain")

View File

@ -1,5 +1,5 @@
.p-6
%h3.mt-4.text-lg.font-bold= key.upcase
%p= value
=image_tag("merge/card_preview/#{value}" , class: "w-full object-contain")
=image_tag("merged/card_preview/#{value}" , class: "w-full object-contain")
%p #{section.content['cards'].length} cards

View File

@ -1,6 +1,6 @@
.p-6
%h3.mt-4.text-lg.font-bold= key.upcase
-if value
= image_tag "merge/" + value
= image_tag "cms/" + value
-else
No image

View File

@ -1,4 +1,4 @@
.p-6
%h3.mt-4.text-lg.font-bold= key.upcase
%p= value
=image_tag("merge/section_preview/#{section.template}" , class: "w-full object-contain")
=image_tag("merged/section_preview/#{section.template}" , class: "w-full object-contain")

View File

@ -12,4 +12,4 @@
-@images.each do |name , image|
.relative.block.border.border-gray-100
= link_to( merge_page_section_set_image_path( image: name)) do
=image_tag("merge/#{name}" , class: "h-56 w-full object-contain lg:h-72")
=image_tag("cms/#{name}" , class: "h-56 w-full object-contain lg:h-72")

View File

@ -11,7 +11,7 @@
.grid.grid-cols-2.gap-2.m-8
- @section.content.each do |key , value|
= render "merge/sections/editors/#{key}", section: @section , key: key , value: value
= render "merged/sections/editors/#{key}", section: @section , key: key , value: value
= #link_to 'Edit', edit_merge_section_path(@merge_section)
\|

View File

@ -5,7 +5,7 @@
= section["header"]
%p.mt-4.text-gray-500
= section["text"]
- template = "cards/" + section["card_template"]
- template = "merged/view/cards/" + section["card_template"]
.grid.grid-cols-1.md:grid-cols-2
- section["cards"].each do |element|
= render( template , element: element)

View File

@ -8,4 +8,4 @@
= section["text"]
.mt-4.md:mt-8
-if section["button"]
= render 'elements/button' , button: section["button"]
= render 'merged/view/elements/button' , button: section["button"]

View File

@ -7,5 +7,5 @@
= section["text"]
.mt-4.md:mt-8
-if section["button"]
= render 'elements/button' , button: section["button"]
= render 'merged/view/elements/button' , button: section["button"]
= image_for( section , "p-5 h-56 w-full object-cover sm:h-full")

View File

@ -0,0 +1,2 @@
%a.inline-block.rounded.bg-emerald-600.px-12.py-3.text-sm.font-medium.text-white.transition.hover:bg-emerald-700.focus:outline-none.focus:ring.focus:ring-yellow-400{:href => button["link"]}
=button['text']

View File

@ -1,5 +1,9 @@
module Merged
class Engine < ::Rails::Engine
isolate_namespace Merged
initializer "merged.assets.precompile" do |app|
app.config.assets.precompile += %w( merged/application.js merged/application.css )
end
end
end

View File

@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
end
spec.add_dependency "rails", ">= 7.0.4"
spec.add_dependency "haml-rails"
end