Skip to content

Commit

Permalink
add component and link references for related project switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonrobbins committed Oct 1, 2024
1 parent a285733 commit b318682
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/mappings_explorer/templates/_navigation.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
</li>
</ul>
</nav>
<div class="project-switcher">
{% include "_project_switcher.html.j2"%}
</div>
</div>
<script>
function navSearchWebsite(url) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
<script>
const Switcher = {
template: `
<link href="{{url_prefix}}static/project-switcher.css" rel="stylesheet"></link>
<div>
<p>project switcher</p>
<RelatedProjectSwitcherVue currentProjectId="mappings_explorer" theme="dark"/>
</div>
`,
components: {
RelatedProjectSwitcherVue: () => import (`../static/vendor/project-switcher/project-switcher.js`)
},
delimiters: ["[[", "]]"],
data() {
return {
Expand All @@ -19,6 +21,9 @@
searchModel: "",
};
},
props: {
url_prefix: String,
},
};
Vue.createApp({
components: {
Expand Down
5 changes: 5 additions & 0 deletions src/mappings_explorer/templates/base.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
<!-- Vue -->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

<!-- Import project switcher component -->
<link href="{{url_prefix}}static/vendor/project-switcher/project-switcher.js" rel="stylesheet">
<link href="{{url_prefix}}static/vendor/project-switcher/project-switcher.umd.cjs" rel="stylesheet">
<link href="{{url_prefix}}static/vendor/project-switcher/style.css" rel="stylesheet">

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7E2GTHR4GB"></script>
<script>
Expand Down

0 comments on commit b318682

Please sign in to comment.