From 95f7fff53d09580f3cbfdb7a66f5e3c653d5929a Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Tue, 4 Jul 2023 23:05:22 +0300 Subject: [PATCH] fix style, add product links --- app/controllers/accounts_controller.rb | 10 +++++++- app/controllers/setup_controller.rb | 7 ++++++ app/views/dashboard/index.html.erb | 4 ++-- app/views/icons/_brand_discord.html.erb | 7 ++++++ app/views/icons/_brand_twitter.html.erb | 4 ++++ app/views/pages/landing.html.erb | 2 +- app/views/shared/_meta.html.erb | 4 ++-- app/views/shared/_navbar.html.erb | 13 ++++++---- app/views/shared/_settings_nav.html.erb | 24 +++++++++++++++---- .../storage_settings/_azure_form.html.erb | 2 +- lib/docuseal.rb | 3 +++ 11 files changed, 65 insertions(+), 15 deletions(-) create mode 100644 app/views/icons/_brand_discord.html.erb create mode 100644 app/views/icons/_brand_twitter.html.erb diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 523dcf71..60d8acd8 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -16,7 +16,15 @@ class AccountsController < ApplicationController @encrypted_config = EncryptedConfig.find_or_initialize_by(account: current_account, key: EncryptedConfig::APP_URL_KEY) - @encrypted_config.update!(app_url_params) + @encrypted_config.assign_attributes(app_url_params) + + unless URI.parse(@encrypted_config.value.to_s).class.in?([URI::HTTP, URI::HTTPS]) + @encrypted_config.errors.add(:value, 'should be a valid URL') + + return render :show, status: :unprocessable_entity + end + + @encrypted_config.save! Docuseal.refresh_default_url_options! diff --git a/app/controllers/setup_controller.rb b/app/controllers/setup_controller.rb index 2b42cc9d..3c89e34d 100644 --- a/app/controllers/setup_controller.rb +++ b/app/controllers/setup_controller.rb @@ -19,6 +19,13 @@ class SetupController < ApplicationController @user = @account.users.new(user_params) + unless URI.parse(encrypted_config_params[:value].to_s).class.in?([URI::HTTP, URI::HTTPS]) + @encrypted_config = EncryptedConfig.new(encrypted_config_params) + @encrypted_config.errors.add(:value, 'should be a valid URL') + + return render :index, status: :unprocessable_entity + end + if @user.save encrypted_configs = [ { key: EncryptedConfig::APP_URL_KEY, value: encrypted_config_params[:value] }, diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 5d39e8d6..6af153d5 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -49,10 +49,10 @@

👋 Welcome to DocuSeal

-

Streamline document workflows, from creating customizable templates to filling and signing document forms, with DocuSeal

+

Streamline document workflows, from creating customizable templates to filling and signing document forms

<%= link_to new_template_path, class: 'base-button', data: { turbo_frame: :modal } do %> <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> - Create Template + Create Template <% end %>
diff --git a/app/views/icons/_brand_discord.html.erb b/app/views/icons/_brand_discord.html.erb new file mode 100644 index 00000000..f47eb4f7 --- /dev/null +++ b/app/views/icons/_brand_discord.html.erb @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/views/icons/_brand_twitter.html.erb b/app/views/icons/_brand_twitter.html.erb new file mode 100644 index 00000000..f34ea96d --- /dev/null +++ b/app/views/icons/_brand_twitter.html.erb @@ -0,0 +1,4 @@ + + + + diff --git a/app/views/pages/landing.html.erb b/app/views/pages/landing.html.erb index 1105e30c..e8b13c6b 100644 --- a/app/views/pages/landing.html.erb +++ b/app/views/pages/landing.html.erb @@ -62,7 +62,7 @@

Open Source

- Source code is available under github.com/docusealhq.
Open-source contributors are always ready to help! + Source code is available under github.com/docusealco.
Open-source contributors are always ready to help!

diff --git a/app/views/shared/_meta.html.erb b/app/views/shared/_meta.html.erb index 9c9d35d7..4074c8a7 100644 --- a/app/views/shared/_meta.html.erb +++ b/app/views/shared/_meta.html.erb @@ -9,8 +9,8 @@ - - + + diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb index a819e54e..53a40bf4 100644 --- a/app/views/shared/_navbar.html.erb +++ b/app/views/shared/_navbar.html.erb @@ -1,8 +1,13 @@
- - <%= render 'shared/logo' %> - DocuSeal - + <% if signed_in? %>
<%= link_to 'Settings', settings_profile_index_path, class: 'font-medium text-lg' %> diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index a2e2d832..d74ab662 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -1,6 +1,6 @@ - -
-
<%= fff.label :storage_access_key, 'Storage Access Key', class: 'label' %> - <%= fff.text_field :storage_access_key, value: configs['storage_access_key'], required: true, class: 'base-input' %> + <%= fff.password_field :storage_access_key, value: configs['storage_access_key'], required: true, class: 'base-input' %>
<% end %> <% end %> diff --git a/lib/docuseal.rb b/lib/docuseal.rb index 13fb6ca8..3e8243d1 100644 --- a/lib/docuseal.rb +++ b/lib/docuseal.rb @@ -5,6 +5,9 @@ module Docuseal NEWSLETTER_URL = "#{PRODUCT_URL}/newsletters".freeze PRODUCT_NAME = 'DocuSeal' DEFAULT_APP_URL = 'http://localhost:3000' + GITHUB_URL = 'https://github.com/docusealco/docuseal' + DISCORD_URL = 'https://discord.com/invite/B5wg5wKk' + TWITTER_URL = 'https://twitter.com/docusealco' CERTS = JSON.parse(ENV.fetch('CERTS', '{}'))