From ea5c38686ea68282bf9da9fc6da0f89efa966644 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 13 Mar 2024 20:52:33 +1100 Subject: [PATCH] FIX: expire assets when CSS changes FIX: missing translation on share page (#528) * FIX: expire assets when CSS changes FIX: missing translation on share page Also add trivial image styling * oops not needed --- .../ai_bot/shared_ai_conversations_helper.rb | 15 ++++++++++++++ .../shared_ai_conversations/show.html.erb | 7 +++---- config/locales/server.en.yml | 2 +- public/ai-share/share.css | 20 ++++++++++++++----- .../ai_bot/shared_ai_conversations_spec.rb | 1 + 5 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 app/helpers/discourse_ai/ai_bot/shared_ai_conversations_helper.rb diff --git a/app/helpers/discourse_ai/ai_bot/shared_ai_conversations_helper.rb b/app/helpers/discourse_ai/ai_bot/shared_ai_conversations_helper.rb new file mode 100644 index 00000000..3e16311c --- /dev/null +++ b/app/helpers/discourse_ai/ai_bot/shared_ai_conversations_helper.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true +module DiscourseAi + module AiBot + module SharedAiConversationsHelper + # bump up version when assets change + # long term we may want to change this cause it is hard to remember + # to bump versions, but for now this does the job + VERSION = "1" + + def share_asset_url(short_path) + ::UrlHelper.local_cdn_url("/plugins/discourse-ai/ai-share/#{short_path}?#{VERSION}") + end + end + end +end diff --git a/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb b/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb index b77378f5..8880a67e 100644 --- a/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb +++ b/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb @@ -10,8 +10,8 @@ - "> - "> + "> + "> - + -