diff --git a/app/models/room.rb b/app/models/room.rb index bc439f8a..4ae7b146 100644 --- a/app/models/room.rb +++ b/app/models/room.rb @@ -3,6 +3,8 @@ class Room < ApplicationRecord before_create :setup + before_destroy :delete_all_recordings + validates :name, presence: true belongs_to :owner, class_name: 'User', foreign_key: :user_id @@ -155,6 +157,12 @@ class Room < ApplicationRecord self.bbb_id = Digest::SHA1.hexdigest(Rails.application.secrets[:secret_key_base] + Time.now.to_i.to_s).to_s end + # Deletes all recordings associated with the room. + def delete_all_recordings + record_ids = recordings.map { |r| r[:recordID] } + delete_recording(record_ids) + end + # Generates a three character uid chunk. def uid_chunk charset = ("a".."z").to_a - %w(b i l o s) + ("2".."9").to_a - %w(5 8) diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 7e10bf8b..797d99b3 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,4 +1,4 @@ -
+
<%= render "shared/components/subtitle", subtitle: t("settings.title"), search: false %>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 3e477cca..ec65b481 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,5 +1,5 @@
-
+
diff --git a/app/views/users/terms.html.erb b/app/views/users/terms.html.erb index a0220725..8684b6a2 100644 --- a/app/views/users/terms.html.erb +++ b/app/views/users/terms.html.erb @@ -1,4 +1,4 @@ -
+
@@ -8,7 +8,7 @@

<%= Rails.configuration.terms %>

-
+
<%= button_to t("terms.accept"), terms_path, params: {accept: true}, class: "btn btn-primary btn-space" %>
diff --git a/config/initializers/terms.rb b/config/initializers/terms.rb index 26e5da70..15e278cb 100644 --- a/config/initializers/terms.rb +++ b/config/initializers/terms.rb @@ -2,7 +2,7 @@ # Load terms and conditions. -terms = "#{Rails.root}/config/terms.txt" +terms = "#{Rails.root}/config/terms.md" Rails.configuration.terms = if File.exist?(terms) File.read(terms) diff --git a/config/locales/en.yml b/config/locales/en.yml index 087afa81..6b49b999 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -111,10 +111,10 @@ en: image: Image image_url: Profile Image URL subtitle: Update your Account Info - title: Account + title: Account Info delete: button: Yes, I would like to delete my account. - disclaimer: If you choose to delete your account, it will NOT be recoverable. All information regarding your account, including settings, rooms, and recording references will be removed. + disclaimer: If you choose to delete your account, it will NOT be recoverable. All information regarding your account, including settings, rooms, and recording will be removed. subtitle: Permanently Delete your Account title: Delete Account design: