mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
(refs #108)Add ZIP download button to the repository viewer tab.
This commit is contained in:
@@ -11,6 +11,7 @@ import org.eclipse.jgit.api.Git
|
|||||||
import org.eclipse.jgit.lib._
|
import org.eclipse.jgit.lib._
|
||||||
import org.apache.commons.io.FileUtils
|
import org.apache.commons.io.FileUtils
|
||||||
import org.eclipse.jgit.treewalk._
|
import org.eclipse.jgit.treewalk._
|
||||||
|
import org.eclipse.jgit.api.errors.RefNotFoundException
|
||||||
|
|
||||||
class RepositoryViewerController extends RepositoryViewerControllerBase
|
class RepositoryViewerController extends RepositoryViewerControllerBase
|
||||||
with RepositoryService with AccountService with ReferrerAuthenticator
|
with RepositoryService with AccountService with ReferrerAuthenticator
|
||||||
@@ -186,6 +187,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
|||||||
using(Git.cloneRepository
|
using(Git.cloneRepository
|
||||||
.setURI(getRepositoryDir(repository.owner, repository.name).toURI.toString)
|
.setURI(getRepositoryDir(repository.owner, repository.name).toURI.toString)
|
||||||
.setDirectory(cloneDir)
|
.setDirectory(cloneDir)
|
||||||
|
.setBranch(revision)
|
||||||
.call){ git =>
|
.call){ git =>
|
||||||
|
|
||||||
// checkout the specified revision
|
// checkout the specified revision
|
||||||
|
|||||||
@@ -26,4 +26,9 @@
|
|||||||
<input type="text" value="@repository.url" id="repository-url" readonly>
|
<input type="text" value="@repository.url" id="repository-url" readonly>
|
||||||
}
|
}
|
||||||
</li>
|
</li>
|
||||||
|
<li class="pull-right" style="margin-right: 8px;">
|
||||||
|
<div class="pull-right">
|
||||||
|
<a href="@{url(repository)}/archive/@{id}.zip" class="btn"><i class="icon-download-alt"></i>ZIP</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ pre.commit-description {
|
|||||||
#repository-url {
|
#repository-url {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
width: 350px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul#commit-file-list {
|
ul#commit-file-list {
|
||||||
|
|||||||
Reference in New Issue
Block a user