Skip to content

Commit

Permalink
Merge pull request #3715 from Growstuff/dev
Browse files Browse the repository at this point in the history
April 2024 Release
  • Loading branch information
CloCkWeRX authored Apr 10, 2024
2 parents 2a421cf + 3347519 commit 3027cb1
Show file tree
Hide file tree
Showing 18 changed files with 284 additions and 161 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ submit the change with your pull request.
- Martina Simicic / [simicic](https://github.com/simicic)
- Rowan Crawford / [wombleton](https://github.com/wombleton)
- Ítalo Pires / [italopires](https://github.com/italopires)
- Bennett Zink / [bennett-zink](https://github.com/bennett-zink)

## Bots

Expand Down
27 changes: 16 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ GEM
marcel (~> 1.0.0)
ssrf_filter (~> 1.0)
chartkick (5.0.6)
childprocess (5.0.0)
codeclimate-test-reporter (1.0.9)
simplecov (<= 0.13)
coderay (1.1.3)
Expand Down Expand Up @@ -258,7 +259,7 @@ GEM
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
railties (>= 5.0.0)
faker (3.3.0)
faker (3.3.1)
i18n (>= 1.8.11, < 2)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
Expand Down Expand Up @@ -340,7 +341,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.7.1)
json (2.7.2)
json-schema (4.1.1)
addressable (>= 2.8)
jsonapi-resources (0.10.7)
Expand All @@ -352,13 +353,14 @@ GEM
kramdown (2.4.0)
rexml
language_server-protocol (3.17.0.3)
launchy (2.5.2)
launchy (3.0.0)
addressable (~> 2.8)
childprocess (~> 5.0)
leaflet-rails (1.9.4)
actionpack (>= 4.2.0)
railties (>= 4.2.0)
letter_opener (1.9.0)
launchy (>= 2.2, < 3)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -444,7 +446,7 @@ GEM
method_source (~> 1.0)
psych (5.1.2)
stringio
public_suffix (5.0.4)
public_suffix (5.0.5)
puma (6.4.2)
nio4r (~> 2.0)
query_diet (0.7.1)
Expand Down Expand Up @@ -505,7 +507,7 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
raindrops (0.20.0)
rake (13.1.0)
rake (13.2.1)
rate_throttle_client (0.1.2)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
Expand Down Expand Up @@ -562,7 +564,7 @@ GEM
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rubocop (1.62.1)
rubocop (1.63.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -584,10 +586,13 @@ GEM
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.27.1)
rubocop-rspec (2.29.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.2)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
ruby-units (4.0.3)
ruby-vips (2.2.1)
Expand All @@ -606,7 +611,7 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
scout_apm (5.3.7)
scout_apm (5.3.8)
parser
searchkick (5.3.1)
activemodel (>= 6.1)
Expand Down Expand Up @@ -641,7 +646,7 @@ GEM
temple (0.10.3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terser (1.2.1)
terser (1.2.2)
execjs (>= 0.3.0, < 3)
thor (1.3.1)
thread_safe (0.3.6)
Expand Down
14 changes: 4 additions & 10 deletions app/assets/stylesheets/overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,14 @@ section {
box-shadow: 1px 3px 3px 1px darken($beige, 20%);
cursor: pointer;
transition:
0.3s transform cubic-bezier(0.155, 1.105, 0.295, 1.12),
0.3s box-shadow,
0.3s -webkit-transform cubic-bezier(0.155, 1.105, 0.295, 1.12);
0.1s transform cubic-bezier(0.155, 1.105, 0.295, 1.12),
0.1s box-shadow,
0.1s -webkit-transform cubic-bezier(0.155, 1.105, 0.295, 1.12);
}

.card:hover {
box-shadow:
0 10px 20px darken($beige, 30%),
0 4px 8px darken($beige, 40%);
transform: scale(1.1);
1px 3px 3px 1px darken($beige, 30%);
}
}

Expand Down Expand Up @@ -148,10 +146,6 @@ section {
color: $brown;
}
}

.card:hover {
background-color: $beige;
}
}

.img-cover,
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

class ApplicationController < ActionController::Base
protect_from_forgery
# Working from codespaces, we want to turn off validation
if Rails.env.development? && ENV['CODESPACE_NAME']
skip_before_action :verify_authenticity_token
end

include ApplicationHelper

Expand Down
5 changes: 5 additions & 0 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,10 @@ def admin_abilities(member)
can :destroy, PlantPart do |pp|
pp.harvests.empty?
end
# Admins can't delete themselves
cannot :destroy, Member
can :destroy, Member do |other_member|
other_member&.id != member.id
end
end
end
2 changes: 1 addition & 1 deletion app/models/photo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Photo < ApplicationRecord

has_many :photo_associations, dependent: :delete_all, inverse_of: :photo

# This doesn't work, ActiveRecord tries to use the polymoriphinc photographable
# This doesn't work, ActiveRecord tries to use the polymoriphic photographable
# relationship instead.
# has_many :crops, through: :photo_associations, counter_cache: true
def crops
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.col
%p
- if current_member.plantings.active.any?
= link_to member_path(current_member), class: 'btn btn-dark' do
= link_to member_path(current_member, anchor: "#content"), class: 'btn btn-dark' do
= planting_icon
Track my plantings
%p
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%nav.navbar.navbar-expand-lg.navbar-dark.bg-dark.justify-content-between
%nav.navbar.navbar-expand-lg.navbar-dark.bg-dark.justify-content-between.sticky-top
.nav
%a.navbar-brand{ href: root_path }
= image_tag("pear.png", class: 'logo', alt: 'Growstuff brand logo (drawing of a pear)')
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%html{ lang: "en", prefix: "og: https://ogp.me/ns#" }
= yield :scripts
= render "layouts/head"
%body
%body.d-flex.flex-column.vh-100
= query_diet_widget if Rails.env.development?
.sr-only= link_to t(".skip"), "#skipnav"
= render "layouts/header"
Expand All @@ -25,7 +25,7 @@
= render "shared/flash_messages", flash: flash
%main= yield
%footer.page-footer.font-small.bg-dark.pt-4= render "layouts/footer"
%footer.page-footer.font-small.bg-dark.pt-4.mt-auto= render "layouts/footer"
/
Javascripts
\==================================================
Expand Down
6 changes: 5 additions & 1 deletion app/views/members/_bio.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
%h2 All about #{member.login_name}
%p
%small
%a{href: "#content"}
Skip to main content
- if member.bio.blank?
- if can? :edit, member
= link_to "Add a bio to complete your profile.", edit_member_path(member)
= link_to "Add a bio to complete your profile.", edit_member_registration_path
- else
#{member.login_name} hasn't written a bio yet.
- else
Expand Down
46 changes: 0 additions & 46 deletions app/views/members/_full_summary.html.haml

This file was deleted.

60 changes: 24 additions & 36 deletions app/views/members/_stats.html.haml
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
.card-body
%h3 Activity
%ul.list-group.list-group-flush
%li.list-group-item
%h3
Stats
.label.d-md-none{type: "button", :data => { :bs_toggle => "collapse", :bs_target => "#stats-collapse"}}
%a
Show/Hide

.collapse.d-md-block#stats-collapse
%ul.list-group.list-group-flush
- if member.gardens.present?
= link_to localize_plural(member.gardens, Garden), member_gardens_path(member)
- else
0 gardens
%li.list-group-item
%li.list-group-item
= link_to localize_plural(member.gardens, Garden), member_gardens_path(member)
- if member.plantings.present?
= link_to localize_plural(member.plantings, Planting), member_plantings_path(member)
- else
0 plantings
%li.list-group-item
%li.list-group-item
= link_to localize_plural(member.plantings, Planting), member_plantings_path(member)
- if member.harvests.present?
= link_to localize_plural(member.harvests, Harvest), member_harvests_path(member)
- else
0 harvests
%li.list-group-item
%li.list-group-item
= link_to localize_plural(member.harvests, Harvest), member_harvests_path(member)
- if member.seeds.present?
= link_to localize_plural(member.seeds, Seed), member_seeds_path(member)
- else
0 seeds
%li.list-group-item
%li.list-group-item
= link_to localize_plural(member.seeds, Seed), member_seeds_path(member)
- if member.posts.present?
= link_to localize_plural(member.posts, Post), member_posts_path(member)
- else
0 posts
%li.list-group-item
%li.list-group-item
= link_to localize_plural(member.posts, Post), member_posts_path(member)
- if member.activities.present?
= link_to localize_plural(member.plantings, Activity), member_activities_path(member)
- else
0 activities

%li.list-group-item
%li.list-group-item
= link_to localize_plural(member.plantings, Activity), member_activities_path(member)
- if member.followed.present?
= link_to localize_plural(member.followed, Follow), member_follows_path(member)
- else
0 following

%li.list-group-item
%li.list-group-item
= link_to localize_plural(member.followed, Follow), member_follows_path(member)
- if member.followers.present?
= link_to pluralize(member.followers.size, "follower"), member_followers_path(member)
- else
0 followers
%li.list-group-item
= link_to pluralize(member.followers.size, "follower"), member_followers_path(member)
Loading

0 comments on commit 3027cb1

Please sign in to comment.