Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions ifcbdb/secure/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,21 @@ def dt_datasets(request):

data = []
for dataset in datasets:
item = dataset.teamdataset_set.first() if is_teams_enabled else None
team_name = item.team.name if item else ""
row = {
"dataset_id": dataset.id,
"name": dataset.name,
"title": dataset.title,
"is_active": dataset.is_active,
"team": "",
}

data.append([dataset.name, dataset.title, dataset.is_active, team_name, dataset.id])
if is_teams_enabled:
item = dataset.teamdataset_set.first()
row["team"] = item.team.name if item else ""

return JsonResponse({
"data": data
})
data.append(row)

return JsonResponse({"data": data})

@waffle_switch('Teams')
def dt_teams(request):
Expand Down
2 changes: 1 addition & 1 deletion ifcbdb/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<div class="col-sm-12">
<ul class="nav justify-content-center">
<li class="nav-item">
<span class="px-2">Version 5.2 - July 2026</span>
<span class="px-2">Version 5.2.1 - July 2026</span>
</li>
<li class="nav-item">
<a class="px-2" href="{% url 'about_page' %}">About</a>
Expand Down
56 changes: 28 additions & 28 deletions ifcbdb/templates/secure/dataset-management.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,7 @@
<hr class="my-2">
<div class="row py-2 px-3">
<div class="col">
<table id="datasets" class="table table-sm table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Title</th>
<th>Active?</th>
{% if is_teams_enabled %}<th>Team</th>{% endif %}
<th></th>
</tr>
</thead>
</table>
<table id="datasets" class="table table-sm table-striped table-bordered" style="width:100%"></table>
</div>
</div>

Expand All @@ -49,24 +39,34 @@
url: "{% url 'secure:datasets_dt' %}"
},
columns: [
{}, // Name
{}, // Description
{
targets: 2,
render: function(data, type, row) {
return data ? "Yes" : "No";
}
}, // Is Active
{% if is_teams_enabled %}{}, // Team{% endif %}
{ // Edit and datasets
targets: -1,
render: function ( data, type, row ) {
return (
"<a class='btn btn-sm btn-mdb-color mr-2' href='/secure/edit-dataset/" + data + "'>" +
"<i class='fas fa-edit magic mr-1'></i>Manage" +
"</a>"
);
}
title: "Name",
data: "name"
},
{
title: "Title",
data: "title"
},
{
title: "Active?",
data: "is_active",
render: (data) => data ? "Yes" : "No"
},
{
title: "Team",
data: "team",
visible: "{{ is_teams_enabled }}".toLowerCase() === "true",
},
{
title: "",
data: "dataset_id",
orderable: false,
render: (data) => ((
"<a class='btn btn-sm btn-mdb-color mr-2' href='/secure/edit-dataset/" + data + "'>" +
"<i class='fas fa-edit magic mr-1'></i>Manage" +
"</a>"
))

}
]
});
Expand Down