Commit 47dc172e authored by Lucas Détré's avatar Lucas Détré

fixing bugs on #modified links and going back to list view - adding another...

fixing bugs on #modified links and going back to list view - adding another layout for primary buttons
parent 5b8924e8
......@@ -201,6 +201,19 @@
background-color : #384EAA;
color: white;
}
.main-button:hover:disabled {
border: 1px solid #384EAA;
background-color : #BDBADE;
color: black;
}
.main-button-primary {
background-color : #384EAA;
color: white;
}
.main-button-primary:hover {
background-color : #0D0850;
color: white;
}
.loading-gif {
padding-top: 8rem;
}
......
......@@ -53,7 +53,8 @@
'tag-file-renamed': '<span class="d2h-tag d2h-moved d2h-moved-tag">RENOMMÉ</span>',
'tag-file-added': '<span class="d2h-tag d2h-added d2h-added-tag">AJOUTÉ</span>',
'file-summary-wrapper': '<div class="d2h-file-list-wrapper"><div class="d2h-file-list-header"><span class="d2h-file-list-title">Fichiers modifiés ({{filesNumber}})</span><a class="d2h-file-switch d2h-hide">cacher</a><a class="d2h-file-switch d2h-show">show</a></div><ol class="d2h-file-list">{{{files}}}</ol></div>',
'generic-wrapper': '<div class="d2h-wrapper">{{{content}}}</div>'
'generic-wrapper': '<div class="d2h-wrapper">{{{content}}}</div>',
'file-summary-line':'<li class="d2h-file-list-line"><span class="d2h-file-name-wrapper">{{>fileIcon}}<a href="#'+this.modification.file.split('/').pop()+'" class="d2h-file-name">{{fileName}}</a><span class="d2h-file-stats"><span class="d2h-lines-added">{{addedLines}}</span><span class="d2h-lines-deleted">{{deletedLines}}</span></span></span></li>'
}
});
},
......
......@@ -78,14 +78,14 @@
},
printRulePath: function () {
var path = "";
var printpath = "(";
var printpath = "";
if(this.windowLocationHash.split('#').length -1 > 1) {
for(var i=1; i <= this.windowLocationHash.split('#').length -1; i++) {
if (this.windowLocationHash.split('#').pop() == 'modified') return "";
path += "#"+ this.windowLocationHash.split('#')[i];
if (i == this.windowLocationHash.split('#').length - 1) printpath += "<a href='"+ path + "'>" + this.windowLocationHash.split('#')[i] + "</a>"
else printpath += "<a href='"+ path + "'>" + this.windowLocationHash.split('#')[i] + "</a> > ";
} return printpath+")";
if (i == this.windowLocationHash.split('#').length - 1) printpath += "<a class='btn main-button' href='"+ path + "'>" + this.windowLocationHash.split('#')[i] + "</a>"
else printpath += "<a class='btn main-button' href='"+ path + "'>" + this.windowLocationHash.split('#')[i] + "</a> <b>></b> ";
} return printpath;
} else return "";
},
rulePath: function () {
......
......@@ -7,11 +7,16 @@
<h5>
<span style="vertical-align:-30%" >{{ displayedName }}</span>
</h5>
<a :href="'#'+name+'#modified'" v-if="this.modification_count" @click="displayModification()" id="modification_link">({{ this.modification_count }} modification<span v-if="this.modification_count > 1">s</span> en cours)</a>
<div v-if="this.modifiedHashFlag">
<a :href="'#'+name" v-if="this.modification_count" @click="displayList()" id="modification_link">Retour à la liste</a>
</div>
<div v-else>
<a :href="'#'+name+'#modified'" v-if="this.modification_count" @click="displayModification()" id="modification_link">({{ this.modification_count }} modification<span v-if="this.modification_count > 1">s</span> en cours)</a>
</div>
</div>
<div class="col-md-6 col-sm-12 col-xs-12">
<h4 v-if="isEditMode" class="pull-right"><em>Modification de la règle</em></h4>
<input v-else v-b-modal.auth-modal type="button" class="main-button btn pull-right" value="Soumettre une modification"/>
<input v-else v-b-modal.auth-modal type="button" class="main-button-primary btn pull-right" value="Soumettre une modification"/>
<!-- TODO: show gitlab link of modification if exists -->
</div>
</div>
......@@ -32,15 +37,15 @@
</ul>
</div>
<div v-show="isEditMode">
<div class="row mb-3">
<div class="col-md-6 pl-0">
<input @click="closeEdit" type="button" class="btn btn-outline-danger pull-left" value="Annuler"/>
</div>
<div class="col-md-6 pr-0">
<button v-b-modal.mail-modal class="btn btn-outline-success pull-right">Enregistrer</button>
</div>
</div>
<div class="container">
<div class="row mb-3">
<div class="col-md-6 pl-0">
<input @click="closeEdit" type="button" class="btn btn-outline-danger pull-left" value="Annuler"/>
</div>
<div class="col-md-6 pr-0">
<button v-b-modal.mail-modal class="btn main-button-primary pull-right">Enregistrer</button>
</div>
</div>
<div class="row mb-3">
<label for="content"><u>Contenu de la règle</u></label>
<textarea-autosize id="content" v-model="content" class="rule-modification-text" :class="{editErrorClass: error_flags.notModified }"></textarea-autosize>
......@@ -51,7 +56,7 @@
<input @click="closeEdit" type="button" class="btn btn-outline-danger pull-left" value="Annuler"/>
</div>
<div class="col-md-6 pr-0">
<button v-b-modal.mail-modal class="btn btn-outline-success pull-right">Enregistrer</button>
<button v-b-modal.mail-modal class="btn main-button-primary pull-right">Enregistrer</button>
</div>
</div>
</div>
......@@ -65,7 +70,7 @@
<span v-if="error_flags.noPass" class="text-danger font-weight-light">Ce champ est obligatoire<br></span>
<span v-if="!error_flags.noUser && !error_flags.noPass" class="font-weight-light">* Champs obligatoires<br></span>
<template v-slot:modal-footer>
<input @click="auth_to_edit" type="button" class="btn btn-outline-success pull-right" value="Suivant"/>
<input @click="auth_to_edit" type="button" class="btn main-button-primary pull-right" value="Suivant"/>