diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb index 6b3ce70..22a98b2 100644 --- a/app/controllers/subscriptions_controller.rb +++ b/app/controllers/subscriptions_controller.rb @@ -1,9 +1,10 @@ class SubscriptionsController < ApplicationController - before_action :authenticate_user! + # before_action :authenticate_user! def index - if current_user.subscriptions.active.any? - redirect_to account_manager_url and return - end + # if current_user.subscriptions.active.any? + # redirect_to account_manager_url and return + # end + end def success diff --git a/app/javascript/controllers/clock_controller.js b/app/javascript/controllers/clock_controller.js new file mode 100644 index 0000000..c65229e --- /dev/null +++ b/app/javascript/controllers/clock_controller.js @@ -0,0 +1,41 @@ +import { Controller } from "@hotwired/stimulus"; + +// Connects to data-controller="clock" +export default class extends Controller { + static targets = ["central", "sydney", "islamabad"]; + + connect() { + this.updateTimes(); + this.timer = setInterval(() => this.updateTimes(), 1000); + } + + disconnect() { + clearInterval(this.timer); + } + + updateTimes() { + // Define time zones + const centralTimeOptions = { timeZone: "America/Chicago", hour12: true }; + const sydneyTimeOptions = { timeZone: "Australia/Sydney", hour12: true }; + const islamabadTimeOptions = { timeZone: "Asia/Karachi", hour12: true }; + + // Get current times + const centralTime = new Date().toLocaleTimeString( + "en-US", + centralTimeOptions + ); + const sydneyTime = new Date().toLocaleTimeString( + "en-US", + sydneyTimeOptions + ); + const islamabadTime = new Date().toLocaleTimeString( + "en-US", + islamabadTimeOptions + ); + + // Update the HTML elements with the current times + this.centralTarget.innerText = `${centralTime}`; + this.sydneyTarget.innerText = `${sydneyTime}`; + this.islamabadTarget.innerText = `${islamabadTime}`; + } +} diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb new file mode 100644 index 0000000..70f6cd8 --- /dev/null +++ b/app/views/layouts/_footer.html.erb @@ -0,0 +1,116 @@ + + + diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb index a0ce5cd..fc526ff 100644 --- a/app/views/layouts/_navbar.html.erb +++ b/app/views/layouts/_navbar.html.erb @@ -1,24 +1,23 @@