Skip to content

Commit

Permalink
Merge pull request #104 from SADiLaR/feature/search-page-styling
Browse files Browse the repository at this point in the history
Add search page template and styling
  • Loading branch information
OnaMosimege authored Jul 31, 2024
2 parents 54e282e + 7886896 commit 7b7a599
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 110 deletions.
3 changes: 3 additions & 0 deletions app/general/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def filter_queryset(self, queryset):
"search_headline",
"view",
"logo_url",
"associated_url",
)

# In the queries below, any differences between models must be fixed
Expand All @@ -68,6 +69,7 @@ def filter_queryset(self, queryset):
heading=F("name"),
view=Value("project_detail"),
logo_url=F("logo"),
associated_url=F("url"),
search_headline=SearchHeadline("description", query, max_words=15, min_words=10),
rank=SearchRank(project_search_vector, query, normalization=16),
search=project_search_vector,
Expand All @@ -86,6 +88,7 @@ def filter_queryset(self, queryset):
heading=F("title"),
view=Value("document_detail"),
logo_url=Value(""),
associated_url=F("url"),
rank=search_rank,
search_headline=search_headline,
).values(*fields)
Expand Down
69 changes: 65 additions & 4 deletions app/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ html {
min-height: 100%;
}

input[type="checkbox"] {
width: 1.5em;
height: 1.5em;
}

.content {
overflow: hidden;
padding-bottom: 130px;
Expand Down Expand Up @@ -78,6 +83,9 @@ html {
background-color: var(--primary);
border-color: var(--primary);
}
.btn-secondary{
margin-top:20px;
}
.btn-outline-primary{
margin-top:20px;
background: #2D4481;
Expand Down Expand Up @@ -141,6 +149,7 @@ html {
display: flex;
justify-content: center;
margin-top: 20px;
overflow-x: auto;
}
.pagination {
display: flex;
Expand All @@ -151,7 +160,7 @@ html {
}
.pagination .page-item {
margin: 0;
border-left: 1px solid #000;
background-color: var(--primary);
}
.pagination .page-item:first-child {
border-left: none;
Expand All @@ -160,6 +169,7 @@ html {
padding: 5px 10px;
text-decoration: none;
color: var(--text-color);
height: 100%;
}
.pagination .page-item.active .page-link {
background-color: var(--primary);
Expand Down Expand Up @@ -273,7 +283,6 @@ html {
font-size: 0.875rem;
margin: 3px 0 3px 0;
}

.project-logo {
height: 100px;
width: auto;
Expand Down Expand Up @@ -397,6 +406,41 @@ html {
max-width: 500px;
}

/*Search page*/
.filter-label {
font-weight: bold;
}
.filter-checkbox {
display: flex;
align-items: flex-start;
gap: 10px;
}
.single-checkbox {
display: inline-block;
vertical-align: top;
white-space: nowrap;
word-break: keep-all;
width: 20px;
}

.checkbox-container {
max-height: 90px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
border: 1px solid;
box-sizing: border-box;
border-radius: 0.3rem;
border-color: #ccc;
padding: 1rem;
}

/* Ensures checkboxes are styled properly */
.checkbox-container input[type="checkbox"] {
margin-right: 10px;
cursor: pointer;
}


/*Error pages*/
.body-card {
border-color: var(--primary-red);
Expand All @@ -422,6 +466,14 @@ html {
.section {
padding-right: 30px;
}
.pagination .page-link {
padding: 5px;
font-size: 12px;
}

.pagination-wrapper {
padding: 0 10px;
}

/*Institutions page*/
.uni-card {
Expand Down Expand Up @@ -467,6 +519,14 @@ html {
.section {
padding-right: 20px;
}
.pagination .page-link {
padding: 5px;
font-size: 12px;
}

.pagination-wrapper {
padding: 0 10px;
}

/*Institutions page*/
.all-cards {
Expand Down Expand Up @@ -564,6 +624,7 @@ html {
width: 70%;
flex: 1;
min-width: 200px;
padding-right: 15px;
}
.project-right-col {
width: 30%;
Expand Down Expand Up @@ -670,7 +731,7 @@ html {
display: flex;
font-size: 0.875rem;
}
.filter-form {
.filter-form
{
display: flex;
}
}
Loading

0 comments on commit 7b7a599

Please sign in to comment.