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
9 changes: 9 additions & 0 deletions .github/workflows/hypha-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ jobs:
- name: Run pre-commit
uses: pre-commit/action@v3.0.1

login:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

django-checks:
runs-on: ubuntu-latest
timeout-minutes: 5
Expand Down
6 changes: 6 additions & 0 deletions hypha/apply/funds/admin_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def lookups(self, request, model_admin):
return (
("open", _("Open")),
("closed", _("Closed")),
("new", _("Not started")),
("unpublished", _("Unpublished")),
)

def queryset(self, request, queryset):
Expand All @@ -97,6 +99,10 @@ def queryset(self, request, queryset):
return queryset.open()
elif value == "closed":
return queryset.closed()
elif value == "new":
return queryset.new()
elif value == "unpublished":
return queryset.not_live()
return queryset


Expand Down
5 changes: 5 additions & 0 deletions hypha/apply/funds/models/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ def serve(self, request):


class RoundBaseManager(PageQuerySet):
def new(self):
rounds = self.live().public().specific()
rounds = rounds.filter(start_date__gt=date.today())
return rounds

def open(self):
rounds = self.live().public().specific()
rounds = rounds.filter(
Expand Down
12 changes: 10 additions & 2 deletions hypha/apply/funds/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ def __init__(self, *args, **kwargs):
class Meta:
fields = ("title", "fund", "lead", "start_date", "end_date", "deterrmined")
attrs = {"class": "table"}
template_name = "funds/tables/table.html"

def render_lead(self, value):
return format_html("<span>{}</span>", value)
Expand Down Expand Up @@ -455,7 +456,12 @@ def __init__(self, *args, **kwargs):
super().__init__(
self,
*args,
choices=[("open", "Open"), ("closed", "Closed"), ("new", "Not Started")],
choices=[
("open", _("Open")),
("closed", _("Closed")),
("new", _("Not Started")),
("unpublished", _("Unpublished")),
],
**kwargs,
)

Expand All @@ -468,6 +474,8 @@ def filter(self, qs, value):
return qs.closed()
if value == "new":
return qs.new()
if value == "unpublished":
return qs.not_live()

return qs.open()

Expand All @@ -476,7 +484,7 @@ class RoundsFilter(filters.FilterSet):
fund = ModelMultipleChoiceFilter(queryset=get_used_funds, label=_("Funds"))
lead = ModelMultipleChoiceFilter(queryset=get_round_leads, label=_("Leads"))
active = ActiveRoundFilter(label=_("Active"))
round_state = OpenRoundFilter(label=_("Open"))
round_state = OpenRoundFilter(label=_("State"))


class ReviewerLeaderboardFilterForm(forms.ModelForm):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h2 class="section-header">{{ heading }}</h2>
{% if filter.form %}
<nav class="flex flex-wrap gap-2 items-center menu-filters">
{% if not field|is_datefilter %}
<c-dropdown-menu title=field.label heading=field|get_dropdown_heading enable_search=True position="right">
<c-dropdown-menu title=field.label heading="{{ field|get_dropdown_heading }}" enable_search=True position="right">
<ul class="flex overflow-auto flex-col max-h-80 text-gray-700 divide-y" data-filter-list>
{% for value, label in filter.form|get_field_choices:field_name %}
{% get_item_value filter.form field_name as selected_value %}
Expand All @@ -103,7 +103,7 @@ <h2 class="section-header">{{ heading }}</h2>
</ul>
</c-dropdown-menu>
{% else %}
<c-dropdown-menu title=field.label heading=field|get_dropdown_heading position="right">
<c-dropdown-menu title=field.label heading="{{ field|get_dropdown_heading }}" position="right">
<calendar-range class="mx-auto cally" onchange="updateURL(this.value, '{{field_name}}')" data-field-name='{{field_name}}'>
{% heroicon_micro "chevron-left" aria_label="Previous" slot="previous" aria_hidden=true size=18 %}
{% heroicon_micro "chevron-right" aria_label="Next" slot="next" aria_hidden=true size=18 %}
Expand Down
137 changes: 57 additions & 80 deletions hypha/apply/funds/templates/submissions/submenu/rounds.html
Original file line number Diff line number Diff line change
@@ -1,105 +1,82 @@
{% load i18n %}
{% load querystrings heroicons %}

<div class='flex flex-col'>

<div class="flex flex-col">
{% if open_rounds or closed_rounds %}

{% if selected_rounds %}
<a
href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" "round" %}"
hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" "round" %}"
hx-push-url="true"
class="flex px-3 py-2 text-base-content/80 border-b items-center hover:bg-base-200 focus:bg-base-200{% if s.selected %}bg-base-200{% endif %}">
class="flex items-center py-2 px-3 border-b text-base-content/80 hover:bg-base-200 focus:bg-base-200">
{% trans "All Rounds" %}
</a>
{% endif %}

<div
role="tablist"
<ul class="overflow-auto max-h-80 divide-y" data-filter-list>

{% if open_rounds %}
x-data="{tab: 'open_rounds'}"
{% else %}
x-data="{tab: 'closed_rounds'}"
{# Section heading — hidden during search because data-filter-item-text is empty #}
<li class="py-1 px-3 text-xs font-semibold tracking-wide uppercase text-base-content/50 bg-base-200" aria-hidden="true">
<span data-filter-item-text></span>
{% trans "Open" %}
</li>
{% for f in open_rounds %}
<li>
<a
data-filter-item-text
{% if f.selected %}
href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
{% else %}
href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
{% endif %}
hx-push-url="true"
class="flex {% if f.selected %}ps-2 font-medium bg-base-200{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200">
{% if f.selected %}
{% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %}
{% endif %}
{{ f.title }}
</a>
</li>
{% endfor %}
{% endif %}
>
<nav class="flex px-3 pt-2" style="box-shadow: inset 0 -1px 0 #e5e7eb">

{% if open_rounds %}
<span @click="tab = 'open_rounds'"
role="tab"
:class="{ 'border-x border-t border-b-transparent': tab === 'open_rounds' }"
class="inline-block py-2 px-4 text-center rounded-t-lg border-b cursor-pointer bg-base-100 round hover:text-base-content">{% trans "Open" %}</span>
{% endif %}

{% if closed_rounds %}
<span @click="tab = 'closed_rounds'"
role="tab"
:class="{ 'border-x border-t border-b-transparent': tab === 'closed_rounds' }"
class="inline-block py-2 px-4 text-center rounded-t-lg border-b cursor-pointer bg-base-100 hover:text-base-content">{% trans "Closed" %}</span>
{% endif %}
</nav>

<div data-filter-list>
{% if closed_rounds %}
<div class="overflow-auto max-h-80 divide-y tab-closed-rounds"
x-show="tab === 'closed_rounds'"
:aria-hidden="tab === 'closed_rounds' ? 'false' : 'true'"
role="tabpanel"
>
{% for f in closed_rounds %}
<a data-filter-item-text
{% if f.selected %}
href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
{% else %}
href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
{% endif %}

hx-push-url="true"
class="flex {% if f.selected %}ps-2 font-medium{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200{% if f.selected %}bg-base-200{% endif %}">
{% if f.selected %}
{% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %}
{% endif %}
{{ f.title }}
</a>
{% endfor %}
</div>
{% endif %}
{% if closed_rounds %}
{# Section heading — hidden during search because data-filter-item-text is empty #}
<li class="py-1 px-3 text-xs font-semibold tracking-wide uppercase text-base-content/50 bg-base-200" aria-hidden="true">
<span data-filter-item-text></span>
{% trans "Closed" %}
</li>
{% for f in closed_rounds %}
<li>
<a
data-filter-item-text
{% if f.selected %}
href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
{% else %}
href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
{% endif %}
hx-push-url="true"
class="flex {% if f.selected %}ps-2 font-medium bg-base-200{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200">
{% if f.selected %}
{% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %}
{% endif %}
{{ f.title }}
</a>
</li>
{% endfor %}
{% endif %}

{% if open_rounds %}
<div class="overflow-auto max-h-80 divide-y tab-open-rounds"
x-show="tab === 'open_rounds'"
:aria-hidden="tab === 'open_rounds' ? 'false' : 'true'"
role="tabpanel"
>
{% for f in open_rounds %}
<a
data-filter-item-text
{% if f.selected %}
href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}"
{% else %}
href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}"
{% endif %}
hx-push-url="true"
class="flex {% if f.selected %}ps-2 font-medium{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200{% if f.selected %}bg-base-200{% endif %}">
{% if f.selected %}
{% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %}
{% endif %}
</ul>

{{ f.title }}
</a>
{% endfor %}
</div>
{% endif %}
</div>
{% else %}
<div class="block py-2 px-3 text-base-content/80">
{% trans "No rounds available" %}
</div>
{% endif %}
</div>
</div>
Loading