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 /bare/eu/news/ and /bare/eu/events/ #1487

Merged
merged 2 commits into from
Jun 27, 2022
Merged
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 content/bare/eu/events/main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: European Galaxy Events
---
3 changes: 3 additions & 0 deletions content/bare/eu/news/main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: European Galaxy News
---
125 changes: 125 additions & 0 deletions src/pages/bare/eu/Events.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<template>
<!-- This first div gets `id="app"` automatically. -->
<div>
<div id="maincontainer" class="container">
<h1 class="page-title">{{ $page.main.title }}</h1>
<div class="content markdown" v-if="hasContent($page.main)" v-html="$page.main.content" />
<div class="clearfix"></div>
<h2 id="upcoming-events">
<a href="#upcoming-events" aria-hidden="true"><span class="icon icon-link"></span></a>
Upcoming Events
</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Date</th>
<th>Topic/Event</th>
<th>Venue/Location</th>
<th>Contact</th>
</tr>
</thead>
<tbody>
<ArticleTableEvents v-for="edge in $page.upcoming.edges" :key="edge.node.id" :article="edge.node" />
</tbody>
</table>
<h2 id="recent-events">
<a href="#recent-events" aria-hidden="true"><span class="icon icon-link"></span></a>
Recent Events
</h2>
<p>Events in the past 12 months:</p>
<table class="table table-striped">
<thead>
<tr>
<th>Date</th>
<th>Topic/Event</th>
<th>Venue/Location</th>
<th>Contact</th>
</tr>
</thead>
<tbody>
<ArticleTableEvents v-for="edge in $page.recent.edges" :key="edge.node.id" :article="edge.node" />
</tbody>
</table>
<footer class="page-footer markdown" v-if="$page.footer" v-html="$page.footer.content" />
</div>
</div>
</template>

<script>
import ArticleTableEvents from "@/components/ArticleTableEvents";
import { hasContent } from "~/lib/pages.mjs";
export default {
components: {
ArticleTableEvents,
},
methods: {
hasContent,
},
metaInfo() {
return {
title: this.$page.main.title,
};
},
};
</script>

<page-query>
query {
main: insert(path: "/insert:/bare/eu/events/main/") {
id
title
content
fileInfo {
path
}
}
footer: insert(path: "/insert:/bare/eu/events/footer/") {
id
title
content
}
upcoming: allArticle(
sortBy: "date", order: ASC, filter: {
category: {eq: "events"}, subsites: {contains: ["eu"]}, draft: {ne: true},
has_date: {eq: true}, days_ago: {lte: 0}
}
) {
totalCount
edges {
node {
...articleFields
}
}
}
recent: allArticle(
sortBy: "date", order: DESC, filter: {
category: {eq: "events"}, subsites: {contains: ["eu"]}, draft: {ne: true},
has_date: {eq: true}, days_ago: {between: [1, 365]}
}
) {
totalCount
edges {
node {
...articleFields
}
}
}
}
fragment articleFields on Article {
id
title
tease
location
location_url
continent
contact
external_url
gtn
links {
text
url
}
date (format: "D MMMM YYYY")
path
}
</page-query>
62 changes: 62 additions & 0 deletions src/pages/bare/eu/News.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<!-- This first div gets `id="app"` automatically. -->
<div>
<div id="maincontainer" class="container">
<h1 class="page-title">{{ $page.main.title }}</h1>
<div class="markdown" v-if="hasContent($page.main)" v-html="$page.main.content" />
<table class="table table-striped">
<tbody>
<ArticleTable v-for="edge in $page.articles.edges" :key="edge.node.id" :article="edge.node" />
</tbody>
</table>
</div>
</div>
</template>

<script>
import ArticleTable from "@/components/ArticleTable";
import { hasContent } from "~/lib/pages.mjs";
export default {
components: {
ArticleTable,
},
methods: {
hasContent,
},
metaInfo() {
return {
title: this.$page.main.title,
};
},
};
</script>

<page-query>
query {
main: insert(path: "/insert:/bare/eu/news/main/") {
id
title
content
fileInfo {
path
}
}
articles: allArticle(
sortBy: "date", order: DESC, filter: {
category: {eq: "news"}, subsites: {contains: ["eu"]}, draft: {ne: true}
}
) {
totalCount
edges {
node {
id
title
tease
external_url
date (format: "D MMMM YYYY")
path
}
}
}
}
</page-query>