Commit Graph
48 Commits
Author SHA1 Message Date
Brenda WallaceandDaniel O'Connor 8474bdd416 remove newsletter (#4974)
* Remove unused bluecloth gem

Last released in 2011. It was only required, never called; kramdown
renders the markdown.

* Add specs for Tilt markdown rendering and posts markdown partial

* Remove rails_12factor gem

Last released in 2014. Rails 5+ does this via RAILS_SERVE_STATIC_FILES
and RAILS_LOG_TO_STDOUT, which production.rb already reads.

* Remove memcachier gem from Gemfile and Gemfile.lock

* Remove unused webrat gem

Last released in 2011. Nothing requires it; the specs use Rails'
assert_select and Capybara matchers. Only generator comments mention it.

* Remove crowdin-cli gem

Last released in 2018. Crowdin now ships its own standalone CLI, which
reads crowdin.yml and doesn't need the gem. Also drops the dependencies
only it used (rest-client, gli, crowdin-api and friends).

* Removes the crowdin-cli gem (last released 2018), the dependencies only
it needed, and crowdin.yml. Crowdin was never set up: the config still
has a placeholder project ID and nothing else in the repo mentions it.

Assisted by Claude

* Remove newsletter functionality and associated views and tests

* Remove newsletter functionality and related code across the application

* keep the column

* Remove stale test step

* add back newsletter

* Add migration to update newsletter column comment in members table

---------

Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2026-10-26 11:48:36 +10:30
Brenda Wallace 7a9fa0de11 Add job-templates-table class to job templates tables for styling consistency 2026-10-24 18:40:10 +13:00
Brenda Wallace c830624a75 Crop job admin 2026-10-24 18:40:10 +13:00
Brenda Wallace f2e437dedc Add creator reference to crop job templates migration 2026-10-24 18:40:10 +13:00
Brenda Wallace bd4a55331e admin screen for crop job templates 2026-10-24 18:40:10 +13:00
Brenda Wallace 85b5ff9ecd Add feature flags, with job ideas as the first
Admins switch features on and off at /admin/features, kept in Flipper.
Job ideas (the page, the banners and the overlay) only show while its
flag is on. Features are off until switched on.

Closes #5050
2026-10-24 18:01:56 +13:00
d491df87fc Filter deleted members by default and enable bulk ban on admin members (#5060)
* Filter deleted members by default and enable bulk ban on admin members

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Drop instagram

* Default sort

* Update specs

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-10-24 14:30:50 +10:30
Brenda Wallace 6332f26c58 Merge pull request #4994 from Growstuff/crop-job-templates-admin
Admin for crop job templates, a tidier crop wrangling page, and crop and template seeds
2026-10-23 13:26:33 +10:30
39e65fd848 Remove CMS - use haml pages instead (#4899)
* Add support and terms of service pages with corresponding routes

- Created a new support page with frequently asked questions.
- Added a terms of service page outlining user agreements and policies.
- Removed old support index and CMS initializer files.
- Updated routes to include new policy and support paths.
- Implemented tests for new pages and footer links.
- Adjusted database migration for CMS content compatibility.

* Remove custom JavaScript file for the admin area

* Add kramdown gem for Markdown support in Haml

* Fix various typos and link formatting issues

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* remove reference to paid account

* Remove reference to paid accounts from support page

* Remove references to paid and permanent accounts from Terms of Service

* removing references to paid accounts

* Update contact email link format in TOS

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add new pages and routes for About, Policies, and Copyright; update existing pages

* Fix typos and improve clarity in community guidelines, copyright policy, data use policy, privacy policy, support page, and terms of service

* Drop stale expectation

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2026-10-12 03:05:12 +10:30
Brenda WallaceandClaude Sonnet 5 b15b92c08e Replace the remaining Bootstrap 4 components with Bootstrap 5 equivalents
form-inline -> flex utilities, embed-responsive -> ratio ratio-16x9,
input-group-prepend wrapper removed (Bootstrap 5 puts the addon directly in
the group), and media/media-body -> d-flex/flex-grow-1.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:05:19 +12:00
Brenda WallaceandClaude Sonnet 5 742599fea6 Rename Bootstrap 3/4 grid, button and form-group classes
col-xs-N -> col-N, col-md-offset-N -> offset-md-N, row-fluid -> row,
btn-block -> w-100, btn-xs -> btn-sm, form-group -> mb-3 (Bootstrap 5 dropped
form-group), and btn-default (Bootstrap 3) -> btn-outline-secondary. The three
helpers that combined btn-default with btn-secondary keep just btn-secondary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:01:45 +12:00
Brenda WallaceandClaude Sonnet 5 be5ed5fca5 Rename Bootstrap 4 utility classes to their Bootstrap 5 names
text-left/right -> text-start/end, float-left/right -> float-start/end,
ml-/mr-/pl-/pr- -> ms-/me-/ps-/pe-, border-left/right -> border-start/end,
dropdown-menu-left/right -> dropdown-menu-start/end, font-weight-* -> fw-*,
font-italic -> fst-italic and sr-only -> visually-hidden. Bootstrap 5 dropped
text-justify, so the site keeps a one-line rule for it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:01:00 +12:00
google-labs-jules[bot]andDaniel O'Connor 460daf36f9 Add revert functionality to admin crops page (#4346)
* feat(admin): add revert functionality to crops page

This change adds a "Revert" button to the admin crops page, allowing crop wranglers to revert changes to a previous version.

It introduces a new `Admin::VersionsController` with a `revert` action that uses `paper_trail`'s `reify` method to restore a previous version of a `Crop` object.

The view is updated to include a "Revert" button, which is guarded by a `can?(:wrangle, Crop)` check to ensure only authorized users can see it.

The controller also includes an authorization check to prevent unauthorized users from accessing the revert action directly.

A feature spec is added to test the new functionality, including the authorization logic.

* Consistent UX

* Specs

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-11-30 15:05:13 +10:30
google-labs-jules[bot]andDaniel O'Connor 13a8276313 Add version tracking to crops model (#4343)
* feat: Add version tracking to Crop model

This commit introduces version tracking for the Crop model using the PaperTrail gem.

Key changes include:
- Integrating `has_paper_trail` into the `Crop` model.
- Adding a "History" section to the crop show page to display a timeline of changes for that specific crop.
- Creating a new admin page for users with the "crop_wrangler" role to view a log of all recent crop edits, creations, and deletions.
- Fixing several N+1 query performance issues by eager-loading associated `Member` records in both the `CropsController` and the new `Admin::CropsController`.
- Refactoring view logic into a shared partial to reduce code duplication.

* Add papertrail

* Admin UI

* Add papertrail DB

* Add papertrail DB

* Rearrange

* Fix permissions

* Fix permissions

* Fix UI

* Fix UI

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-11-30 14:47:46 +10:30
google-labs-jules[bot] 449ab1f6c0 Add ability to create companion plantings
This change adds the ability for crop wranglers to create and manage companion plantings for crops.

- Adds a `source_url` to the `CropCompanion` model to store an optional reference URL.
- Restricts the management of companion plantings to users with the `crop_wrangler` role.
- Creates a new admin interface for managing companion plantings for a specific crop.
- Updates the crop show page to display companions from both the crop and its parent crop.
2025-09-21 00:49:11 +00:00
Daniel O'ConnorandBrenda Wallace b77df88df9 Issues/1475: Ensure we have pagination (#3193)
* Paginate, 100 at a time

* Limited i18n

* Paginate roles

* Pagination

* Pagination

* i18n and pagination

* Paginate alternate names

* Silence code climate

* Rewrite coverage as a feature

* Remove coverage in favour of crops/scientific_name_spec

* Add missing admin link

* Rewrite coverage as feature

* Rewrite coverage

---------

Co-authored-by: Brenda Wallace <brenda@wallace.net.nz>
2024-01-21 14:19:36 +10:30
Brenda Wallace 35c9b70bc9 Remove email from display in admin/members 2019-10-19 10:23:39 +13:00
Brenda Wallace 3422a0d899 Administer member's roles 2019-10-06 14:19:39 +13:00
Brenda Wallace e3f32d8bb4 Updated specs 2019-08-20 15:09:39 +00:00
Brenda Wallace ed4aaa1c9c Tidy up admin landing page 2019-08-20 15:09:39 +00:00
Brenda Wallace b3520a1b3f Search for members in admin/members#index 2019-08-20 15:09:39 +00:00
Brenda Wallace 6144a7c065 tidy display of discard member on admin page 2019-07-21 17:26:45 +12:00
Brenda Wallace 91897273be Merge branch 'dev' into ban-hammer 2019-07-16 20:56:59 +12:00
Brenda Wallace b2537638ed Move member banning to admin/members controller 2019-07-16 18:56:49 +12:00
Brenda Wallace 2162c11280 Couple breadcrumbs tidied 2019-07-16 03:15:04 +00:00
Brenda Wallace dccbf440cb Breadcrumbs 2019-05-18 23:18:27 +12:00
Brenda Wallace b446e44ac0 Moved garden types to admin menu 2019-03-26 21:02:48 +13:00
Brenda Wallace f9d4e1d6ae Ancestry of food. Seeds -> Planting -> Seeds -> Planting (#1550)
* Add seed ancestry, and seeds.finished_at
* Plantings and seeds produce each other
* Permissions for seeds actions
* View update, for seed actions, and planting ancestry
* Routes for seeds
* Scopes for harvests
* Spec updates for seeds
* Removed in-line style
* Add seed ancestry, and seeds.finished_at
* Plantings and seeds produce each other
* Permissions for seeds actions
* View update, for seed actions, and planting ancestry
* Routes for seeds
* Scopes for harvests
* Spec updates for seeds
* Moved finishable to a concern
* Seeds.finished_at
* rubocop fixes
* Made seeds sown migration the most recent
* Specs for home page
* Only show current seeds on home page
* Seeds appear for logged in or not
* Buttons to mark seeds finished
* JS for marking seeds finished
* Some actions only appear if seed or planting is active
* Fixed up display of home page
* Fixed typo in admin members#index
* Tidying up actions on all the things
* Harvest description in #index
* Truncate garden description if long
* Updated link label in view spec
* Show planted_from always, becuase it might be a parent seed
* find correct link in spec adding photos to garden
* fixed spec finding link to edit garden
* Better harvest description truncation
* Helping spec find the edit button
* specs for the home page
* Re-instate crops js, but in the correct file now
* Fixed link to garden in actions
* Tweaking mobile view
2018-03-12 08:39:32 +13:00
Brenda Wallace 42de726405 Removing shop, products, accounts, orders 2018-02-09 10:53:05 +13:00
Brenda Wallace 99828c7c01 Updated spec for new admin#index 2017-12-17 17:54:13 +13:00
Brenda Wallace 233a30a045 Haml code style fix up 2017-12-17 17:49:05 +13:00
Brenda Wallace 8a446ecbfc Member admin 2017-12-17 12:45:19 +13:00
Brenda Wallace 406b2dbf04 Make admin index a bit nicer 2017-12-17 12:06:03 +13:00
Brenda Wallace fb012c073e leaves a record of orders and payments intact when members deleted 2017-06-02 22:34:19 +12:00
Brenda Wallace 9560da90ab Add Scientific names to the menu 2017-05-29 16:17:43 +12:00
Brenda Wallace cf9e5a6652 Adding alternate names to admin menu 2017-02-11 19:45:53 +13:00
Brenda Wallace 65a8bde467 Haml clean up for admin views 2017-02-04 12:00:42 +13:00
Cjay Billones bb88041fef [Refactoring] Replace .count and .length with .size for collections
Improved program efficiency (in querying in particular) by replacing .count and .length with .size for collections.

Fix error in refactoring

Reverted some .size into .count
2015-06-25 12:09:03 +08:00
Mackenzie Morgan c3429cc0f3 adding admin access test for cms, and changing the cms admin path, and adding a link for it to the admin page, and updating the navbar so i can actually target the sign-in link in the test. also removing sample fixture gencode from cms installation 2015-02-09 00:05:02 -05:00
Skud d55d2c6409 Ongoing coverage improvements 2014-08-30 17:09:47 +10:00
Skud 117fd23bea add btn-default to all btn-xs 2014-07-22 12:06:28 +10:00
Skud 0294daf423 s/btn-mini/btn-xs/ for bootstrap3 2014-07-22 12:01:49 +10:00
Skud ab588bd21b add referral code to order admin table 2013-09-16 10:39:12 +10:00
Skud faea1904c2 Added referral code search to admin forms 2013-09-13 13:47:46 +10:00
Skud 16f4e153f2 Made admin/newsletter page with list of subscribers 2013-08-27 21:49:54 +10:00
Skud 6c8f2b477f minor tweakage to admin/order/search 2013-06-04 21:15:29 +10:00
Skud cbca8c19a5 added admin controller and index view 2013-05-31 10:23:06 +10:00
Skud 7a1eaeffee added admin controller and index view 2013-05-29 14:37:42 +10:00