Skip to content

Commit

Permalink
styling updates, re #8
Browse files Browse the repository at this point in the history
  • Loading branch information
apeters committed Dec 19, 2024
1 parent b143b67 commit 5f1f1ca
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
2 changes: 2 additions & 0 deletions afrc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@
# override this to permenantly display/hide the language switcher
SHOW_LANGUAGE_SWITCH = len(LANGUAGES) > 1

COLLECTIONS_GRAPHID = "3d461890-b4b5-11ea-84f7-3af9d3b32b71"

# Implement this class to associate custom documents to the ES resource index
# See tests.views.search_tests.TestEsMappingModifier class for example
# ES_MAPPING_MODIFIER_CLASSES = ["afrc.search.es_mapping_modifier.EsMappingModifier"]
Expand Down
6 changes: 3 additions & 3 deletions afrc/src/afrc/Search/SearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,13 @@ aside {
gap: 10px;
}
.facet-item {
font-size: 0.7rem;
font-size: 1rem;
padding: 16px;
border: 1px solid #ddd;
text-align: center;
cursor: pointer;
max-width: 11rem;
min-height: 11rem;
max-width: 15rem;
min-height: 15rem;
}
.facet-item.selected {
background-color: #f0f8ff;
Expand Down
28 changes: 21 additions & 7 deletions afrc/src/afrc/Search/components/SearchResultItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,31 @@ function clearResult() {
<img src="https://picsum.photos/160" />
</div>
<div class="result-content">
<h2>{{ props.searchResult._source.displayname }}</h2>
<p class="breadcrumb">
<div class="result-displayname">
{{ props.searchResult._source.displayname }}
</div>
<div class="breadcrumb">
(North and Central America &gt; United States &gt; Missouri &gt;
Greene)
</p>
<p class="scope-note">
</div>
<div class="scope-note">
{{ searchResult._source.displaydescription }}
</p>
</div>
<div class="actions">
<Button
label="...show more"
severity="secondary"
text
size="large"
/>
<Button
label="edit"
severity="secondary"
text
as="a"
target="_blank"
size="large"
icon="pi pi-pen-to-square"
:href="'./' + arches.urls.resource + '/' + searchResult._id"
/>
</div>
Expand All @@ -81,22 +86,31 @@ function clearResult() {
height: 16rem;
overflow: hidden;
padding-inline-start: 10px;
padding: 15px;
}
.result h2 {
margin: 0 0 10px;
font-size: 1.2rem;
}
.result .breadcrumb {
color: #888;
font-size: 0.9rem;
color: #415790;
font-size: 1.1rem;
margin-bottom: 10px;
padding: unset;
}
.result .image-placeholder {
width: 16rem;
height: 16rem;
min-width: 16rem;
background-color: #eee;
}
.result-displayname {
font-size: 1.5rem;
font-weight: bold;
}
.scope-note {
font-size: 1.2rem;
}
.actions {
display: flex;
gap: 10px;
Expand Down
15 changes: 8 additions & 7 deletions afrc/views/search_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ def get(self, request):

base_resource_type_filter = [
{
"graphid": "d6774bfc-b4b4-11ea-84f7-3af9d3b32b71",
"name": "Group",
"graphid": settings.COLLECTIONS_GRAPHID,
"inverted": False,
}
]
Expand Down Expand Up @@ -162,7 +161,11 @@ def get(self, request):
]

related_resource_ids = list(
search_relationships_via_ORM(resourceinstanceids, depth=3)
search_relationships_via_ORM(
resourceinstanceids,
target_graphid=settings.COLLECTIONS_GRAPHID,
depth=3,
)
)

se = SearchEngineFactory().create()
Expand Down Expand Up @@ -193,7 +196,7 @@ def get(self, request):

def search_relationships_via_ORM(
resourceinstanceids=None,
target_graphid="d6774bfc-b4b4-11ea-84f7-3af9d3b32b71",
target_graphid=None,
depth=1,
):
hits = set()
Expand Down Expand Up @@ -236,9 +239,7 @@ def get_related_resourceinstanceids(resourceinstanceids, depth=1):
return get_related_resourceinstanceids(resourceinstanceids, depth=depth)


def search_relationships(
resourceinstanceids=None, target_graphid="d6774bfc-b4b4-11ea-84f7-3af9d3b32b71"
):
def search_relationships(resourceinstanceids=None, target_graphid=None):
with connection.cursor() as cursor:
sql = """
WITH RECURSIVE resource_traversal_from(resourcexid, resourceid, graphid, depth) AS (
Expand Down

0 comments on commit 5f1f1ca

Please sign in to comment.