Skip to content

Conversation

@fiveeightsix
Copy link
Collaborator

Adds a "Log Action" link to the "Actions" widget on the gang/list screen. When clicked, navigates to the existing "Log action" form, with the "Related gang" field set. Ensures return URLs are set correctly.

Closes #994.

Copilot AI review requested due to automatic review settings January 6, 2026 21:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a "Log Action" link to the Actions widget on the gang/list detail screen, allowing users to quickly log campaign actions directly from a gang's page with the gang pre-selected. The changes improve navigation and user experience when managing campaign actions.

  • Adds gang pre-population logic to the campaign action form view
  • Refactors URL parameter handling to use the querystring template tag consistently
  • Moves campaign action tests to a dedicated test file for better organization

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gyrinx/core/views/campaign.py Adds gang parameter extraction and form initialization; updates documentation for return_url context variable
gyrinx/core/tests/test_campaign_actions.py New dedicated test file for campaign action tests; includes new test for gang pre-population functionality
gyrinx/core/tests/test_campaign.py Removes campaign action filtering test (moved to dedicated file)
gyrinx/core/templates/core/includes/list_campaign_actions.html Adds "Log Action" link with gang and return_url parameters; updates "View all actions" link to use querystring tag
gyrinx/core/templates/core/includes/campaign_action_item.html Updates "Add outcome" link to use querystring tag for consistent URL parameter handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Remove extraneous whitespace

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 6, 2026 22:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

for i in range(55):
CampaignAction.objects.create(
campaign=campaign,
user=user1,
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CampaignAction objects created in this loop are missing the owner field that is consistently set in the previous action creations (lines 53, 65, 77). This inconsistency could cause issues if the owner field is required or expected in other parts of the code.

Suggested change
user=user1,
user=user1,
owner=user1,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log campaign actions from gang page

2 participants