Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project switcher to mapex website #102

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 36 additions & 0 deletions src/mappings_explorer/templates/_project_switcher.html.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div id="switcher-component">
<Switcher :url_prefix="'{{url_prefix}}'"></Switcher>
</div>

<script>
const Switcher = {
template: `
<div>
<RelatedProjectSwitcherVue currentProjectId="mappings_explorer" theme="dark"/>
</div>
`,
components: {
RelatedProjectSwitcherVue: () => import (`../static/vendor/project-switcher/project-switcher.js`)
},
delimiters: ["[[", "]]"],
data() {
return {
projectList: {},
fullProjectList: {},
notificationList: {},
searchModel: "",
};
},
props: {
url_prefix: String,
},
};
Vue.createApp({
components: {
Switcher
}
}).mount("#switcher-component");
</script>
<script>

</script>
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading