Skip to content

Commit 7e12b2b

Browse files
committed
printing project consortia to mange projects page
1 parent 3af7d36 commit 7e12b2b

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

ingest/templates/ingest/manage_projects.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1>Manage Projects</h1>
1818
<tr>
1919
<th>Name</th>
2020
<th>Funded By</th>
21-
<th>Is BICCN?</th>
21+
<th>Consortia Affiliation</th>
2222
<th>Personnel</th>
2323
<th>Submissions</th>
2424
</tr>
@@ -28,9 +28,8 @@ <h1>Manage Projects</h1>
2828
<tr>
2929
<td>{{ project.name }}</td>
3030
<td>{{ project.funded_by }}</td>
31-
{% for c in consortia %}
32-
<td>{{ c.short_name }}</td>
33-
{% endfor %}
31+
<td>{{ project.short_names }}</td>
32+
3433
<td><a href="{% url 'ingest:view_project_people' project.id %}">View Personnel</td>
3534
<td><a href="{% url 'ingest:view_project_collections' project.id %}">View Submissions</td>
3635
</tr>
Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
{% extends 'ingest/base.html' %}
2-
{% block content %}
1+
{% extends 'ingest/wide.html' %}
32
{% load bootstrap4 %}
3+
{% block wide %}
4+
45
<script src="/static/ingest/createproject.js"></script>
56
<script src="https://cdn.jsdelivr.net/npm/js-cookie@rc/dist/js.cookie.min.js"></script>
67
{% if pi %}
@@ -10,27 +11,41 @@
1011
{% endif %}
1112
<br>
1213
<h1>Create a new project</h1>
14+
<hr>
15+
16+
<br>
17+
<div style="min-width:600px">
1318

1419
<form id="CreateNewProject">
1520
{% csrf_token %}
21+
<label for="name">Project Name:</label><span style="color:red; margin-right:10px;">*</span>
22+
<input type="text" id="name" name="name" placeholder="Name of project">
1623

17-
<label for="name">Project Name:</label>
18-
<input type="text" id="name" name="name">
24+
<label for="funded_by" style="margin-top:15px;margin-left:55px;margin-right:10px;">Funded By:</label>
25+
<input type="text" id="funded_by" name="funded_by" placeholder="Grant number">
1926

20-
<label for="consortia">Consortia Affiliation:</label>
21-
<p><strong>Select your project's constorium affiliation. You may control-click (Windows) or command-click (Mac) to select more than one.</strong></p>
22-
<select multiple size={{consortia.count}}>
27+
<br>
28+
<label for="consortia" style="margin-top:15px;">Consortia Affiliation:</label>
29+
<p>Select your project's affiliation(s). Choose all that apply.</p>
30+
<div style="margin-left: 50px;">
31+
<p style="font-style:italic; margin-top: 20px;"> To choose multiple: Windows users: control-click | Mac users: command-click</p>
32+
<select multiple size={{consortia.count}} style="min-width: 540px;">
2333
{% for c in consortia %}
2434
<option value={{c.id}}>{{c.long_name}} ({{c.short_name}})</option>
2535
{% endfor %}
2636
</select>
27-
<label for="funded_by">Funded By:</label>
28-
<input type="text" id="funded_by" name="funded_by">
37+
</div>
2938
</form>
30-
<button class="btn btn-primary" onclick="create_new_project();">Submit New Project</button>
31-
<hr>
39+
<div>
3240

41+
<br>
42+
43+
<p style="margin-top:15px;"><b>Required fields are marked with an <span style="color:red;">*</span>.</b></p>
44+
45+
<br>
46+
<button class="btn btn-primary" onclick="create_new_project();">Submit New Project</button>
3347
<a href="{% url 'ingest:index' %}">
3448
<button class="cancel btn btn btn-primary" value="ignore" formnovalidate="">Cancel</button>
3549
</a>
50+
3651
{% endblock %}

ingest/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def modify_user(request, pk):
119119
else:
120120
pi = False
121121
person = People.objects.get(auth_user_id_id = pk)
122+
122123
all_project_people = ProjectPeople.objects.filter(people_id_id=person.id).all()
123124
for project_person in all_project_people:
124125
try:
@@ -204,7 +205,12 @@ def manageProjects(request):
204205
project = Project.objects.get(id=project_id)
205206
allprojects.append(project)
206207

207-
208+
project_consortia = ProjectConsortium.objects.filter(project_id=project.id).all()
209+
project.short_names = []
210+
for c in project_consortia:
211+
short_name = Consortium.objects.get(id=c.id).short_name
212+
project.short_names.append(short_name)
213+
project.short_names = ', '.join(project.short_names)
208214
return render(request, 'ingest/manage_projects.html', {'allprojects':allprojects, 'pi':pi})
209215

210216
# this functions allows pi to see all the collections

0 commit comments

Comments
 (0)