From 4ffd198505a4db0afc345f6fb831d29bfa1470bf Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Wed, 12 Jul 2023 01:24:25 +0300 Subject: [PATCH] adjust demo --- app/controllers/application_controller.rb | 2 +- app/javascript/form.js | 1 + app/javascript/submission_form/completed.vue | 19 ++++++++++++++- app/javascript/submission_form/form.vue | 6 +++++ app/views/dashboard/index.html.erb | 1 + app/views/layouts/application.html.erb | 1 - app/views/shared/_demo_alert.html.erb | 14 ++++++----- app/views/shared/_github_button.html.erb | 10 ++++++++ app/views/shared/_navbar.html.erb | 16 +++++++++---- app/views/submit_form/show.html.erb | 2 +- app/views/templates/show.html.erb | 16 +++++++++---- lib/accounts.rb | 25 ++++++++++++++++++++ 12 files changed, 93 insertions(+), 20 deletions(-) create mode 100644 app/views/shared/_github_button.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f00f26d3..44e39e6a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base private def sign_in_for_demo - sign_in(User.first) unless signed_in? + sign_in(User.order('random()').take) unless signed_in? end def current_account diff --git a/app/javascript/form.js b/app/javascript/form.js index d69e1f31..ca38da31 100644 --- a/app/javascript/form.js +++ b/app/javascript/form.js @@ -14,6 +14,7 @@ window.customElements.define('submission-form', class extends HTMLElement { authenticityToken: this.dataset.authenticityToken, canSendEmail: this.dataset.canSendEmail === 'true', isDirectUpload: this.dataset.isDirectUpload === 'true', + isDemo: this.dataset.isDemo === 'true', values: reactive(JSON.parse(this.dataset.values)), attachments: reactive(JSON.parse(this.dataset.attachments)), fields: JSON.parse(this.dataset.fields) diff --git a/app/javascript/submission_form/completed.vue b/app/javascript/submission_form/completed.vue index 69e72cf4..4043de91 100644 --- a/app/javascript/submission_form/completed.vue +++ b/app/javascript/submission_form/completed.vue @@ -40,6 +40,17 @@ Download + + + + Star on Github + +
Signed with @@ -53,13 +64,14 @@