Skip to content

Commit 5aebd9d

Browse files
committed
Use footer-less layout for conversation
1 parent 2ca5d83 commit 5aebd9d

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

app/controllers/better_together/conversations_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class ConversationsController < ApplicationController
77
before_action :set_conversations, only: %i[index new show]
88
before_action :set_conversation, only: %i[show]
99

10+
layout 'better_together/conversation', only: %i[show]
11+
1012
helper_method :available_participants
1113

1214
def index

app/javascript/channels/better_together/notifications_channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import DevicePermissionsController from "controllers/better_together/device_perm
44

55
consumer.subscriptions.create("BetterTogether::NotificationsChannel", {
66
connected() {
7-
console.log("notifications channel connected");
7+
// console.log("notifications channel connected");
88
},
99
received(data) {
1010
const identifier = data["identifier"];
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!DOCTYPE html>
2+
<html lang="<%= I18n.locale %>">
3+
<head>
4+
<% if ENV["SENTRY_CLIENT_KEY"] %>
5+
<script src="https://js-de.sentry-cdn.com/<%= ENV["SENTRY_CLIENT_KEY"] %>.min.js" crossorigin="anonymous"></script>
6+
<% end %>
7+
8+
<!-- Custom Head Javascript from Host App -->
9+
<%= render 'layouts/better_together/custom_head_javascript' %>
10+
11+
<title><%= (yield(:page_title) + ' | ') if content_for?(:page_title) %><%= host_platform.name %></title>
12+
<meta name="color-scheme" content="light dark">
13+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
14+
<%= csrf_meta_tags %>
15+
<%= csp_meta_tag %>
16+
17+
<!-- Default Stylesheets -->
18+
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/dist/trix.css">
19+
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slim-select/2.9.2/slimselect.min.css">
20+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
21+
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
22+
crossorigin=""/>
23+
<%= stylesheet_link_tag 'better_together/application', media: 'all', 'data-turbo-track': 'reload' %>
24+
25+
<!-- Custom Stylesheets from Host App -->
26+
<%= render 'layouts/better_together/custom_stylesheets' %>
27+
28+
<%= cache ['host_css_block', host_platform.cache_key_with_version] do %>
29+
<%= render host_platform.css_block if host_platform.css_block %>
30+
<% end %>
31+
32+
<!-- Embed I18n Translations -->
33+
<script id="i18n-js" type="text/javascript">
34+
window.I18n = {
35+
locale: "<%= I18n.locale %>",
36+
translations: <%= raw javascript_i18n[:translations].to_json %>,
37+
t: function(key, options = {}) {
38+
const keys = key.split('.');
39+
let translation = this.translations;
40+
for (let k of keys) {
41+
if (translation[k] === undefined) {
42+
return key; // Fallback to key if translation not found
43+
}
44+
translation = translation[k];
45+
}
46+
if (typeof translation === 'string') {
47+
// Simple interpolation
48+
return translation.replace(/\%\{(\w+)\}/g, (match, p1) => options[p1] || match);
49+
}
50+
return key;
51+
}
52+
};
53+
</script>
54+
55+
<%= javascript_importmap_tags %>
56+
</head>
57+
<body class="<%= content_for?(:body_class) ? yield(:body_class) : '' %>" data-controller="better_together--link-metrics" data-link-metrics-url="<%= metrics_link_clicks_path(locale: I18n.locale) %>">
58+
<div class="wrapper">
59+
<!-- Custom Header from Host App -->
60+
<%= content_for?(:custom_header) ? yield(:custom_header) : render('layouts/better_together/header') %>
61+
62+
<%= render 'layouts/better_together/flash_messages' %>
63+
64+
<!-- Main Section -->
65+
<main class="content">
66+
<%= yield %>
67+
</main>
68+
69+
<!-- Custom Scripts from Host App -->
70+
<%= render 'layouts/better_together/custom_body_javascript' %>
71+
</div>
72+
</body>
73+
</html>

0 commit comments

Comments
 (0)