Skip to content

Commit

Permalink
fix new columns in pending and finished requests tables
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Horak <[email protected]>
  • Loading branch information
dahorak committed Feb 9, 2024
1 parent aa4c99b commit 7c2241d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
20 changes: 20 additions & 0 deletions rqueue/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ def add_to_data_json(self, json_to_add=None, **kwargs):

self.save()

def get_data_value(self, key):
data = dict(json_continuously_loader(self.data))
return data.get(key, "")

@property
def name(self):
return self.get_data_value("name")

@property
def signoff(self):
return self.get_data_value("signoff")

@property
def label(self):
return self.get_data_value("label")

@property
def link(self):
return self.get_data_value("link")

class Meta:
# Here you can put more descriptive to display in Admin
verbose_name_plural = "Requests in Queue"
14 changes: 7 additions & 7 deletions templates/includes/finished_requests_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@
<!-- Row Description End -->
<!-- Row Label Start -->
<td>
{{ finishedqueue.data.name }}
{{ finishedqueue.data.label }}
<!--{{ finishedqueue.data.labels_string }}-->
{{ finishedqueue.name }}
{{ finishedqueue.label }}
<!--{{ finishedqueue.labels_string }}-->
</td>
<!-- Row Label End -->
<!-- Row Signoff Start -->
<td>
{% if finishedqueue.data.link and finishedqueue.data.link != "None" %}
<a href="{{ finishedqueue.data.link }}">
{{ finishedqueue.data.signoff }}
{% if finishedqueue.link and finishedqueue.link != "None" %}
<a href="{{ finishedqueue.link }}">
{{ finishedqueue.signoff }}
</a>
{% else %}
{{ finishedqueue.data.signoff }}
{{ finishedqueue.signoff }}
{% endif %}
</td>
<!-- Row Signoff End -->
Expand Down
14 changes: 7 additions & 7 deletions templates/includes/pending_requests_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,19 @@
<!-- Row Description End -->
<!-- Row Label Start -->
<td>
{{ rqueue.data.name }}
{{ rqueue.data.label }}
<!--{{ rqueue.data.labels_string }}-->
{{ rqueue.name }}
{{ rqueue.label }}
<!--{{ rqueue.labels_string }}-->
</td>
<!-- Row Label End -->
<!-- Row Signoff Start -->
<td>
{% if rqueue.data.link and rqueue.data.link != "None" %}
<a href="{{ rqueue.data.link }}">
{{ rqueue.data.signoff }}
{% if rqueue.link and rqueue.link != "None" %}
<a href="{{ rqueue.link }}">
{{ rqueue.signoff }}
</a>
{% else %}
{{ rqueue.data.signoff }}
{{ rqueue.signoff }}
{% endif %}
</td>
<!-- Row Signoff End -->
Expand Down

0 comments on commit 7c2241d

Please sign in to comment.