Commit eaa887b3 authored by Ivanq's avatar Ivanq

Move 'git clone ...', 'Fork' and 'Sign & Publish changes' to the header

parent d9e15832
......@@ -12,6 +12,14 @@
background-color: #EEE;
border-bottom: 1px solid #888;
}
.middle-buttons {
float: right;
vertical-align: top;
margin-top: -40px;
}
.middle-button-margin {
margin-left: 16px;
}
h1 {
margin: 8px 0;
......
......@@ -37,6 +37,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab tab-current">
<img src="../../img/code.svg" width="16">
......@@ -59,9 +64,6 @@
<div class="info">
<select class="select branches" id="branches"></select>
<a class="info-link" id="permanent_link" title="Link to current tree. Data won't change if branch moves">Permanent link</a>
<a class="info-link button" id="fork">Fork</a>
<a class="info-link button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
<input type="text" class="info-link input" id="git_url">
<a class="info-link button" id="view">View</a>
</div>
......
......@@ -12,6 +12,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(1);
showBranches();
showPath(true);
showLinks();
......
......@@ -37,6 +37,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab tab-current">
<img src="../../img/code.svg" width="16">
......@@ -59,9 +64,6 @@
<div class="info">
<select class="select branches" id="branches"></select>
<a class="info-link" id="permanent_link" title="Link to current tree. Data won't change if branch moves">Permanent link</a>
<a class="info-link button" id="fork">Fork</a>
<a class="info-link button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
<input type="text" class="info-link input" id="git_url">
<a class="info-link button" id="edit">Edit</a>
</div>
......
......@@ -12,6 +12,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(1);
showBranches();
showPath(true);
showLinks();
......
......@@ -35,6 +35,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab tab-current">
<img src="../img/code.svg" width="16">
......@@ -57,9 +62,6 @@
<div class="info">
<select class="select branches" id="branches"></select>
<a class="info-link" id="permanent_link" title="Link to current tree. Data won't change if branch moves">Permanent link</a>
<a class="info-link button" id="fork">Fork</a>
<a class="info-link button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
<input type="text" class="info-link input" id="git_url">
<a class="info-link button" id="new_file">New file</a>
</div>
......
......@@ -36,6 +36,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab">
<img src="../../img/code.svg" width="16">
......
......@@ -14,6 +14,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(1);
showTabs(1);
document.getElementById("new_issue").href = "new/?" + address;
......
......@@ -37,6 +37,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab">
<img src="../../../img/code.svg" width="16">
......
......@@ -12,6 +12,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(2);
showTabs(2);
document.getElementById("submit").onclick = () => {
......
......@@ -37,6 +37,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab">
<img src="../../../img/code.svg" width="16">
......
......@@ -52,6 +52,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(2);
showTabs(2);
return repo.getIssue(id, jsonId);
......
......@@ -30,6 +30,26 @@ function showTitle(title) {
document.getElementById("edit_icon").onclick = renameRepo;
}
function showHeader(level) {
document.getElementById("fork").href = "../".repeat(level) + "fork/?" + address;
let publish = document.getElementById("publish");
publish.onclick = () => {
if(publish.classList.contains("button-disabled")) {
return;
}
publish.classList.add("button-disabled");
repo.signContent()
.catch(() => {})
.then(() => {
publish.classList.remove("button-disabled");
});
};
document.getElementById("git_url").value = "git clone $path_to_zeronet/data/" + address + "/repo.git";
}
function showBranches() {
return repo.getBranches()
......@@ -88,25 +108,6 @@ function showLinks() {
document.getElementById("permanent_link").href = "?" + address + "/" + path.replace(/@/g, "@@") + "@" + commit;
});
}
document.getElementById("fork").href = "fork/?" + address;
let publish = document.getElementById("publish");
publish.onclick = () => {
if(publish.classList.contains("button-disabled")) {
return;
}
publish.classList.add("button-disabled");
repo.signContent()
.catch(() => {})
.then(() => {
publish.classList.remove("button-disabled");
});
};
document.getElementById("git_url").value = "git clone $path_to_zeronet/data/" + address + "/repo.git";
}
function renameRepo() {
......
......@@ -12,6 +12,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(0);
showBranches();
showPath(false);
showLinks();
......
......@@ -37,6 +37,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab tab-current">
<img src="../../img/code.svg" width="16">
......@@ -59,9 +64,6 @@
<div class="info">
<select class="select branches" id="branches"></select>
<a class="info-link" id="permanent_link" title="Link to current tree. Data won't change if branch moves">Permanent link</a>
<a class="info-link button" id="fork">Fork</a>
<a class="info-link button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
<input type="text" class="info-link input" id="git_url">
<a class="info-link button" id="cancel">Cancel</a>
</div>
......
......@@ -12,6 +12,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(1);
showBranches();
showPath(true);
showLinks();
......
......@@ -36,6 +36,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab">
<img src="../../img/code.svg" width="16">
......
......@@ -12,5 +12,6 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(1);
showTabs(1);
});
\ No newline at end of file
......@@ -36,6 +36,11 @@
</header>
<main class="middle">
<h1 id="repo_name"></h1>
<div id="middle_buttons" class="middle-buttons">
<input type="text" class="middle-button-margin input" id="git_url">
<a class="middle-button-margin button" id="fork">Fork</a>
<a class="middle-button-margin button button-blue" id="publish" title="Use this option after pushing">Sign &amp; Publish changes</a>
</div>
<a id="code_link" class="tab">
<img src="../../img/code.svg" width="16">
......
......@@ -21,6 +21,7 @@ repo.addMerger()
}
showTitle(content.title);
showHeader(1);
showTabs(1);
// Description
......
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