Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout #7

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,50 +53,50 @@ jobs:
- name: Lint code for consistent style
run: bin/rubocop -f github

test:
runs-on: ubuntu-latest
skip: true

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

# redis:
# image: redis
# ports:
# - 6379:6379
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips postgresql-client

- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Run tests
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432
# REDIS_URL: redis://localhost:6379/0
run: bin/rails db:test:prepare test test:system

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore
# test:
# runs-on: ubuntu-latest
# skip: true

# services:
# postgres:
# image: postgres
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# ports:
# - 5432:5432
# options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

# # redis:
# # image: redis
# # ports:
# # - 6379:6379
# # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5

# steps:
# - name: Install packages
# run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips postgresql-client

# - name: Checkout code
# uses: actions/checkout@v4

# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: .ruby-version
# bundler-cache: true

# - name: Run tests
# env:
# RAILS_ENV: test
# DATABASE_URL: postgres://postgres:postgres@localhost:5432
# # REDIS_URL: redis://localhost:6379/0
# run: bin/rails db:test:prepare test test:system

# - name: Keep screenshots from failed system tests
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: screenshots
# path: ${{ github.workspace }}/tmp/screenshots
# if-no-files-found: ignore
6 changes: 6 additions & 0 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- Footer -->
<footer class="bg-gray-800 text-white p-5 text-center">
<div class="container mx-auto">
<p class="text-xl">&copy; 2024 XBrand. All rights reserved.</p>
</div>
</footer>
13 changes: 13 additions & 0 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<nav class="bg-gray-800 text-white p-5 shadow-lg">
<div class="container mx-auto flex justify-between items-center">
<div class="text-2xl font-extrabold uppercase">
XBrand
</div>
<nav>
<ul class="flex space-x-6 text-xl">
<li><a href="/" class="hover:text-gray-400">Home</a></li>
<li><a href="/about" class="hover:text-gray-400">About</a></li>
</ul>
</nav>
</div>
</nav>
5 changes: 4 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
</head>

<body>
<main class="container mx-auto mt-28 px-5 flex">
<%= render "layouts/navbar" %>
<main class="min-h-screen">
<%= yield %>

</main>
<%= render "layouts/footer" %>
</body>
</html>
20 changes: 20 additions & 0 deletions app/views/pages/about.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="container mx-auto p-10">
<h1 class="text-4xl font-bold mb-4">About Us</h1>
<p class="text-lg mb-6">We are a dedicated team committed to delivering the best services to our customers. Our mission is to create innovative solutions that enhance user experiences.</p>
<h2 class="text-3xl font-semibold mb-2">Our Mission</h2>
<p class="mb-4">To provide high-quality products that improve the lives of our customers and foster a culture of innovation and excellence.</p>
<h2 class="text-3xl font-semibold mb-2">Our Values</h2>
<ul class="list-disc list-inside mb-4">
<li>Integrity</li>
<li>Innovation</li>
<li>Customer Satisfaction</li>
<li>Teamwork</li>
</ul>
<h2 class="text-3xl font-semibold mb-2">Meet the Team</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="p-4 border rounded">
<h3 class="font-bold">Drew Njoo</h3>
<p>CEO</p>
</div>
</div>
</div>
26 changes: 1 addition & 25 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
<div class="min-h-screen bg-gray-100 flex flex-col justify-between">
<!-- Header -->
<header class="bg-gray-800 text-white p-5 shadow-lg">
<div class="container mx-auto flex justify-between items-center">
<div class="text-2xl font-extrabold uppercase">
XBrand
</div>
<nav>
<ul class="flex space-x-6 text-xl">
<li><a href="#" class="hover:text-gray-400">Home</a></li>
<li><a href="#" class="hover:text-gray-400">About</a></li>
<li><a href="#" class="hover:text-gray-400">Services</a></li>
<li><a href="#" class="hover:text-gray-400">Contact</a></li>
</ul>
</nav>
</div>
</header>

<div class="bg-gray-100 flex flex-col justify-between">
<!-- Hero Section -->
<section class="flex-1 bg-white text-black p-10">
<div class="container mx-auto flex flex-col justify-center items-center text-center">
Expand Down Expand Up @@ -50,12 +33,5 @@
</div>
</div>
</section>

<!-- Footer -->
<footer class="bg-gray-800 text-white p-5 text-center">
<div class="container mx-auto">
<p class="text-xl">&copy; 2024 BrutalBrand. All rights reserved.</p>
</div>
</footer>
</div>

2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
root to: "pages#home"

get "about" => "pages#about"

namespace :api do
get "/hello", to: proc { [ 200, { "Content-Type" => "application/json" }, [ '{"message":"Hello, World!"}' ] ] }
end
Expand Down