Skip to content

Commit

Permalink
Merge pull request #15 from archesproject/cnh/stand-alone-rascoll-search
Browse files Browse the repository at this point in the history
Adds rascoll search component at standalone endpoint, #14
  • Loading branch information
apeters authored Jan 30, 2025
2 parents 15d6b7c + 3b37d4b commit d18a477
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
6 changes: 6 additions & 0 deletions afrc/media/js/views/rascoll-search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import SearchPage from '@/afrc/Search/SearchPage.vue';
import createVueApplication from 'arches/arches/app/media/js/utils/create-vue-application';

createVueApplication(SearchPage).then(vueApp => {
vueApp.mount('#rascoll-search-container');
});
1 change: 1 addition & 0 deletions afrc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"arches.app.utils.middleware.SetAnonymousUser",
# "silk.middleware.SilkyMiddleware",
# "csp.middleware.CSPMiddleware",
]

MIDDLEWARE.insert( # this must resolve to first MIDDLEWARE entry
Expand Down
39 changes: 39 additions & 0 deletions afrc/templates/views/rascoll-search.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% extends "base-root.htm" %}

{% load static %}
{% load webpack_static from webpack_loader %}

{% block head %}
<head>
<title>
{% block title %}{% endblock title %}
</title>

<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<link rel="shortcut icon" href="{% webpack_static 'favicons/favicon.ico' %}" type="image/x-icon" />
<link rel="apple-touch-icon" href="{% webpack_static 'favicons/apple-touch-icon.png' %}" />
<link rel="apple-touch-icon" sizes="76x76" href="{% webpack_static 'favicons/apple-touch-icon-76x76.png' %}" />
<link rel="apple-touch-icon" sizes="120x120" href="{% webpack_static 'favicons/apple-touch-icon-120x120.png' %}" />
<link rel="apple-touch-icon" sizes="152x152" href="{% webpack_static 'favicons/apple-touch-icon-152x152.png' %}" />
<link rel="apple-touch-icon" sizes="180x180" href="{% webpack_static 'favicons/apple-touch-icon-180x180.png' %}" />

{% block css %}
<link rel="stylesheet" href="{% webpack_static 'node_modules/normalize.css/normalize.css' %}" />
<link rel="stylesheet" href="{% webpack_static 'node_modules/font-awesome/css/font-awesome.min.css' %}" />
<link rel="stylesheet" href="{% webpack_static 'node_modules/primeicons/primeicons.css' %}" />
<style>
html {font-size: 10px}
</style>
{% endblock css %}
</head>
{% endblock head %}


{% block body %}
<div id="rascoll-search-container" style="font-size:10px"></div>
{% endblock body %}
2 changes: 2 additions & 0 deletions afrc/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
GeoJSONBoundsAPI,
ReferenceCollectionMVT,
)
from afrc.views.rascoll_search import RascollSearchView

urlpatterns = [
# project-level urls
Expand All @@ -23,6 +24,7 @@
ReferenceCollectionMVT.as_view(),
name="api-reference-collection-mvt",
),
re_path(r"^rascoll-search$", RascollSearchView.as_view(), name="rascoll-search"),
]

# Ensure Arches core urls are superseded by project-level urls
Expand Down
9 changes: 9 additions & 0 deletions afrc/views/rascoll_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.shortcuts import render
from arches.app.views.base import BaseManagerView
from django.utils.translation import gettext_lazy as _

class RascollSearchView(BaseManagerView):
def get(self, request, graphid=None, resourceid=None):
context = self.get_context_data(main_script="views/rascoll-search")
context['page_title'] = _("RASCOLL Search")
return render(request, "views/rascoll-search.htm", context)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers = [
requires-python = ">=3.10"
dependencies = [
"arches>=7.6.2,<7.7.0",
"django_csp==3.8",
]
version = "0.0.1"

Expand Down

0 comments on commit d18a477

Please sign in to comment.