8000 Add setting for an instance-specific financial support link by Floppy · Pull Request #3874 · manyfold3d/manyfold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add setting for an instance-specific financial support link #3874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def update_appearance_settings(settings)
SiteSettings.theme = settings[:theme]
SiteSettings.about = settings[:about]
SiteSettings.rules = settings[:rules]
SiteSettings.support_link = settings[:support_link]
end

def update_library_settings(settings)
Expand Down
1 change: 1 addition & 0 deletions app/models/site_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class SiteSettings < RailsSettings::Base
field :site_icon, type: :string, default: ENV.fetch("SITE_ICON", nil)
field :about, type: :string, default: nil
field :rules, type: :string, default: nil
field :support_link, type: :string, default: nil

validates :model_ignored_files, regex_array: {strict: true}

Expand Down
3 changes: 3 additions & 0 deletions app/views/application/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<h5><%= site_name(default: t(".instance_heading")) %></h5>
<ul class="list-unstyled">
<li class="mb-2"><%= link_to t(".about"), about_path %></li>
<% if SiteSettings.support_link.presence %>
<li class="mb-2"><a href="<%= SiteSettings.support_link %>" target="_blank"><%= t ".support" %></a></li>
<% end %>
<li class="mb-2"><%= link_to t(".api"), api_url, rel: "noopener", target: "_blank" %></li>
</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/views/settings/appearance.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<%= text_input_row form, "appearance[site_name]", label: t(".site_name.label"), value: SiteSettings.site_name, placeholder: t("application.title"), help: t(".site_name.help") %>
<%= text_input_row form, "appearance[site_tagline]", label: t(".site_tagline.label"), value: SiteSettings.site_tagline, placeholder: t("application.tagline"), help: t(".site_tagline.help") %>
<%= url_input_row form, "appearance[site_icon]", label: t(".site_icon.label"), value: SiteSettings.site_icon, help: t(".site_icon.help") %>
<%= url_input_row form, "appearance[support_link]", label: t(".support_link.label"), value: SiteSettings.support_link, help: t(".support_link.help") %>
<div class="row mb-3 input-group">
<%= form.label nil, t(".theme.label"), for: "appearance[theme]", class: "col-auto col-form-label" %>
<div class="col p-0">
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ en:
open_source_html: <a href="https://github.com/manyfold3d/manyfold" target="_blank">Open Source</a> under the <a href="https://github.com/manyfold3d/manyfold/blob/main/LICENSE.md" target="_blank" rel="license">MIT license</a>.
powered_by_html: Powered by <a href="https://manyfold.app">%{name}</a>
sponsor: Sponsor development
support: Support this instance
version: Version
link_fields:
url:
Expand Down
3 changes: 3 additions & 0 deletions config/locales/settings/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ en:
help: A few words to introduce your site, shown on the homepage.
label: Tagline
summary: Customise your instance.
support_link:
help: A link to a place where your users can support the instance financially (e.g. OpenCollective, Patreon). Shown in footer.
label: Support link
theme:
help_html: Affects all users. Visit <a href="https://bootswatch.com">Bootswatch</a> to see previews.
label: Theme
Expand Down
Loading
0