Skip to content

Commit 427301b

Browse files
authored
Merge pull request #83 from jordanopensource/development
merge "development" into "main"
2 parents 56fe780 + 788a6cf commit 427301b

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed

components/LastUpdated.vue

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<template>
2+
<div v-if="lastUpdated" class="flex justify-end mr-24 pt-5">
3+
<p class="opacity-50">
4+
{{ lastUpdated }}
5+
</p>
6+
</div>
7+
</template>
8+
9+
<script>
10+
export default {
11+
name: 'LastUpdated',
12+
data() {
13+
return {
14+
lastUpdated: null,
15+
}
16+
},
17+
async fetch() {
18+
const response = await this.$axios.get('/v1/stats/updated')
19+
const year = new Date(response.data.lastUpdated).getFullYear()
20+
const month = new Date(response.data.lastUpdated).toLocaleString('en-GB', {
21+
month: '2-digit',
22+
})
23+
const day = new Date(response.data.lastUpdated).toLocaleString('en-GB', {
24+
day: '2-digit',
25+
})
26+
const time = new Date(response.data.lastUpdated).toLocaleTimeString('en-GB')
27+
this.lastUpdated = `The information on this site was last updated at ${year}-${month}-${day} ${time}`
28+
},
29+
}
30+
</script>
31+
32+
<style lang="postcss" scoped>
33+
.cards-container {
34+
@apply block py-2 w-11/12 mx-auto lg:flex lg:flex-nowrap lg:justify-center;
35+
}
36+
</style>

components/Stats.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import { mapState } from 'vuex'
3939
import Card from './Card.vue'
4040
export default {
41-
name: 'Stats',
41+
name: 'StatsCards',
4242
components: {
4343
Card,
4444
},

pages/contributors/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div class="page-container">
33
<Hero title="Contributors" />
4+
<LastUpdated />
45
<div class="area-chart-section">
56
<div class="chart-header">
67
<div class="divider-black"></div>
@@ -30,13 +31,15 @@
3031
</template>
3132

3233
<script>
34+
import LastUpdated from '~/components/LastUpdated.vue'
3335
export default {
3436
name: 'ContributorsPage',
3537
components: {
3638
Hero: () => import('~/components/Hero.vue'),
3739
AreaChart: () => import('~/components/AreaChart.vue'),
3840
BarChart: () => import('~/components/BarChart.vue'),
3941
TopDevelopers: () => import('~/components/TopDevelopers.vue'),
42+
LastUpdated,
4043
},
4144
data() {
4245
return {

pages/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div class="bg-gray">
33
<Hero />
4+
<LastUpdated />
45
<LazyHydrate when-visible>
56
<Stats />
67
</LazyHydrate>
@@ -13,12 +14,14 @@
1314
<script>
1415
import LazyHydrate from 'vue-lazy-hydration'
1516
import Hero from '../components/HomePageHero.vue'
17+
import LastUpdated from '~/components/LastUpdated.vue'
1618
export default {
1719
components: {
1820
Hero,
1921
Stats: () => import('../components/Stats.vue'),
2022
TopDevelopers: () => import('../components/TopDevelopers.vue'),
2123
LazyHydrate,
24+
LastUpdated,
2225
},
2326
mounted() {
2427
this.$store.commit('setPeriod', 'last_30_days')

pages/organizations/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div class="page-container">
33
<Hero title="Organizations" />
4+
<LastUpdated />
45
<div class="area-chart-section">
56
<div class="chart-header">
67
<div class="divider-black"></div>
@@ -21,12 +22,14 @@
2122
</template>
2223

2324
<script>
25+
import LastUpdated from '~/components/LastUpdated.vue'
2426
export default {
2527
name: 'OrganizationsPage',
2628
components: {
2729
Hero: () => import('~/components/Hero.vue'),
2830
AreaChart: () => import('~/components/AreaChart.vue'),
2931
TopOrganizations: () => import('~/components/TopOrganizations.vue'),
32+
LastUpdated,
3033
},
3134
data() {
3235
return {

0 commit comments

Comments
 (0)