diff --git a/.erb-lint.yml b/.erb-lint.yml index a85300d2d2..bb8917a318 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -1,4 +1,8 @@ --- +glob: "**/*.{html,text,js}{+*,}.erb" +exclude: + - '**/vendor/**/*' + - '**/node_modules/**/*' linters: ErbSafety: enabled: true @@ -11,3 +15,7 @@ linters: Enabled: false Metrics/LineLength: Enabled: false + Layout/TrailingEmptyLines: + Enabled: false + Layout/InitialIndentation: + Enabled: false diff --git a/Dockerfile b/Dockerfile index b996882dbc..5f45731209 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.2.0 +FROM ruby:3.2.1 # set up workdir RUN mkdir /circuitverse diff --git a/Dockerfile.production b/Dockerfile.production index efb85dde13..1140ab1ad7 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM ruby:3.2.0 as builder +FROM --platform=$BUILDPLATFORM ruby:3.2.1 as builder ARG BUILDPLATFORM ENV NODE_ENV=production @@ -34,7 +34,7 @@ RUN rm -rf node_modules spec RUN bundle exec bootsnap precompile --gemfile app/ lib/ -FROM --platform=$BUILDPLATFORM ruby:3.2.0-slim as app +FROM --platform=$BUILDPLATFORM ruby:3.2.1-slim as app COPY --from=builder /usr/src/app /usr/src/app diff --git a/Gemfile b/Gemfile index 1135f4f919..71a85467ad 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,7 @@ gem "view_component" # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem "rails", "~> 7.0" # Use Puma as the app server -gem "puma", "~> 5.6" +gem "puma", "~> 6.1" # Use SCSS for stylesheets gem "sass-rails", "~> 6.0" gem "terser" diff --git a/Gemfile.lock b/Gemfile.lock index 54bbe7f0aa..50d485b2c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/CircuitVerse/disposable_email.git - revision: b47303bcd6c51726d5027e9aa816b3ca1e0b3a3a + revision: e90182d085c720bc9361246177fbada38f79179f specs: disposable_mail (0.1.7) @@ -17,71 +17,71 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.1) - actionpack (= 7.0.4.1) - activesupport (= 7.0.4.1) + actioncable (7.0.4.3) + actionpack (= 7.0.4.3) + activesupport (= 7.0.4.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.1) - actionpack (= 7.0.4.1) - activejob (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionmailbox (7.0.4.3) + actionpack (= 7.0.4.3) + activejob (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.1) - actionpack (= 7.0.4.1) - actionview (= 7.0.4.1) - activejob (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionmailer (7.0.4.3) + actionpack (= 7.0.4.3) + actionview (= 7.0.4.3) + activejob (= 7.0.4.3) + activesupport (= 7.0.4.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.1) - actionview (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionpack (7.0.4.3) + actionview (= 7.0.4.3) + activesupport (= 7.0.4.3) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.1) - actionpack (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + actiontext (7.0.4.3) + actionpack (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.1) - activesupport (= 7.0.4.1) + actionview (7.0.4.3) + activesupport (= 7.0.4.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.1) - activesupport (= 7.0.4.1) + activejob (7.0.4.3) + activesupport (= 7.0.4.3) globalid (>= 0.3.6) - activemodel (7.0.4.1) - activesupport (= 7.0.4.1) + activemodel (7.0.4.3) + activesupport (= 7.0.4.3) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (7.0.4.1) - activemodel (= 7.0.4.1) - activesupport (= 7.0.4.1) - activestorage (7.0.4.1) - actionpack (= 7.0.4.1) - activejob (= 7.0.4.1) - activerecord (= 7.0.4.1) - activesupport (= 7.0.4.1) + activerecord (7.0.4.3) + activemodel (= 7.0.4.3) + activesupport (= 7.0.4.3) + activestorage (7.0.4.3) + actionpack (= 7.0.4.3) + activejob (= 7.0.4.3) + activerecord (= 7.0.4.3) + activesupport (= 7.0.4.3) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.1) + activesupport (7.0.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -125,12 +125,11 @@ GEM aws-sigv4 (1.5.1) aws-eventstream (~> 1, >= 1.0.2) bcrypt (3.1.16) - better_html (1.0.16) - actionview (>= 4.0) - activesupport (>= 4.0) + better_html (2.0.1) + actionview (>= 6.0) + activesupport (>= 6.0) ast (~> 2.0) erubi (~> 1.4) - html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties bindex (0.8.1) @@ -174,7 +173,7 @@ GEM rails (>= 6.0) sprockets-rails will_paginate - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) connection_pool (2.2.5) countries (5.3.0) unaccent (~> 0.3) @@ -209,10 +208,9 @@ GEM dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) - erb_lint (0.1.1) + erb_lint (0.4.0) activesupport - better_html (~> 1.0.7) - html_tokenizer + better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow rubocop @@ -236,22 +234,23 @@ GEM ffi-compiler (1.0.1) ffi (>= 1.0.0) rake - flipper (0.24.1) - flipper-redis (0.24.0) - flipper (~> 0.24.0) - redis (>= 3.0, < 5) - flipper-ui (0.24.1) + flipper (0.28.0) + concurrent-ruby (< 2) + flipper-redis (0.28.0) + flipper (~> 0.28.0) + redis (>= 3.0, < 6) + flipper-ui (0.28.0) erubi (>= 1.0.0, < 2.0.0) - flipper (~> 0.24.1) + flipper (~> 0.28.0) rack (>= 1.4, < 3) - rack-protection (>= 1.5.3, <= 2.2.0) + rack-protection (>= 1.5.3, <= 4.0.0) sanitize (< 7) font-awesome-sass (5.13.1) sassc (>= 1.11) friendly_id (5.4.2) activerecord (>= 4.0.0) geocoder (1.7.3) - globalid (1.0.1) + globalid (1.1.0) activesupport (>= 5.0) hairtrigger (0.2.25) activerecord (>= 5.0, < 8) @@ -262,7 +261,6 @@ GEM hirb (0.7.3) hiredis (0.6.3) hkdf (0.3.0) - html_tokenizer (0.0.7) htmlentities (4.3.4) http (4.4.0) addressable (~> 2.3) @@ -327,10 +325,10 @@ GEM listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.19.1) + loofah (2.20.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0.1) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -347,8 +345,8 @@ GEM mime-types-data (3.2022.0105) mini_magick (4.11.0) mini_mime (1.1.2) - mini_portile2 (2.8.1) - minitest (5.17.0) + mini_portile2 (2.8.2) + minitest (5.18.0) msgpack (1.6.0) multi_xml (0.6.0) nested_form (0.3.2) @@ -363,10 +361,8 @@ GEM net-protocol newrelic_rpm (8.14.0) nio4r (2.5.8) - nokogiri (1.14.2) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) - nokogiri (1.14.2-x64-mingw32) + nokogiri (1.15.2) + mini_portile2 (~> 2.8.2) racc (~> 1.4) noticed (1.6.0) http (>= 4.0.0) @@ -408,7 +404,7 @@ GEM omniauth (~> 2.0) orm_adapter (0.5.0) parallel (1.22.1) - parser (3.2.0.0) + parser (3.2.2.0) ast (~> 2.4.1) pg (1.4.5) pg (1.4.5-x64-mingw32) @@ -429,32 +425,32 @@ GEM pry-rails (0.3.9) pry (>= 0.10.4) public_suffix (5.0.1) - puma (5.6.4) + puma (6.1.1) nio4r (~> 2.0) pundit (2.3.0) activesupport (>= 3.0.0) racc (1.6.2) - rack (2.2.6.3) + rack (2.2.6.4) rack-attack (6.6.1) rack (>= 1.0, < 3) - rack-protection (2.2.0) + rack-protection (3.0.5) rack - rack-test (2.0.2) + rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.1) - actioncable (= 7.0.4.1) - actionmailbox (= 7.0.4.1) - actionmailer (= 7.0.4.1) - actionpack (= 7.0.4.1) - actiontext (= 7.0.4.1) - actionview (= 7.0.4.1) - activejob (= 7.0.4.1) - activemodel (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + rails (7.0.4.3) + actioncable (= 7.0.4.3) + actionmailbox (= 7.0.4.3) + actionmailer (= 7.0.4.3) + actionpack (= 7.0.4.3) + actiontext (= 7.0.4.3) + actionview (= 7.0.4.3) + activejob (= 7.0.4.3) + activemodel (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) bundler (>= 1.15.0) - railties (= 7.0.4.1) + railties (= 7.0.4.3) rails-data-migrations (1.2.0) rails (>= 4.0.0) rails-dom-testing (2.0.3) @@ -465,7 +461,7 @@ GEM activesupport (>= 4.2) choice (~> 0.2.0) ruby-graphviz (~> 1.2) - rails-html-sanitizer (1.4.4) + rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) rails-i18n (7.0.3) i18n (>= 0.7, < 2) @@ -476,9 +472,9 @@ GEM nested_form (~> 0.3) rails (>= 6.0, < 8) turbo-rails (~> 1.0) - railties (7.0.4.1) - actionpack (= 7.0.4.1) - activesupport (= 7.0.4.1) + railties (7.0.4.3) + actionpack (= 7.0.4.3) + activesupport (= 7.0.4.3) method_source rake (>= 12.2) thor (~> 1.0) @@ -492,7 +488,7 @@ GEM json redcarpet (3.5.1) redis (4.6.0) - regexp_parser (2.6.2) + regexp_parser (2.7.0) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) @@ -519,18 +515,18 @@ GEM rspec-support (3.11.0) rspec_junit_formatter (0.5.1) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.43.0) + rubocop (1.49.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) + rubocop-ast (1.28.0) + parser (>= 3.2.1.0) rubocop-performance (1.14.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -542,7 +538,7 @@ GEM rubocop (~> 1.19) ruby-graphviz (1.2.5) rexml - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby-saml (1.14.0) nokogiri (>= 1.10.5) rexml @@ -592,7 +588,7 @@ GEM simplecov_json_formatter (0.1.4) sitemap_generator (6.2.1) builder (~> 3.0) - smart_properties (1.15.0) + smart_properties (1.17.0) snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) @@ -625,7 +621,7 @@ GEM execjs (>= 0.3.0, < 3) thor (1.2.1) tilt (2.0.10) - timeout (0.3.1) + timeout (0.3.2) tins (1.32.1) sync turbo-rails (1.3.2) @@ -676,7 +672,7 @@ GEM will_paginate (>= 3.0.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS ruby @@ -741,7 +737,7 @@ DEPENDENCIES pg_search premailer-rails (~> 1.11, >= 1.11.1) pry-rails - puma (~> 5.6) + puma (~> 6.1) pundit rack-attack rails (~> 7.0) diff --git a/app/assets/stylesheets/announcements.scss b/app/assets/stylesheets/announcements.scss index 296dfc006c..38022f93a5 100644 --- a/app/assets/stylesheets/announcements.scss +++ b/app/assets/stylesheets/announcements.scss @@ -1,36 +1,35 @@ .announcements-content-wrapper { align-items: center; background: $primary-green; + border-radius: .3rem; color: $white; display: flex; flex-wrap: wrap; - font-size: 13px; + font-size: 1.2rem; justify-content: center; - min-height: 35px; - min-width: 100vw; + margin-top: .3rem; overflow-wrap: break-word; - position: fixed; - top: 0; - z-index: 1; - p { - margin-bottom: 0; + span { + display: inline-block; + flex: 50%; + margin-right: 1rem; + margin-top: 1rem; + text-align: center; } a { - border-bottom: 1px dotted $white; - color: $white; - font-weight: bold; - margin-left: 10px; - - &:hover { - text-decoration: none; - } + background: $secondary-red; } } @media(max-width: 992px) { .announcements-content-wrapper { - font-size: 9px; + font-size: 1rem; + padding-bottom: .6rem; + + span { + flex: 100%; + } } } diff --git a/app/assets/stylesheets/commontator.scss b/app/assets/stylesheets/commontator.scss index 94e23a5194..2d7d206573 100644 --- a/app/assets/stylesheets/commontator.scss +++ b/app/assets/stylesheets/commontator.scss @@ -18,6 +18,14 @@ background-color: $card-green; margin-top: 15px; padding: 10px 20px; + + .body { + margin-bottom: 16px; + + p { + margin-bottom: 0; + } + } } .avatar { diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss index e412a96eea..23260a5bb9 100644 --- a/app/assets/stylesheets/components.scss +++ b/app/assets/stylesheets/components.scss @@ -267,12 +267,12 @@ .alert-success { margin-top: 10px; + padding-top: 1rem; // aligns the alert text } //checkpoints .primary-checkpoint { background-color: $shadow-grey; - bottom: 0; display: inline-block; height: 25px; margin-top: 15px; @@ -313,11 +313,11 @@ border: solid $white; border-width: 0 3px 3px 0; display: block; - height: 12px; - left: 9px; - top: 5px; + height: 14px; + left: 7px; + top: 2px; transform: rotate(45deg); - width: 8px; + width: 9px; } } } diff --git a/app/assets/stylesheets/groups.scss b/app/assets/stylesheets/groups.scss index 0ec1d5fc31..88dc6b1f19 100644 --- a/app/assets/stylesheets/groups.scss +++ b/app/assets/stylesheets/groups.scss @@ -174,8 +174,9 @@ background-color: $card-green; border: 1px solid $secondary-green; display: inline-block; - height: 70px; + height: 90px; margin: 10px; + margin-bottom: 20px; padding: 15px; width: 200px; white-space: nowrap; @@ -183,13 +184,13 @@ .groups-members-card-details { padding-right: 0; - padding-top: 20px; + padding-top: 5px; text-align: left; i { - margin-right: 3px; - margin-top: 0; - padding-bottom: 5px; + margin-right: 10px; + margin-top: 20px; + padding-bottom: 20px; } } @@ -200,7 +201,7 @@ i { margin-right: 15px; - padding-bottom: 0; + padding-bottom: 15px; } .groups-members-card-name-container { @@ -218,13 +219,30 @@ } } +.groups-members-card-avatar { + img { + border-radius: 50%; + height: 50px; + margin-bottom: 10px; + transform: translate(-5px, 5px); + transition: all .5s; + width: 50px; + + &:hover { + transform: scale(2); + } + } +} + .groups-members-card-name-container { display: inline-block; - height: 25px; - max-width: 110px; + height: 30px; + max-width: 92px; overflow: hidden; padding-top: 1px; text-overflow: ellipsis; + vertical-align: middle; + white-space: nowrap; } .groups-members-card-name { @@ -265,17 +283,17 @@ //breakpoints @media (max-width: 1200px) { .groups-members-scroll-row { - max-width: 920px; + max-width: 930px; } .groups-members-card { - width: 350px; + width: 320px; } } @media (max-width: 992px) { .groups-members-scroll-row { - max-width: 610px; + max-width: 680px; } } diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss index 5a7123ad55..24cbcbbbdd 100644 --- a/app/assets/stylesheets/navbar.scss +++ b/app/assets/stylesheets/navbar.scss @@ -234,7 +234,3 @@ padding-top: 10px; } } - -.navbar-announcement { - top: 35px; -} diff --git a/app/controllers/api/v1/comments_controller.rb b/app/controllers/api/v1/comments_controller.rb index 9d6d092784..8b4a66b28b 100644 --- a/app/controllers/api/v1/comments_controller.rb +++ b/app/controllers/api/v1/comments_controller.rb @@ -71,7 +71,7 @@ def upvote # PUT /api/v1/comments/:id/downvote def downvote - security_transgression_unless @comment.can_be_voted_on_by?(current_user) && \ + security_transgression_unless @comment.can_be_voted_on_by?(current_user) && @comment.thread.config.comment_voting.to_sym == :ld @comment.downvote_from current_user diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index 66b8be04b3..bfa343a5f8 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -22,25 +22,25 @@ def user_access? def check_edit_access? return false if user.nil? || project.project_submission - project.author_id == user.id || \ + project.author_id == user.id || Collaboration.exists?(project_id: project.id, user_id: user.id) end def check_view_access? - (project.project_access_type != "Private" \ - || (!user.nil? && project.author_id == user.id) \ - || (!user.nil? && !project.assignment_id.nil? \ - && ((project.assignment.group.primary_mentor_id == user.id) \ - || project.assignment.group.group_members.exists?(user_id: user.id, mentor: true))) \ - || (!user.nil? && Collaboration.exists?(project_id: project.id, user_id: user.id)) \ - || (!user.nil? && user.admin)) + (project.project_access_type != "Private" || + (!user.nil? && project.author_id == user.id) || + (!user.nil? && !project.assignment_id.nil? && + ((project.assignment.group.primary_mentor_id == user.id) || + project.assignment.group.group_members.exists?(user_id: user.id, mentor: true))) || + (!user.nil? && Collaboration.exists?(project_id: project.id, user_id: user.id)) || + (!user.nil? && user.admin)) end def check_direct_view_access? - (project.project_access_type == "Public" \ - || (project.project_submission == false && !user.nil? && project.author_id == user.id) \ - || (!user.nil? && Collaboration.exists?(project_id: project.id, user_id: user.id)) \ - || (!user.nil? && user.admin)) + (project.project_access_type == "Public" || + (project.project_submission == false && !user.nil? && project.author_id == user.id) || + (!user.nil? && Collaboration.exists?(project_id: project.id, user_id: user.id)) || + (!user.nil? && user.admin)) end def edit_access? diff --git a/app/services/i18n_support.rb b/app/services/i18n_support.rb index 1973fd6e34..615b72093f 100644 --- a/app/services/i18n_support.rb +++ b/app/services/i18n_support.rb @@ -5,7 +5,8 @@ def self.locale_names [ %w[English en], %w[Hindi hi], - %w[Bengali bn] + %w[Bengali bn], + %w[Marathi mr] ] end end diff --git a/app/views/about/index.html.erb b/app/views/about/index.html.erb index 1d453f6d4e..27dc5ea670 100644 --- a/app/views/about/index.html.erb +++ b/app/views/about/index.html.erb @@ -42,7 +42,7 @@ <% @cores.each do |member| %>
- A new assignment named <%= @assignment.name %> (<%= @assignment.deadline %>) has been assigned in <%= Group.find_by(id:@assignment.group_id).name %>.
- Assignment is mentored by <%= User.find_by(id:Group.find_by(id:@assignment.group_id).primary_mentor_id).name %>
+ A new assignment named <%= @assignment.name %> (<%= @assignment.deadline %>) has been assigned in <%= Group.find_by(id: @assignment.group_id).name %>.
+ Assignment is mentored by <%= User.find_by(id: Group.find_by(id: @assignment.group_id).primary_mentor_id).name %>
Keep building!
diff --git a/app/views/assignments/_form.html.erb b/app/views/assignments/_form.html.erb index 839700838f..643710ad65 100644 --- a/app/views/assignments/_form.html.erb +++ b/app/views/assignments/_form.html.erb @@ -1,7 +1,7 @@ -<%= form_with(model: [group,@assignment], local: true, html: {onsubmit:"beforeSubmit()"}, multipart: true ,id:"assignmentForm", 'data-controller': "assignment") do |form| %> +<%= form_with(model: [group, @assignment], local: true, html: { onsubmit: "beforeSubmit()" }, multipart: true, id: "assignmentForm", "data-controller": "assignment") do |form| %> <% if @assignment.errors.any? %>Grading Scale needs to be fixed at 1-100 for passing the grade back to LMS
<%= t("assignments.form.cannot_be_edited", graded: AssignmentDecorator.new(@assignment).graded) %>
@@ -70,8 +70,8 @@