summaryrefslogtreecommitdiff
path: root/src/components/Commit.vue
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-03-19 20:27:26 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-03-19 20:27:26 +0100
commit5c29f010cf52f3ba5ee597a50df97219d8dc04a7 (patch)
tree447f697a5cafda82e57ffc7b98c5360c48c9076b /src/components/Commit.vue
parenta70a62d2f7188a36a08314ac2151dec7152fffa7 (diff)
feat: commits list
Diffstat (limited to 'src/components/Commit.vue')
-rw-r--r--src/components/Commit.vue53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/components/Commit.vue b/src/components/Commit.vue
new file mode 100644
index 0000000..63e1764
--- /dev/null
+++ b/src/components/Commit.vue
@@ -0,0 +1,53 @@
+<template lang="pug">
+ .commit(:id="data.hash")
+ .repo
+ a(
+ :href="'/repo/'+data.repository_url" :title="data.repository_url"
+ ) {{ data.repository_url }}
+
+ .head
+ h5
+ a(:href="'/commit/'+data.hash") {{ data.hash }}
+ div
+ span.tree tree:
+ h6
+ a(:href="'/commit/'+data.tree") {{ data.tree }}
+
+ .author_committer
+ div
+ img.avatar(
+ :src="'https://gravatar.com/avatar/'+author"
+ :alt="data.author_email"
+ )
+ p Author:
+ b(:title="data.author_email") {{ data.author_name }}
+ | <{{data.author_email}}></b>
+ div
+ img.avatar(
+ :src="'https://gravatar.com/avatar/'+committer"
+ :alt="data.committer_email"
+ )
+ p Committer:
+ b(:title="data.committer_email") {{ data.committer_name }}
+ | <{{data.committer_email}}></b>
+
+ .text
+ p
+ | {{ first_line(data.text) }}
+ span.middot ยท
+ span.date {{ data.date | moment("ddd, D MMM YYYY HH:mm:ss ZZ") }}
+</template>
+
+<script>
+export default {
+ name: 'Commit',
+ // `author` is the hash md5 of the author's gravatar
+ // `committer` is the hash md5 of the committer's gravatar
+ props: ['data', 'author', 'committer'],
+ methods: {
+ first_line(text) {
+ return text.split('\n')[0]
+ }
+ }
+}
+</script>