From 57e1a9e33597f30da0870a9af4d3e9167a7b3367 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 24 Mar 2021 20:53:29 +0100 Subject: fix: typo for commits found number --- src/views/Repository.vue | 2 +- src/views/Search.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Repository.vue b/src/views/Repository.vue index ade55d3..0b9e2cf 100644 --- a/src/views/Repository.vue +++ b/src/views/Repository.vue @@ -14,7 +14,7 @@ i.fab.fa-github section(v-if="commits.length > 0") .commit.no-hover - h2 Commits found {{ (commits.length == 1000)?"1000+":commits.length }} + 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]" diff --git a/src/views/Search.vue b/src/views/Search.vue index 5cbfe33..50f922c 100644 --- a/src/views/Search.vue +++ b/src/views/Search.vue @@ -5,7 +5,7 @@ b-overlay(:show="true" spinner-large) b-container(v-else) .commit.no-hover - h2 Commits found {{ commits.length }} + h2 Commits found: {{ commits.length }} .commit.no-hover(style="padding: 50px" v-if="loading") b-overlay(:show="true" spinner-large) commit-card( -- cgit v1.2.3-18-g5258 From c2ab16d3a89df2075f2e0047766168e8b711fe86 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 24 Mar 2021 21:26:51 +0100 Subject: feat: add new repository --- src/store.js | 15 ++++++++++++++ src/views/Repository.vue | 53 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/store.js b/src/store.js index 1483402..51dfc91 100644 --- a/src/store.js +++ b/src/store.js @@ -134,6 +134,21 @@ export default new Vuex.Store({ async set_committer({commit}, avatar) { commit('load_committer_avatar', avatar); }, + // Add new repository + async add_repo({commit}, payload) { + commit('loading_state', true) + let res + await fetch(`${this.state.api}/repo/`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(payload), + }) + .then(async response => { + res = await response.json() + }) + commit('loading_state', false) + return res + }, // Set loading state async set_loading({commit}, status) { commit('loading_state', status); diff --git a/src/views/Repository.vue b/src/views/Repository.vue index 0b9e2cf..abb40a9 100644 --- a/src/views/Repository.vue +++ b/src/views/Repository.vue @@ -21,6 +21,20 @@ :committer="emails[i.committer_email]" :expand="true" ) + section(v-else) + b-modal#new-repo( + @ok="add_new_repo()" + ok-title="Add" + ok-variant="outline-success" + cancel-variant="outline-dark" + ) + + b-form-group(label="Insert the branch name") + b-form-input(v-model="form.branch" placeholder="main") + .commit.no-hover + b-button(variant="outline-success" v-b-modal.new-repo) + | Add this repository on Gico + i.fas.fa-plus -- cgit v1.2.3-18-g5258 From 298076829936818ad95e5a9de4b57c81158779d2 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 24 Mar 2021 21:27:00 +0100 Subject: style: fix toast header --- src/sass/_bootstrap.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sass/_bootstrap.sass b/src/sass/_bootstrap.sass index c83c1eb..4fbcb1c 100644 --- a/src/sass/_bootstrap.sass +++ b/src/sass/_bootstrap.sass @@ -26,3 +26,6 @@ h2 @media (max-width: 768px) @content +.toast-header + padding-bottom: 0 + margin-bottom: 0 -- cgit v1.2.3-18-g5258