Skip to content

Commit

Permalink
Add search page template and styling
Browse files Browse the repository at this point in the history
add styling for mobile and desktop screen responsiveness
  • Loading branch information
“OMosimege” committed Jul 30, 2024
1 parent 54e282e commit 82c7efb
Show file tree
Hide file tree
Showing 4 changed files with 345 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
76 changes: 73 additions & 3 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 @@ -397,6 +407,48 @@ 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-label {
display: inline-block;
vertical-align: top;
word-break: break-word;
width: calc(100% - 25px);
}

.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 +474,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 +527,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 +632,8 @@ html {
width: 70%;
flex: 1;
min-width: 200px;
overflow: hidden;
padding-right: 15px;
}
.project-right-col {
width: 30%;
Expand Down Expand Up @@ -670,7 +740,7 @@ html {
display: flex;
font-size: 0.875rem;
}
.filter-form {
.filter-form
{
display: flex;
}
}
Loading

0 comments on commit 82c7efb

Please sign in to comment.