diff --git a/app/controllers/settings/subscriptions_controller.rb b/app/controllers/settings/subscriptions_controller.rb new file mode 100644 index 00000000..10bbfd51 --- /dev/null +++ b/app/controllers/settings/subscriptions_controller.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class Settings::SubscriptionsController < ApplicationController + before_action :authenticate_user! + + def index; end +end diff --git a/app/views/settings/_navigation.html.erb b/app/views/settings/_navigation.html.erb index 8b5e51e0..7bddbe9c 100644 --- a/app/views/settings/_navigation.html.erb +++ b/app/views/settings/_navigation.html.erb @@ -5,4 +5,7 @@ <%= link_to 'Background Jobs', settings_background_jobs_path, role: 'tab', class: "tab #{active_tab?(settings_background_jobs_path)}" %> <% end %> <%= link_to 'Map', settings_maps_path, role: 'tab', class: "tab #{active_tab?(settings_maps_path)}" %> + <%# if !DawarichSettings.self_hosted? %> + <%= link_to 'Subscriptions', settings_subscriptions_path, role: 'tab', class: "tab #{active_tab?(settings_subscriptions_path)}" %> + <%# end %> diff --git a/app/views/settings/subscriptions/index.html.erb b/app/views/settings/subscriptions/index.html.erb new file mode 100644 index 00000000..4d9104be --- /dev/null +++ b/app/views/settings/subscriptions/index.html.erb @@ -0,0 +1,30 @@ +<% content_for :title, "Subscriptions" %> + +
+ You are currently subscribed to Dawarich, hurray! +
+ ++ Your subscription will be valid for the next <%= 365 %> days and will be <%= current_user.active? ? 'renewed automatically' : 'renewed manually' %>. +
+ + <%= link_to 'Manage subscription', '#', class: 'btn btn-primary my-4' %> + <% else %> ++ You are currently not subscribed to Dawarich. How about we fix that? +
+ + <%= link_to 'Manage subscription', '#', class: 'btn btn-primary my-4' %> + <% end %> +