Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for communities and subcommunities (#1235)
* First pass at allowing users to set the community and subcommunity of a dataset. * Minor tweaks * Adjust tests to pass the new fields * Added a few tests --------- Co-authored-by: carolyncole <1599081+carolyncole@users.noreply.github.com>
- Loading branch information
1 parent
3955d42
commit 6bab432
Showing
11 changed files
with
179 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,46 @@ | ||
<div class="section-title"> | ||
<% if @work.group.communities.count == 1 %> | ||
<!-- Special case for PPPL that has a single community --> | ||
<details> | ||
<summary>Community</summary> | ||
The community for this dataset. | ||
</details> | ||
<select id="communities" name="communities[]" class="form-select" > | ||
<option selected><%= @work.group.communities.first %></option> | ||
</select> | ||
<% else %> | ||
<details> | ||
<summary>Communities</summary> | ||
Select one or more communities for this dataset. | ||
</details> | ||
<select id="communities" name="communities[]" class="form-select" multiple > | ||
<% @work.group.communities.each do |community| %> | ||
<% if @work.resource.communities.include?(community) %> | ||
<option selected><%= community %></option> | ||
<% else %> | ||
<option><%= community %></option> | ||
<% end %> | ||
<% end %> | ||
</select> | ||
<% end %> | ||
<% if @work.group.subcommunities.count > 0 %> | ||
<br/> | ||
<!-- Display subcommunities only for those groups that have them. --> | ||
<details> | ||
<summary>Subcommunities</summary> | ||
Select one or more subcommunities for this dataset. | ||
</details> | ||
|
||
<select id="subcommunities" name="subcommunities[]" class="form-select" multiple > | ||
<% @work.group.subcommunities.each do |subcommunity| %> | ||
<% if @work.resource.subcommunities.include?(subcommunity) %> | ||
<option selected><%= subcommunity %></option> | ||
<% else %> | ||
<option><%= subcommunity %></option> | ||
<% end %> | ||
<% end %> | ||
</select> | ||
<% end %> | ||
</div> | ||
|
This file contains 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 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 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 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 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 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