1
0
mirror of https://github.com/arturssmirnovs/github-profile-readme-generator.git synced 2024-11-16 10:08:41 +02:00

#36 stats fill in disabled if no GitHub username

This commit is contained in:
arturssmirnovs 2020-10-27 08:56:48 +02:00
parent 7229b65319
commit 6a66fb3f1f
4 changed files with 172 additions and 133 deletions

View File

@ -2,10 +2,7 @@ app-sidebar textarea {
min-height: 290px; }
app-sidebar img {
max-width: 100%; }
.brand-logo {
padding-right: 10px; }
.social-title {
padding: 5px 0; }
.jumbotron {
margin-top: 3rem;
padding: 2rem 2rem; }
@ -37,7 +34,7 @@ footer {
footer p {
margin-bottom: .25rem; }
.example-icon {
width: 20px; }
.example-icon {
width: 20px; }
/*# sourceMappingURL=style.css.map */

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AACE,oBAAS;EACP,UAAU,EAAE,KAAK;AAEnB,eAAI;EACF,SAAS,EAAE,IAAI;;AAGnB,UAAW;EACT,UAAU,EAAE,IAAI;EAChB,OAAO,EAAE,SAAS;EAClB,aAAG;IACD,WAAW,EAAE,IAAI;;AAGrB,KAAM;EACJ,WAAW,EAAE,IAAI;EACjB,aAAa,EAAE,IAAI;;AAErB,UAAW;EACT,MAAM,EAAE,8BAA0B;EAClC,aAAa,EAAE,MAAM;;AAEvB,IAAK;EACH,WAAW,EAAE,IAAI;EACjB,OAAG;IACD,cAAc,EAAE,SAAS;IACzB,aAAa,EAAE,IAAI;;AAGvB,MAAO;EACL,gBAAgB,EAAE,OAAO;EACzB,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,IAAI;;AAGb,QAAS;EACP,aAAa,EAAE,MAAM",
"mappings": "AACE,oBAAS;EACP,UAAU,EAAE,KAAK;AAEnB,eAAI;EACF,SAAS,EAAE,IAAI;;AAGnB,UAAW;EACT,UAAU,EAAE,IAAI;EAChB,OAAO,EAAE,SAAS;EAClB,aAAG;IACD,WAAW,EAAE,IAAI;;AAGrB,KAAM;EACJ,WAAW,EAAE,IAAI;EACjB,aAAa,EAAE,IAAI;;AAErB,UAAW;EACT,MAAM,EAAE,8BAA0B;EAClC,aAAa,EAAE,MAAM;;AAEvB,IAAK;EACH,WAAW,EAAE,IAAI;EACjB,OAAG;IACD,cAAc,EAAE,SAAS;IACzB,aAAa,EAAE,IAAI;;AAGvB,MAAO;EACL,gBAAgB,EAAE,OAAO;EACzB,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,IAAI;;AAGb,QAAS;EACP,aAAa,EAAE,MAAM;;AAGvB,aAAc;EACZ,KAAK,EAAE,IAAI",
"sources": ["style.scss"],
"names": [],
"file": "style.css"

View File

@ -534,151 +534,170 @@
</div>
<div v-show="tab == 'stats'" class="tab">
<h3 data-i18n="statistics.title">Statistics</h3>
<p data-i18n="statistics.description">GitHub username required</p>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck1" v-model="data.views">
<label
class="custom-control-label"
for="customCheck1"
data-i18n="statistics.showViews"
>Show profile views</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck2" v-model="data.stats">
<label
class="custom-control-label"
for="customCheck2"
data-i18n="statistics.showStats"
>Show GitHub statistics</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck3" v-model="data.languages">
<label
class="custom-control-label"
for="customCheck3"
data-i18n="statistics.showLanguages"
>Show most used languages</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="defaultCheck4" v-model="data.private" :disabled="!data.stats">
<label
class="custom-control-label"
for="defaultCheck4"
data-i18n="statistics.includePrivate"
>Include private repositories</label>
<div class="col-xs-12 col-md-12">
<div class="form-group mb-4">
<div class="social-title">
<label data-i18n="social.github">GitHub</label>
</div>
<input
type="text"
v-model="data.github"
data-i18n="social.githubPlaceholder social.github"
data-i18n-attr="placeholder aria-label"
placeholder="Enter your username..."
class="form-control mb-2"
aria-label="Github"
/>
<p data-i18n="statistics.description">GitHub username required</p>
</div>
</div>
</div>
<h3 class="mt-3" data-i18n="trophies.title">Github Trophies</h3>
<p data-i18n="trophies.description">GitHub username required</p>
<div v-bind:class="[data.github ? 'social-stats active' : 'social-stats disabled']">
<h3 data-i18n="statistics.title">Statistics</h3>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck4" v-model="data.trophy">
<label
class="custom-control-label"
for="customCheck4"
data-i18n="trophies.showTrophies"
>Show Trophies</label>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck1" v-model="data.views" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck1"
data-i18n="statistics.showViews"
>Show profile views</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck2" v-model="data.stats" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck2"
data-i18n="statistics.showStats"
>Show GitHub statistics</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck3" v-model="data.languages" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck3"
data-i18n="statistics.showLanguages"
>Show most used languages</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="defaultCheck4" v-model="data.private" :disabled="!data.stats" :disabled="!data.github">
<label
class="custom-control-label"
for="defaultCheck4"
data-i18n="statistics.includePrivate"
>Include private repositories</label>
</div>
</div>
</div>
</div>
<h3 class="mt-3" data-i18n="badges.title">Github Badges</h3>
<h3 class="mt-3" data-i18n="trophies.title">Github Trophies</h3>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck5" v-model="data.arctic">
<label
class="custom-control-label"
for="customCheck5"
data-i18n="badges.arctic"
>Arctic Contributor</label>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck4" v-model="data.trophy" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck4"
data-i18n="trophies.showTrophies"
>Show Trophies</label>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck6" v-model="data.devprog">
<label
class="custom-control-label"
for="customCheck6"
data-i18n="badges.devProgram"
>Developer Program</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck7" v-model="data.star">
<label
class="custom-control-label"
for="customCheck7"
data-i18n="badges.starsProgram"
>Stars Program</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck8" v-model="data.sponsor">
<label
class="custom-control-label"
for="customCheck8"
data-i18n="badges.sponsor"
>Sponsor</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck9" v-model="data.gitpro">
<label
class="custom-control-label"
for="customCheck9"
data-i18n="badges.pro"
>Github Pro</label>
</div>
</div>
</div>
<h3 class="mt-3" data-i18n="metrics.title">GitHub Metrics</h3>
<p data-i18n="metrics.description">GitHub username required.</p>
<h3 class="mt-3" data-i18n="badges.title">Github Badges</h3>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck10" v-model="data.metrics">
<label
class="custom-control-label"
for="customCheck10"
data-i18n="metrics.showMetrics"
>Show GitHub metrics</label>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck5" v-model="data.arctic" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck5"
data-i18n="badges.arctic"
>Arctic Contributor</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck6" v-model="data.devprog" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck6"
data-i18n="badges.devProgram"
>Developer Program</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck7" v-model="data.star" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck7"
data-i18n="badges.starsProgram"
>Stars Program</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck8" v-model="data.sponsor" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck8"
data-i18n="badges.sponsor"
>Sponsor</label>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck9" v-model="data.gitpro" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck9"
data-i18n="badges.pro"
>Github Pro</label>
</div>
</div>
</div>
</div>
<h3 class="mt-3" data-i18n="streak.title">GitHub Streak Stats</h3>
<p data-i18n="streak.description">GitHub username required.</p>
<h3 class="mt-3" data-i18n="metrics.title">GitHub Metrics</h3>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck11" v-model="data.streak">
<label
class="custom-control-label"
for="customCheck11"
data-i18n="streak.showStreak"
>Show GitHub Streak Stats</label>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck10" v-model="data.metrics" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck10"
data-i18n="metrics.showMetrics"
>Show GitHub metrics</label>
</div>
</div>
</div>
<h3 class="mt-3" data-i18n="streak.title">GitHub Streak Stats</h3>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input" id="customCheck11" v-model="data.streak" :disabled="!data.github">
<label
class="custom-control-label"
for="customCheck11"
data-i18n="streak.showStreak"
>Show GitHub Streak Stats</label>
</div>
</div>
</div>
</div>

View File

@ -56,6 +56,9 @@ new Vue({
arctic: false,
devprog: false,
pro: false,
star: false,
sponsor: false,
gitpro: false,
github: "",
dev: "",
@ -84,6 +87,7 @@ new Vue({
deep: true,
handler() {
this.forced = false;
this.github = this.githubWatcher(this.data.github);
this.source = this.getSource(this.data);
}
}
@ -105,6 +109,25 @@ new Vue({
this.translator.load();
},
methods: {
githubWatcher(github) {
if (!github) {
this.data.views = false;
this.data.stats = false;
this.data.private = false;
this.data.metrics = false;
this.data.streak = false;
this.data.languages = false;
this.data.trophy = false;
this.data.arctic = false;
this.data.devprog = false;
this.data.pro = false;
this.data.star = false;
this.data.sponsor = false;
this.data.gitpro = false;
}
return github;
},
getTranslations(language) {
return fetch(`i18n/${language}.json`, {
headers: {