summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/views')
-rw-r--r--src/views/Search.vue46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/views/Search.vue b/src/views/Search.vue
new file mode 100644
index 0000000..c173567
--- /dev/null
+++ b/src/views/Search.vue
@@ -0,0 +1,46 @@
+<template lang="pug">
+ main
+ header-blue
+ b-container(v-if="loading")
+ b-overlay(:show="true" spinner-large)
+ b-container(v-else)
+ .commit
+ h2 Commits found {{ commits.length }}
+ .commit(style="padding: 50px" v-if="loading")
+ b-overlay(:show="true" spinner-large)
+ commit-card(
+ v-else
+ v-for="i in commits" :key="i.hash" :data="i"
+ :author="emails[i.author_email]"
+ :committer="emails[i.committer_email]"
+ )
+</template>
+
+<script>
+import HeaderBlue from '@/components/HeaderBlue';
+import Commit from '@/components/Commit';
+
+export default {
+ name: "Commit",
+ props: ["hash"],
+ components: {
+ 'header-blue': HeaderBlue,
+ 'commit-card': Commit,
+ },
+ mounted() {
+ this.$store.dispatch('get_commits', this.$route.query.q);
+ 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>