aboutsummaryrefslogtreecommitdiff
path: root/templates/repo
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-17 20:04:58 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-17 20:04:58 +0800
commita30e72323d1f8f6be7716a0548d99ef06807172b (patch)
treeea47ee0ed1836c47edd13267aefab1daf14fefe0 /templates/repo
parent914ce405af975a6bf65cedd279e1bf75ca1671d5 (diff)
parent5bc2a1a6f98ae42ab5c30299d26082ffae54b859 (diff)
merge
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/branches.tmpl42
-rw-r--r--templates/repo/delete.tmpl12
-rw-r--r--templates/repo/nav.tmpl65
-rw-r--r--templates/repo/setting.tmpl68
-rw-r--r--templates/repo/single.tmpl89
-rw-r--r--templates/repo/toolbar.tmpl7
6 files changed, 177 insertions, 106 deletions
diff --git a/templates/repo/branches.tmpl b/templates/repo/branches.tmpl
new file mode 100644
index 00000000..63e77ab9
--- /dev/null
+++ b/templates/repo/branches.tmpl
@@ -0,0 +1,42 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+{{template "repo/nav" .}}
+{{template "repo/toolbar" .}}
+<div id="gogs-body" class="container">
+ <div id="gogs-source">
+ <div class="panel panel-default branch-box info-box">
+ <div class="panel-heading info-head">
+ <h4>Branches</h4>
+ </div>
+ <table class="panel-footer table branch-list table table-hover">
+ <thead>
+ <tr>
+ <th class="name"></th>
+ <th class="behind">Behind</th>
+ <th class="ahead">Ahead</th>
+ <th class="date">Last Commit</th>
+ <th class="action"></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="branch-main">
+ <td class="name" colspan="3">
+ <a href="#"><strong>BranchName</strong></a>
+ <button class="btn btn-primary btn-sm">base branch</button>
+ </td>
+ <td class="date">3 years ago</td>
+ <td class="action"></td>
+ </tr>
+ <tr>
+ <td class="name"><a href="#"><strong>BranchName</strong></a></td>
+ <td class="behind">102 <span class="graph" style="width: 100%"></span></td>
+ <td class="ahead"><span class="graph" style="width: 4%"></span>4</td>
+ <td class="date">3 years ago</td>
+ <td class="action"><a class="btn btn-info btn-sm" href="#">compare</a></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/delete.tmpl b/templates/repo/delete.tmpl
deleted file mode 100644
index 0b95c3fb..00000000
--- a/templates/repo/delete.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div class="container">
- <form action="/repo/delete" method="post" class="form-horizontal">
- <div class="form-group">
- <div class="col-md-offset-4 col-md-3">
- <button type="submit" class="btn btn-danger">Delete repository</button>
- </div>
- </div>
- </form>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl
index 6637062a..b41b62d5 100644
--- a/templates/repo/nav.tmpl
+++ b/templates/repo/nav.tmpl
@@ -1,42 +1,41 @@
<div id="gogs-body-nav" class="gogs-repo-nav">
<div class="container">
- <div class="gogs-repo-btns pull-right">
- <div class="btn-group" id="gogs-repo-clone">
- <button type="button" class="btn btn-default"><i class="fa fa-download"></i>Clone</button>
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
- <span class="caret"></span>
- <span class="sr-only">Toggle Dropdown</span>
- </button>
- <div class="dropdown-menu" role="menu">
- <div data-val="down-http">http link</div>
- <div data-val="down-git">git link</div>
- </div>
+ <div class="row">
+ <div class="col-md-6">
+ <h3><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / {{.Repository.Name}}</h3>
</div>
- <div class="btn-group" id="gogs-repo-watching">
- <button type="button" class="btn btn-default"><i class="fa fa-eye"></i>Watch {x}</button>
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
- <span class="caret"></span>
- <span class="sr-only">Toggle Dropdown</span>
- </button>
- <div class="dropdown-menu" role="menu">
- <div class="dropdown-item" data-val="not-watching">
- <h4 role="presentation" class="dropdown-header">Not Watching</h4>
- <p class="description">You only receive notifications for conversations in which you participate or are @mentioned.</p>
- <p class="divider"></p>
- </div>
- <div class="dropdown-item" data-val="watching">
- <h4 role="presentation" class="dropdown-header">Watching</h4>
- <p class="description">You receive notifications for all conversations in this repository.</p>
+ <div class="col-md-6 actions text-right">
+ <div class="btn-group" id="gogs-repo-clone">
+ <button type="button" class="btn btn-default"><i class="fa fa-download"></i>Clone</button>
+ <button type="button" class="btn btn-default dropdown-toggle" data-container="body" data-toggle="popover" data-placement="bottom" data-content="<label>SSH:</label><div class='input-group'><input type='text' class='form-control' value='git@{{AppDomain}}:{{.Owner.Name}}/{{.Repository.Name}}.git'></div>" data-html="1">
+ <span class="caret"></span>
+ </button>
+ </div>
+ <div class="btn-group" id="gogs-repo-watching">
+ <button type="button" class="btn btn-default"><i class="fa fa-eye"></i>Watch {x}</button>
+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ <span class="sr-only">Toggle Dropdown</span>
+ </button>
+ <div class="dropdown-menu" role="menu">
+ <div class="dropdown-item" data-val="not-watching">
+ <h4 role="presentation" class="dropdown-header">Not Watching</h4>
+ <p class="description">You only receive notifications for conversations in which you participate or are @mentioned.</p>
+ <p class="divider"></p>
+ </div>
+ <div class="dropdown-item" data-val="watching">
+ <h4 role="presentation" class="dropdown-header">Watching</h4>
+ <p class="description">You receive notifications for all conversations in this repository.</p>
+ </div>
</div>
</div>
- </div>
- <div class="btn-group">
- <button type="button" class="btn btn-default"><i class="fa fa-star"></i>Star&nbsp;&nbsp;{{.Repository.NumStars}}</button>
- </div>
- <div class="btn-group">
- <button type="button" class="btn btn-default"><i class="fa fa-code-fork"></i>Fork&nbsp;&nbsp;{{.Repository.NumForks}}</button>
+ <div class="btn-group">
+ <button type="button" class="btn btn-default"><i class="fa fa-star"></i>Star&nbsp;&nbsp;{{.Repository.NumStars}}</button>
+ </div>
+ <div class="btn-group">
+ <button type="button" class="btn btn-default"><i class="fa fa-code-fork"></i>Fork&nbsp;&nbsp;{{.Repository.NumForks}}</button>
+ </div>
</div>
</div>
- <h3><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / {{.Repository.Name}}</h3>
</div>
</div> \ No newline at end of file
diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl
index 225e2294..06f0ed4d 100644
--- a/templates/repo/setting.tmpl
+++ b/templates/repo/setting.tmpl
@@ -4,30 +4,60 @@
{{template "repo/toolbar" .}}
<div id="gogs-body" class="container">
<div id="gogs-user-setting-nav" class="col-md-3">
- <h4>Repository Settings</h4>
<ul class="list-group" data-init="tabs">
- <li class="list-group-item"><a href="#options" data-toggle="tab">Options</a></li>
- <!--<li class="list-group-item" data-toggle="tab"><a href="#">Collaborators</a></li>
- <li class="list-group-item" data-toggle="tab"><a href="#">Notifications</a></li>-->
- <li class="list-group-item"><a href="#delete" data-toggle="tab">Delete</a></li>
+ <li class="list-group-item active"><a href="/{{.Owner.Name}}/{{.Repository.Name}}/settings">Options</a></li>
+ <!--<li class="list-group-item"><a href="#">Collaborators</a></li>
+ <li class="list-group-item"><a href="#">Notifications</a></li>-->
</ul>
</div>
- <div id="gogs-repo-setting-container" class="col-md-9 tab-content">
- <div id="options" class="tab-pane">
- <h4>Repository Options</h4>
+ <div id="gogs-repo-setting-container" class="col-md-9">
+ {{if .ErrorMsg}}<p class="alert alert-danger">{{.ErrorMsg}}</p>{{end}}
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ Repository Options
+ </div>
+ <div class="panel-body">
+
+ </div>
</div>
- <div id="delete" class="tab-pane">
- <h4>Delete Repository</h4>
- <p class="alert alert-warning">Unexpected bad things will happen if you don't read this!</p>
- <p>This action <strong>CANNOT</strong> be undone. This will delete the repository, wiki, issues, and comments permanently. </p>
+ <div class="panel panel-warning">
+ <div class="panel-heading">
+ Danger Zone
+ </div>
+ <div class="panel-body">
+ <button type="button" class="btn btn-default pull-right" href="#delete-repository-modal" data-toggle="modal">
+ Delete this repository
+ </button>
+ <dd>
+ <dt>Delete this repository.</dt>
+ <dl>Once you delete a repository, there is no going back. Please be certain.</dl>
+ </dd>
- <form action="/repo/delete" method="post">
- <input type="hidden" name="userId" value="{{.Owner.Id}}"/>
- <input type="hidden" name="userName" value="{{.Owner.Name}}"/>
- <input type="hidden" name="repoId" value="{{.Repository.Id}}"/>
- <hr/>
- <button class="btn btn-danger btn-lg">I understand the consequences, delete this repository</button>
- </form>
+ <div class="modal fade" id="delete-repository-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+ <div class="modal-dialog">
+ <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="modal-content">
+ <input type="hidden" name="action" value="delete">
+
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title" id="myModalLabel">Delete repository</h4>
+ </div>
+
+ <div class="modal-body">
+ <div class="form-group">
+ <label>Please enter your repository name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
+ <input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required">
+ </div>
+ </div>
+
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+ <button class="btn btn-danger btn-lg">I understand the consequences, delete this repository</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
</div>
</div>
</div>
diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl
index c8372344..c22f129f 100644
--- a/templates/repo/single.tmpl
+++ b/templates/repo/single.tmpl
@@ -5,56 +5,61 @@
<div id="gogs-body" class="container">
<div id="gogs-source">
<div class="source-toolbar">
+ {{ $username := .Username}}
+ {{ $reponame := .Reponame}}
+ {{ $branchname := .Branchname}}
+ {{ $treenames := .Treenames}}
+ {{ $repoLink := .RepositoryLink}}
+ {{ $n := len $treenames}}
<button class="btn btn-default pull-right"><i class="fa fa-plus-square"></i>Add File</button>
<div class="dropdown branch-switch">
- <a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>master&nbsp;&nbsp;
+ <a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>{{$branchname}}&nbsp;&nbsp;
<b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a class="current" href="/{{.RepositoryLink}}/tree/master">master</a></li>
- <li><a href="/{{.RepositoryLink}}/tree/develop">develop</a></li>
+ {{range .Branches}}
+ <li><a {{if eq . $branchname}}class="current" {{end}}href="/{{$repoLink}}/tree/{{.}}">{{.}}</a></li>
+ {{end}}
</ul>
</div>
{{$paths := .Paths}}
- {{ $username := .Username}}
- {{ $reponame := .Reponame}}
- {{ $branchname := .Branchname}}
- {{ $treenames := .Treenames}}
- {{ $n := len $treenames}}
{{ $l := Subtract $n 1}}
<ol class="breadcrumb">
- <li class="root dir"><a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}">{{.Repository.Name}}</a></li>
+ <li class="root dir">
+ <a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}">{{.Repository.Name}}</a></li>
{{range $i, $v := $treenames}}
<li class="dir">
- {{if eq $i $l}}{{$v}}
- {{else}}
- <a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{index $paths $i}}">{{$v}}</a>&nbsp;
- {{end}}</li>
+ {{if eq $i $l}}{{$v}}
+ {{else}}
+ <a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{index $paths $i}}">{{$v}}</a>&nbsp;
+ {{end}}
+ </li>
{{end}}
</ol>
</div>
<div class="panel panel-default info-box">
<div class="panel-heading info-head">
- Merge branch 'release/1.1.1'
+ <a href="/{{$username}}/{{$reponame}}/commit/{{.LatestCommit.SHA}}">{{.LatestCommit.Message}}</a>
</div>
<div class="panel-body info-content">
- slene authored 4 days ago
+ <a href="/user/{{.LatestCommit.Author}}">{{.LatestCommit.Author}}</a> <span class="text-muted">{{TimeSince .LatestCommit.Date}}</span>
</div>
<table class="panel-footer table file-list">
<thead class="hidden">
- <tr>
- <th class="icon"></th>
- <th class="name">Filename</th>
- <th class="text">Message</th>
- <th class="date">Date modified</th>
- </tr>
+ <tr>
+ <th class="icon"></th>
+ <th class="name">Filename</th>
+ <th class="text">Message</th>
+ <th class="date">Date modified</th>
+ </tr>
</thead>
<tbody>
- {{range .Files}}
- <tr {{if .IsDir}}class="is-dir"{{end}}>
- <td class="icon">
- <i class="fa {{if .IsDir}}fa-folder{{else}}fa-file-text-o{{end}}"></i>
- </td>
- <td class="name">
+ {{range .Files}}
+ <tr
+ {{if .IsDir}}class="is-dir"{{end}}>
+ <td class="icon">
+ <i class="fa {{if .IsDir}}fa-folder{{else}}fa-file-text-o{{end}}"></i>
+ </td>
+ <td class="name">
<span class="wrap">
{{if .IsDir}}
<a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{.Path}}">{{.Name}}</a>
@@ -62,29 +67,35 @@
<a href="/{{$username}}/{{$reponame}}/blob/{{$branchname}}/{{.Name}}">{{.Name}}</a>
{{end}}
</span>
- </td>
- <td class="text">
+ </td>
+ <td class="text">
<span class="wrap">
{{.Message}}
</span>
- </td>
- <td class="date">
+ </td>
+ <td class="date">
<span class="wrap">
{{TimeSince .Created}}
</span>
- </td>
- </tr>
- {{end}}
+ </td>
+ </tr>
+ {{end}}
</tbody>
</table>
</div>
<div class="panel panel-default file-content">
- <div class="panel-heading">
- README.md
- </div>
- <div class="panel-body markdown">
- httplib
+ <div class="panel-heading file-head">
+ <i class="icon fa fa-book"></i> README.md
</div>
+ {{if .FileIsLarge}}
+ <div class="panel-footer">
+ Large file size 1000kb
+ </div>
+ {{else}}
+ <div class="panel-body file-body markdown">
+ {{.ReadmeContent|str2html}}
+ </div>
+ {{end}}
</div>
</div>
</div>
diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl
index 4a0b60ad..49a37ef4 100644
--- a/templates/repo/toolbar.tmpl
+++ b/templates/repo/toolbar.tmpl
@@ -4,9 +4,10 @@
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="{{if .IsRepoToolbarSource}}active{{end}}"><a href="/{{.RepositoryLink}}">Source</a></li>
- <li><a href="/{{.RepositoryLink}}/commits">Commits</a></li>
- <li><a href="/{{.RepositoryLink}}/issues">Issues <!--<span class="badge">42</span>--></a></li>
- <li><a href="/{{.RepositoryLink}}/pulls">Pull Requests</a></li>
+ <li class="{{if .IsRepoToolbarCommits}}active{{end}}"><a href="/{{.RepositoryLink}}/commits">Commits</a></li>
+ <li class="{{if .IsRepoToolbarBranches}}active{{end}}"><a href="/{{.RepositoryLink}}/branches">Branches</a></li>
+ <li class="{{if .IsRepoToolbarPulls}}active{{end}}"><a href="/{{.RepositoryLink}}/pulls">Pull Requests</a></li>
+ <li class="{{if .IsRepoToolbarIssues}}active{{end}}"><a href="/{{.RepositoryLink}}/issues">Issues <!--<span class="badge">42</span>--></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
<ul class="dropdown-menu">