Skip to content

Commit

Permalink
Titles are now based on current conference name
Browse files Browse the repository at this point in the history
  • Loading branch information
andresag4 committed Sep 17, 2024
1 parent 43d65c0 commit a661747
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 16 deletions.
4 changes: 1 addition & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class ApplicationController < ActionController::Base

def current_profile = current_user&.profile

def current_conference
@_current_conference ||= Conference.last
end
def current_conference = Current.conference

def vapid_public_key
@_vapid_public_key ||= Base64.urlsafe_decode64(ENV["VAPID_PUBLIC_KEY"]).bytes.to_json
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/password_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class PasswordMailer < ApplicationMailer
def password_reset
mail(to: params[:user].email, subject: I18n.t("mailers.password_mailer.password_reset.subject"))
mail(to: params[:user].email, subject: I18n.t("mailers.password_mailer.password_reset.subject", app_name: Current.conference&.name))
end
end
4 changes: 4 additions & 0 deletions app/models/current.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
class Current < ActiveSupport::CurrentAttributes
attribute :user

def self.conference
@_current_conference ||= Conference.last
end
end
2 changes: 1 addition & 1 deletion app/views/abouts/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "About - Rails World 2024" %>
<%= title "About - #{current_conference&.name}" %>

<div class="relative flex flex-col items-center w-full h-full font-karla">
<div class="absolute left-0 bottom-0 z-0 w-full max-w-[430px] h-[228px] bg-no-repeat bg-cover" style="background-image: url(<%= asset_path 'intersection_lines.svg' %>)"></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/coming_soons/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "Coming soon - Rails World 2024" %>
<%= title "Coming soon - #{current_conference&.name}" %>

<div class="flex flex-col items-center flex-1 px-5 py-10 bg-purple-dark">
<%= inline_svg_tag("main_logo_with_date.svg", class: "w-full mt-14") %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="h-screen">
<head>
<title><%= content_for(:title).presence || "Rails World 2024" %></title>
<title><%= content_for(:title).presence || "#{current_conference&.name}" %></title>

<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover">
<meta name="turbo-refresh-scroll" content="preserve">
Expand Down
2 changes: 1 addition & 1 deletion app/views/notification_settings/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "Notifications settings - Rails World 2024" %>
<%= title "Notifications settings - #{current_conference&.name}" %>
<%= form_with(
model: current_user.profile,
Expand Down
2 changes: 1 addition & 1 deletion app/views/notifications/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "Notifications - Rails World 2024" %>
<%= title "Notifications - #{current_conference&.name}" %>

<div class="flex flex-col items-center flex-1 px-5 pt-safe-area-header pb-safe-area-bottom-navbar">
<div class="flex flex-col items-start w-full h-full max-w-screen-sm pt-6">
Expand Down
2 changes: 1 addition & 1 deletion app/views/profiles/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "Edit profile - Rails World 2024" %>
<%= title "Edit profile - #{current_conference&.name}" %>
<%= content_for(:head) do %>
<%# Disabling morphing so that when an error occurs, the user is "redirected" to the top of the page %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/profiles/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% profile_name = @profile.name.presence || "Anonymous" %>
<%= title "#{profile_name}'s Profile - Rails World 2024" %>
<%= title "#{profile_name}'s Profile - #{current_conference&.name}" %>

<div class="relative flex flex-col h-full items-center justify-between flex-1 bg-grey-50 pt-safe-area-header pb-safe-area-bottom-navbar">
<div class="flex flex-col items-center bg-cover bg-bottom bg-no-repeat max-h-[430px] w-full" style="background-image: url(<%= asset_path 'background_design.svg' %>)">
Expand Down
2 changes: 1 addition & 1 deletion app/views/schedules/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "My Schedule - Rails World 2024" %>
<%= title "My Schedule - #{current_conference&.name}" %>

<div class="flex flex-col items-center h-full bg-grey-50 pt-safe-area-header">
<div class="flex flex-col items-center w-full h-full max-w-screen-md px-5">
Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "Agenda - Rails World 2024" %>
<%= title "Agenda - #{current_conference&.name}" %>

<div class="flex flex-col items-center h-full bg-grey-50 pt-safe-area-header">
<div class="flex flex-col items-center w-full h-full max-w-screen-md px-5">
Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "#{@session.title} - Rails World 2024" %>
<%= title "#{@session.title} - #{current_conference&.name}" %>

<div class="relative flex flex-col items-center justify-between flex-1 pb-5 bg-grey-50 pt-safe-area-back-button pb-safe-area-bottom-navbar">
<div class="w-full px-5 pt-3 pb-12 bg-bottom bg-no-repeat bg-cover" style="background-image: url(<%= asset_path 'background_design.svg' %>)">
Expand Down
2 changes: 1 addition & 1 deletion app/views/speakers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= title "#{@profile.name} - Rails World 2024" %>
<%= title "#{@profile.name} - #{current_conference&.name}" %>

<div class="relative flex flex-col items-center justify-between flex-1 bg-grey-50 pt-safe-area-back-button pb-safe-area-bottom-navbar">
<div class="w-full px-5 pt-6 pb-12 bg-bottom bg-no-repeat bg-cover " style="background-image: url(<%= asset_path 'background_design.svg' %>)">
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ en:
without_time: "Your bookmarked session is starting soon."
password_mailer:
password_reset:
subject: "Password Reset - Rails World 2024"
subject: "Password Reset - %{app_name}"
views:
status_filters:
past: "Past"
Expand Down

0 comments on commit a661747

Please sign in to comment.