Skip to content

Commit

Permalink
view and template fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Aug 28, 2024
1 parent 580f4c5 commit 90e5dd9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions coldfront/core/allocation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ def cost(self):
return None
except TypeError:
return None
except ObjectDoesNotExist:
return None
size_attr_name = self._return_size_attr_name()
if not size_attr_name:
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Resource{{ allocation.resources.all|pluralize }} in allocation:</th>
<th scope="row" class="text-nowrap">Allocated Resource{{ allocation.resources.all|pluralize }}:</th>
<td>
{% if allocation.get_resources_as_list %}
{% for resource in allocation.get_resources_as_list %}
Expand Down Expand Up @@ -140,7 +140,7 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
</tr>
{% endif %}
<tr>
<th scope="row" class="text-nowrap">Total Users in Your Bill:</th>
<th scope="row" class="text-nowrap">Total Users with Usage:</th>
<td>{{ allocation_users.count }}</td>
</tr>
<tr>
Expand Down Expand Up @@ -555,10 +555,11 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Users in Al
{% if cost %}
<td>{{ cost }}</td>
{% endif %}
{% else %}
<td>{{ user.effectvusage }}</td>
<td>{{ user.normshares }}</td>
<td>{{ user.fairshare }}</td>
{% endif %}
{% if 'Cluster' in allocation.get_parent_resource.resource_type.name %}
<td>{{ user.effectvusage }}</td>
<td>{{ user.normshares }}</td>
<td>{{ user.fairshare }}</td>
{% endif %}
</tr>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion coldfront/core/resource/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ResourceAdmin(SimpleHistoryAdmin):
# readonly_fields_change = ('resource_type', )
fields_change = ('resource_type', 'parent_resource', 'is_allocatable', 'name', 'description', 'is_available',
'is_public', 'requires_payment', 'allowed_groups', 'allowed_users', 'linked_resources')
list_display = ('pk', 'name', 'description', 'parent_resource', 'is_allocatable', 'resource_type_name',
list_display = ('pk', 'name', 'description', 'parent_resource', 'is_allocatable', 'requires_payment', 'resource_type_name',
'is_available', 'is_public', 'created', 'modified', )
search_fields = ('name', 'description', 'resource_type__name')
list_filter = ('resource_type__name', 'is_allocatable', 'is_available', 'is_public', 'requires_payment' )
Expand Down

0 comments on commit 90e5dd9

Please sign in to comment.