From abd5085a87dff0942236cfb8e60b9e38cf290dd1 Mon Sep 17 00:00:00 2001 From: Simer13 <113010708+Simer13@users.noreply.github.com> Date: Tue, 26 Dec 2023 17:27:25 +0530 Subject: [PATCH 1/8] feat: update navbar.scss (#4419) --- app/assets/stylesheets/navbar.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss index f499fbbef62..876a51f4f41 100644 --- a/app/assets/stylesheets/navbar.scss +++ b/app/assets/stylesheets/navbar.scss @@ -4,6 +4,7 @@ top: 0; width: 100%; z-index: 100; + border-bottom: 1px solid $border-color; } .navbar-logo { From 1f57e7f23a73d41b7095f4452512f640a44d1f4e Mon Sep 17 00:00:00 2001 From: Harsh <102225113+senbo1@users.noreply.github.com> Date: Tue, 26 Dec 2023 17:54:56 +0530 Subject: [PATCH 2/8] feat(ui): modify highlight color of text (#4352) --- app/assets/stylesheets/layout.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 5e3bf1ed598..151391209d8 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -6,6 +6,11 @@ html { scroll-behavior: smooth; } +::selection { + background: $primary-green; + color: $white; +} + body { font-family: 'Inter'; padding-top: 90px; From d4448e57902bf54ef36317a0523e76db95921e40 Mon Sep 17 00:00:00 2001 From: Shaurya Gupta Date: Tue, 26 Dec 2023 18:38:11 +0530 Subject: [PATCH 3/8] fix(#4108): improve responsiveness of projects list page (#4349) --- app/assets/stylesheets/layout.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 151391209d8..f535a6d840d 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -181,7 +181,7 @@ body { .pagination { max-width: none; - overflow-x: visible; + overflow-x: auto; padding: 0; white-space: nowrap; } From 0fbfb8964eaae63a4011bcd1de878fd893c8e364 Mon Sep 17 00:00:00 2001 From: Harsh <102225113+senbo1@users.noreply.github.com> Date: Tue, 26 Dec 2023 18:52:55 +0530 Subject: [PATCH 4/8] fix: add client side validations for project name and update project model (#4304) --- app/assets/stylesheets/projects.scss | 10 ++++++++++ app/models/project.rb | 2 +- app/views/projects/_form.html.erb | 23 +++++++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/projects.scss b/app/assets/stylesheets/projects.scss index c133e1e519a..6f4f5420055 100644 --- a/app/assets/stylesheets/projects.scss +++ b/app/assets/stylesheets/projects.scss @@ -217,6 +217,16 @@ width: 80%; } +.char-counter { + color: $tooltip-grey; + font-size: 14px; + margin: 5px 0 0 auto; +} + +.is-invalid { + color: $red; +} + //breakpoints @media (max-width: 575px) { .projects-collaborators-button-container { diff --git a/app/models/project.rb b/app/models/project.rb index 70791b42b26..2a3bc70db16 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -8,7 +8,7 @@ class Project < ApplicationRecord friendly_id :name, use: %i[slugged history] self.ignored_columns += ["data"] - validates :name, length: { minimum: 1 } + validates :name, length: { minimum: 1, maximum: 60 } validates :slug, uniqueness: true belongs_to :author, class_name: "User" diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb index 18d9beabdb9..18dfb585769 100644 --- a/app/views/projects/_form.html.erb +++ b/app/views/projects/_form.html.erb @@ -21,9 +21,10 @@ <% end %> -
+
<%= form.label :name %>
- <%= form.text_field :name, id: :project_name, class: "form-control form-input" %> + <%= form.text_field :name, id: :project_name, class: "form-control form-input", maxlength: 60 %> +
<%= form.label :tag_list %>
<%= t("projects.form.tag_list_description") %> @@ -76,4 +77,22 @@ }); $("#featuredCircuit").submit(); } + + document.addEventListener('DOMContentLoaded', function () { + const nameField = document.getElementById('project_name'); + + nameField.addEventListener('input', function () { + const maxLength = parseInt(this.getAttribute('maxlength')); + const currentLength = this.value.length; + + const nameCounter = document.getElementById('name-counter'); + nameCounter.textContent = `${currentLength} / ${maxLength}`; + + if (currentLength >= maxLength) { + nameCounter.classList.add('is-invalid'); + } else { + nameCounter.classList.remove('is-invalid'); + } + }); + }); From ec31ad7c3e38910ff026515c348755827a3d1555 Mon Sep 17 00:00:00 2001 From: Harsh Gupta <138358017+syntax-bot@users.noreply.github.com> Date: Tue, 26 Dec 2023 19:57:44 +0530 Subject: [PATCH 5/8] fix: changed the pos of newCommentBtn to top (#4432) --- app/assets/stylesheets/commontator.scss | 6 ++++++ app/views/commontator/threads/_reply.html.erb | 2 +- app/views/commontator/threads/_show.html.erb | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/commontator.scss b/app/assets/stylesheets/commontator.scss index 2d7d206573f..166e4e98f32 100644 --- a/app/assets/stylesheets/commontator.scss +++ b/app/assets/stylesheets/commontator.scss @@ -109,6 +109,12 @@ .new-comment { display: block; + margin-top: 0.3rem; +} + +.new-comment-link{ + position: relative; + top: -3.3em; } //breakpoints diff --git a/app/views/commontator/threads/_reply.html.erb b/app/views/commontator/threads/_reply.html.erb index f36f0ee2f0b..1f27ae145da 100644 --- a/app/views/commontator/threads/_reply.html.erb +++ b/app/views/commontator/threads/_reply.html.erb @@ -11,7 +11,7 @@

You must login before you can post a comment.

<% else %> <% if @commontator_new_comment.nil? %> -
- <% if thread.config.comment_order != :l %> - <%= render partial: 'commontator/threads/reply', locals: { thread: thread, user: user } %> - <% end %>