Commit 5cfc740a authored by Ivanq's avatar Ivanq

Change repo description

parent 9540bf9a
......@@ -16,7 +16,7 @@
text-decoration: none;
text-shadow: 0 1px 0 #FFF;
}
.button:active {
.button:active, .select:active {
background-image: linear-gradient(to top, #FCFCFC 0%, #EEE 100%);
}
......@@ -51,4 +51,21 @@
font-size: 24px;
line-height: 33px;
}
.input {
display: inline-block;
padding: 3px 10px 3px 8px;
border: 1px solid #D5D5D5;
border-radius: 4px;
background-image: linear-gradient(to bottom, #EEE 0%, #FCFCFC 100%);
background-repeat: no-repeat;
color: #000;
font-size: 16px;
line-height: 22px;
text-decoration: none;
text-shadow: 0 1px 0 #FFF;
}
\ No newline at end of file
......@@ -103,6 +103,14 @@ class Repository {
})
.then(() => this.sign());
}
changeDescription(description) {
return this.getContent()
.then(content => {
content.description = description;
return this.setContent(content);
})
.then(() => this.sign());
}
// Git actions
getFiles(branch, dir) {
......
......@@ -50,6 +50,17 @@
<h2 class="settings-header">Visibility settings</h2>
</div>
<div class="entry">
<div class="entry-title">
Description
<img src="../../img/info.svg" height="16" title="This description is used for indexation. Many people can index a repo, so description should never change">
</div>
<div class="entry-value">
<input type="text" class="input" id="description" placeholder="Repo description">
<a id="description_save" class="button button-blue entry-value-margin">Save</a>
</div>
</div>
<div class="entry">
<div class="entry-title">Indexation</div>
<div class="entry-value">
......
......@@ -15,6 +15,25 @@ repo.addMerger()
showTitle(content.title);
showTabs(1);
// Description
let input = document.getElementById("description");
let button = document.getElementById("description_save");
input.value = content.description;
button.onclick = () => {
if(button.classList.contains("button-disabled")) {
return;
}
button.classList.add("button-disabled");
repo.changeDescription(input.value)
.then(() => {
button.classList.remove("button-disabled");
}, () => {
button.classList.remove("button-disabled");
});
};
// Load indexation
return repo.isInIndex();
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment