-
Notifications
You must be signed in to change notification settings - Fork 39
Allow a submission to have multiple projects associated #4897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
frjo
wants to merge
6
commits into
main
Choose a base branch
from
feature/multiprojects
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+611
−293
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d7ba82a
First stab at alloing a submission to have more than one project.
frjo 40fa14d
Make project tab a dropdown when there are multiple projects.
frjo 9625c2e
Fix links in project all table.
frjo dd09804
Fix issues in new report feature after rebase. Fix issue in invoices.
frjo cc928bc
Implement PROJECTS_ALLOW_MULTIPLE setting, default to false.
frjo 0fe14be
Adding tests.
frjo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
hypha/apply/funds/templates/funds/includes/projects_tab.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| {% load i18n heroicons project_tags %} | ||
| {% comment %} | ||
| Renders the "Project(s)" tab inside a submission/project tablist. | ||
|
|
||
| Params: | ||
| submission – the ApplicationSubmission | ||
| user – the current user (for access filtering) | ||
| current_project – the project being viewed, if any (for active item highlight) | ||
| active – whether this tab is the active one | ||
| {% endcomment %} | ||
| {% accessible_projects submission user as projects %} | ||
| {% if projects %} | ||
| {% if projects|length == 1 %} | ||
| <a | ||
| class="tab {% if active %}tab-active{% else %}[--color-base-content:var(--color-neutral-content)]{% endif %}" | ||
| href="{{ projects.0.get_absolute_url }}" | ||
| > | ||
| {% trans "Project" %} | ||
| </a> | ||
| {% else %} | ||
| <div class="relative tab {% if active %}tab-active{% endif %}" x-data="{ open: false }"> | ||
| <button | ||
| type="button" | ||
| class="flex gap-1 items-center cursor-pointer {% if not active %}text-neutral-content/50 hover:text-neutral-content{% endif %}" | ||
| @click="open = ! open" | ||
| @click.away="open = false" | ||
| @keydown.escape="open = false" | ||
| :aria-expanded="open" | ||
| > | ||
| {% blocktrans count counter=projects|length %}Project{% plural %}Projects ({{ counter }}){% endblocktrans %} | ||
| {% heroicon_micro "chevron-down" aria_hidden="true" size=16 class="inline-block size-4" %} | ||
| </button> | ||
| <ul | ||
| x-show="open" | ||
| x-cloak | ||
| x-transition.origin.top | ||
| role="menu" | ||
| class="absolute top-full z-20 mt-1 min-w-max border shadow-lg start-0 menu bg-base-100 rounded-box border-base-300 text-base-content" | ||
| > | ||
| {% for project in projects %} | ||
| <li> | ||
| <a | ||
| href="{{ project.get_absolute_url }}" | ||
| {% if current_project and project.pk == current_project.pk %}class="menu-active"{% endif %} | ||
| > | ||
| {{ project.title }} | ||
| </a> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| </div> | ||
| {% endif %} | ||
| {% endif %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this format of kinda docstringing a template! super useful when trying to track down what the variables used are & where they come from