diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-03-24 20:51:40 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-03-24 20:51:40 +0100 |
commit | b8b7cd6876f72c6de16e47e8f5b5c4a3f5674560 (patch) | |
tree | 62825a0b60991682d5c6b401b195fe7f833c535d /src/views | |
parent | 452a0553aec3e7ae6de1421a3d2f18e5dc198d8f (diff) |
feat: add repo page
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/Repository.vue | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/views/Repository.vue b/src/views/Repository.vue new file mode 100644 index 0000000..ade55d3 --- /dev/null +++ b/src/views/Repository.vue @@ -0,0 +1,59 @@ +<template lang="pug"> + main + header-blue + b-container(v-if="loading") + b-overlay(:show="true" spinner-large) + b-container(v-else) + .commit.no-hover + h1 {{ user }}/ + span.secondary {{ name }} + b-button.open-github( + :href="'https://github.com/'+user+'/'+name" + variant="outline-dark" target="_new" + ) Open on GitHub + i.fab.fa-github + section(v-if="commits.length > 0") + .commit.no-hover + h2 Commits found {{ (commits.length == 1000)?"1000+":commits.length }} + commit-card( + v-for="i in commits" :key="i.hash" :data="i" + :author="emails[i.author_email]" + :committer="emails[i.committer_email]" + :expand="true" + ) +</template> + +<script> +import HeaderBlue from '@/components/HeaderBlue'; +import Commit from '@/components/Commit'; + +export default { + name: "Repository", + props: ["user", "name"], + components: { + 'header-blue': HeaderBlue, + 'commit-card': Commit, + }, + data() { + return { + error404: false + } + }, + async mounted() { + this.$store.dispatch('set_loading', true); + this.$store.dispatch('get_repo_commits', {user: this.user, name: this.name}); + this.$store.dispatch('get_emails'); + }, + computed: { + loading: function() { + return this.$store.getters.loading; + }, + commits: function() { + return this.$store.getters.commits; + }, + emails: function() { + return this.$store.getters.emails; + }, + }, +} +</script> |