Skip to content

Commit

Permalink
Merge pull request #11415 from hennevogel/feature/tos-link
Browse files Browse the repository at this point in the history
Introduces a Terms (of Service) link
  • Loading branch information
hennevogel committed Jul 26, 2021
2 parents 963d21f + 3d5294b commit 78a389e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/configuration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def update
private

def configuration_params
params.require(:configuration).permit(:name, :title, :description, :unlisted_projects_filter, :unlisted_projects_filter_description)
params.require(:configuration).permit(:name, :title, :description, :tos_url, :unlisted_projects_filter, :unlisted_projects_filter_description)
end

def set_configuration
Expand Down
4 changes: 3 additions & 1 deletion src/api/app/models/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class Configuration < ApplicationRecord
disable_publish_for_branches: nil,
admin_email: nil,
unlisted_projects_filter: nil,
unlisted_projects_filter_description: nil
unlisted_projects_filter_description: nil,
tos_url: nil
}
# rubocop:enable Style/MutableConstant

Expand Down Expand Up @@ -166,6 +167,7 @@ def write_to_backend
# registration :string default("allow")
# theme :string(255)
# title :string(255) default("")
# tos_url :string(255)
# unlisted_projects_filter :string(255) default("^home:.+")
# unlisted_projects_filter_description :string(255) default("home projects")
# ymp_url :string(255)
Expand Down
15 changes: 7 additions & 8 deletions src/api/app/views/layouts/webui/_footer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
%div
%strong.text-uppercase Help
%ul
%li= link_to('Open Build Service', 'http://openbuildservice.org/')
%li= link_to('OBS Manuals', 'http://openbuildservice.org/help/manuals/')
%li= link_to('OpenBuildService.org', 'https://openbuildservice.org/')
%li= link_to('Documentation', 'https://openbuildservice.org/help/manuals/')
%li= link_to('API Documentation', apidocs_index_path)
%li= link_to('OBS Portal', 'http://en.opensuse.org/Portal:Build_service')
%li= link_to('Reporting a Bug', 'http://openbuildservice.org/support/')

%div
%strong.text-uppercase Contact
%ul
%li= link_to('Mailing List', 'http://lists.opensuse.org/opensuse-buildservice/')
%li= link_to('Forums', 'http://forums.opensuse.org/forumdisplay.php/692-Open-Build-Service-%28OBS%29')
%li= link_to('Chat (IRC)', 'irc://irc.opensuse.org/opensuse-buildservice')
%li= link_to('Twitter', 'http://twitter.com/OBShq')
%li= link_to('Support', 'https://openbuildservice.org/support/')
%li= link_to('@OBShq', 'https://twitter.com/OBShq')
- if Configuration.tos_url.present?
%li= link_to('Terms', Configuration.tos_url)
5 changes: 2 additions & 3 deletions src/api/app/views/layouts/webui/webui.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@
= render partial: 'layouts/webui/sponsors'
.container-fluid.mt-2.py-2#footer-legal
%p.text-center
= link_to('Open Build Service (OBS)', 'http://openbuildservice.org')
is an
The Open Build Service is an
= succeed '.' do
= link_to('openSUSE project', 'http://www.opensuse.org')
= link_to('openSUSE project', 'https://www.opensuse.org')

- if !current_page?(signup_path) && !current_page?(new_session_path)
#bottom-navigation-area
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/views/webui/configuration/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
Description
%abbr.text-danger{ title: 'required' } *
~ f.text_area :description, rows: 7, required: true, class: 'form-control'
.form-group
= f.label(:tos_url) do
Terms Of Service URL
~ f.text_field :tos_url, required: false, class: 'form-control', type: :url

.h5.mt-4 Base Configuration
%p
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddTosurlToConfiguration < ActiveRecord::Migration[6.1]
def change
add_column :configurations, :tos_url, :string
end
end
1 change: 1 addition & 0 deletions src/api/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
t.string "api_url", collation: "utf8_bin"
t.string "unlisted_projects_filter", default: "^home:.+", collation: "utf8_bin"
t.string "unlisted_projects_filter_description", default: "home projects", collation: "utf8_bin"
t.string "tos_url"
end

create_table "data_migrations", primary_key: "version", id: :string, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
Expand Down

0 comments on commit 78a389e

Please sign in to comment.