Skip to content

Commit

Permalink
fix: proposal filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadrien Froger committed Nov 4, 2024
1 parent 5d4a658 commit 8855ad2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@
padding: 8px 16px 8px 8px;
font-size: 14px;
text-wrap: nowrap;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}

.decidimGeo__filterModal__select,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@
.decidimGeo__drawerHeader__drawerToggle {
padding: 8px;
}
.decidimGeo__filterModal__label {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;

}
.decidimGeo__filterModal__fieldlist {
padding: 8px;
position: relative;
Expand Down
8 changes: 2 additions & 6 deletions lib/decidim/geo/proposal/proposal_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ def filter_past(query)

def filter_active(query)
query.where(
"resource_type = ? AND (resource_status IN ('not_answered', 'evaluating', 'accepted') OR resource_status IS NULL) AND (end_date > ? OR end_date IS NULL)",
"resource_type = ? AND (resource_status NOT IN ('rejected', 'withdrawn') OR end_date >= ? OR end_date IS NULL)",
manifest_name,
15.days.ago.to_date
)
end

def filter_future(query)
query.where(
"resource_type = ? AND (resource_status IN ('not_answered', 'evaluating', 'accepted') OR resource_status IS NULL) AND (start_date > ? OR start_date IS NULL)",
manifest_name,
15.days.ago.to_date
)
filter_active(query)
end
end
end
Expand Down

0 comments on commit 8855ad2

Please sign in to comment.