Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/bundler/jquery-rails-4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anantshri authored Oct 14, 2024
2 parents 8d1e7b4 + e053dda commit 6f34a14
Show file tree
Hide file tree
Showing 8 changed files with 303 additions and 1,066 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
Expand All @@ -20,7 +20,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential libpq-dev nodejs \
libsqlite3-dev default-libmysqlclient-dev libxml2-dev
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-v2-${{ hashFiles('**/Gemfile.lock') }}
Expand All @@ -30,7 +30,7 @@ jobs:
env:
RAILS_ENV: test
run: |
gem install bundler
gem install bundler -v 2.4.21
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
RUBYOPT=-W0 bundle exec rake db:create
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ruby:2.6.2-slim
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs libsqlite3-dev default-libmysqlclient-dev libxml2-dev
FROM ruby:2.6.8-slim-bullseye

RUN apt-get update -y && \
apt-get install -y build-essential libpq-dev nodejs libsqlite3-dev default-libmysqlclient-dev libxml2-dev

WORKDIR /app

Expand Down
208 changes: 194 additions & 14 deletions app/assets/stylesheets/application.css.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,154 @@ body {
margin-bottom:4rem!important;
}

/*go to top button css */
#back-to-top {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #333;
color: #fff;
border-radius: 50%;
width: 40px;
height: 40px;
text-decoration : none;
text-align: center;
line-height: 40px;
cursor: pointer;
opacity: 0;
transition: opacity 0.5s;
}

#back-to-top.show {
opacity: 1;
}

#back-to-top:hover {
background-color: #555;
}

#back-to-top:before {
content: "\f077";
font-family: "FontAwesome";
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

.search-container {
display: flex;
justify-content: flex-end;
padding: 20px;
}

.search-wrapper {
position: relative;
width: 250px;
}

#searchInput {
width: 100%;
padding: 10px 15px 10px 40px;
font-size: 16px;
border: none;
border-bottom: 2px solid #3498db;
background-color: transparent;
outline: none;
transition: border-color 0.3s ease;
}

#searchInput:focus {
border-color: #2980b9;
}

.search-icon {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #7f8c8d;
}

.chapters-row {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 30px;
padding: 30px;
}

.chapter-card {
border: 1px solid #dee2e6 !important;
margin-bottom:3rem!important;
background-color: #ffffff;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 10px 20px rgba(0,0,0,0.05);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
height: 100%;
display: flex;
flex-direction: column;
font-family: 'Poppins', sans-serif;
position: relative;
}

.chapter-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.chapter-img-container {
position: relative;
overflow: hidden;
height: 200px;
}

.chapter-img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s ease;
}

.chapter-card:hover .chapter-img {
transform: scale(1.1);
}

.card-body {
padding: 20px;
flex-grow: 1;
display: flex;
flex-direction: column;
}

.card-title {
font-family: 'Montserrat', sans-serif;
font-size: 20px;
font-weight: 600;
margin: 0 0 10px;
color: #2c3e50;
letter-spacing: 0.5px;
}

.card-text {
font-size: 14px;
font-family: 'Poppins', sans-serif;
font-weight: 400;
line-height: 1.5;
color: #34495e;
margin-bottom: 15px;
}

.text-muted {
font-size: 13px;
color: #7f8c8d;
}

.chapter-status {
position: absolute;
top: 15px;
right: 15px;
padding: 5px 10px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
}

.chapter-active {
Expand All @@ -82,27 +227,62 @@ body {
background-image: radial-gradient(circle, rgba(255,102,102,0.1), rgba(255,102,102,0.6));
}

.chapter-zoom {
transform: scale(1.1);
.chapter-active .chapter-status {
background-color: #2ecc71;
color: white;
}

.chapter-fixed-content {
position: fixed;
.chapter-inactive .chapter-status {
background-color: #e74c3c;
color: white;
}

.chapter-img {
opacity: 0.9;
.chapter-details {
margin-top: auto;
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 15px;
border-top: 1px solid #ecf0f1;
}

.event-count {
display: flex;
align-items: center;
}

.event-icon {
margin-right: 5px;
font-size: 16px;
}

.chapter-hover figure {
opacity: 1;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
.learn-more {
background-color: #3498db;
color: white;
padding: 8px 15px;
border-radius: 20px;
text-decoration: none;
font-size: 13px;
font-weight: 600;
transition: background-color 0.3s ease;
}
.chapter-hover figure:hover {
opacity: .6;

.learn-more:hover {
background-color: #2980b9;
}

.upcoming-events {
display: flex;
margin-top: 10px;
margin-bottom: 10px;
}

.upcoming-events .event-icon {
margin-right: 8px;
}
.upcoming-events .text-muted {
color: #6c757d;
}

/* Autocomplete JS */
.autocomplete-suggestions { border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
Expand Down
99 changes: 68 additions & 31 deletions app/views/chapters/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,43 +1,80 @@
<h1 class="text-center">Chapters</h1>
<div id="chapter-map" class="mb-5"></div>

<div class="row mt-5">
<!-- Search container and input -->
<div class="search-container">
<div class="search-wrapper">
<span class="search-icon">🔍</span>
<input type="text" id="searchInput" placeholder="Search chapters...">
</div>
</div>
<!-- Chapter cards -->
<div class="chapters-row">
<% @chapters.each do |chapter| %>
<% if chapter.active? %>
<% cName = 'chapter-active' %>
<% else %>
<% cName = 'chapter-inactive' %>
<% end %>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 mb-5">
<%= link_to chapter_path(chapter) do %>
<div class='card chapter-card <%= cName %>'>
<div class="chapter-img chapter-hover text-center">
<figure><%= image_tag chapter.image_url, :size => '260x150', :class => 'chapter-img' %></figure>
</div>
<div class="card-body text-center">
<h4 class="card-title" ><%= chapter.name %> Chapter</h4>
<p class="card-text"><%= chapter.city %>,<% if chapter.state.present? && chapter.state!=chapter.city %> <%= chapter.state %>,<% end %> <%= chapter.country %></p>
<p class="text-muted"><%= pluralize(chapter.past_events.count, "Past event") %></p>
<p class="text-muted"><%= pluralize(chapter.upcoming_events.count, "Upcoming event") %></p>
<%= link_to '', chapter_path(chapter), class:'stretched-link' %>
</div>
<div class="chapter-card <%= chapter.active? ? 'chapter-active' : 'chapter-inactive' %>">
<div class="chapter-img-container">
<img src="<%= chapter.image_url %>" alt="<%= chapter.name %>" class="chapter-img">
</div>
<div class="chapter-status">
<%= chapter.active? ? 'Active' : 'Inactive' %>
</div>
<div class="card-body">
<h3 class="card-title"><%= chapter.name %></h3>
<p class="card-text"><%= chapter.city %>,<% if chapter.state.present? && chapter.state!=chapter.city %> <%= chapter.state %>,<% end %> <%= chapter.country %></p>
<div class="upcoming-events">
<span class="event-icon">🔜</span>
<span class="text-muted"><%= chapter.upcoming_events.count %> upcoming events</span>
</div>
<div class="chapter-details">
<div class="event-count">
<span class="event-icon">📅</span>
<span class="text-muted"><%= chapter.past_events.count %> past events</span>
</div>
<% end %>
<a href="<%= chapter_path(chapter) %>" class="learn-more">Learn More</a>
</div>
</div>
</div>
<% end %>
</div>

<!-- JavaScript code for dynamic functionality -->
<script>
$(document).ready(function() {
$(".chapter-card" ).hover(
function() {
$(this).addClass('shadow-lg chapter-zoom').css('cursor', 'pointer')
}, function() {
$(this).removeClass('shadow-lg chapter-zoom')
}
)
})
</script>
(function () {
const existingCards = Array.from(document.querySelectorAll(".chapter-card"));
const searchInput = document.getElementById("searchInput");

// Create a search index
const searchIndex = existingCards.map(card => ({
element: card,
title: card.querySelector(".card-title").textContent.toLowerCase(),
location: card.querySelector(".card-text").textContent.toLowerCase()
}));

// Debounce function
const debounce = (func, delay) => {
let timeoutId;
return (...args) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => func.apply(null, args), delay);
};
};

// Optimized search function
const performSearch = debounce((query) => {
const searchQuery = query.toLowerCase();

requestAnimationFrame(() => {
searchIndex.forEach(item => {
const isVisible = item.title.includes(searchQuery) || item.location.includes(searchQuery);
item.element.style.display = isVisible ? "" : "none";
});
});
}, 250);

searchInput.addEventListener("input", function() {
performSearch(this.value);
});
})();
</script>
<%= render partial: 'chapters/chapter_map_loader',
locals: { chapter_address: @chapter_address, map_area_id: 'chapter-map' } %>
locals: { chapter_address: @chapter_address, map_area_id: 'chapter-map' } %>
6 changes: 0 additions & 6 deletions app/views/event_sessions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,3 @@
</div>
</div>

<script src="/static/javascripts/jquery.oembed.js"></script>
<script>
$(function(){
$("a.embed").oembed();
});
</script>
Loading

0 comments on commit 6f34a14

Please sign in to comment.