diff options
author | Unknwon <u@gogs.io> | 2015-11-27 01:50:38 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-27 01:50:38 -0500 |
commit | e42fcb033d4a7ee44fe397be3e933d7031b7d8f7 (patch) | |
tree | a203fff39c92f947c4585a746e2345b3ebc67b3c /templates | |
parent | 392f3ee21016476fb9794f78882d6c447acb8449 (diff) | |
download | gitea-e42fcb033d4a7ee44fe397be3e933d7031b7d8f7.tar.gz gitea-e42fcb033d4a7ee44fe397be3e933d7031b7d8f7.zip |
wiki: finish edit
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/nav.tmpl | 67 | ||||
-rw-r--r-- | templates/repo/wiki/new.tmpl | 11 | ||||
-rw-r--r-- | templates/repo/wiki/view.tmpl | 32 |
3 files changed, 39 insertions, 71 deletions
diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl deleted file mode 100644 index dfcfd74542..0000000000 --- a/templates/repo/nav.tmpl +++ /dev/null @@ -1,67 +0,0 @@ -<div id="body-nav" class="repo-nav"> - <div class="container"> - <div class="row"> - <div class="col-md-7"> - <h3 class="name"><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Repository.Name}}">{{.Repository.Name}}</a> {{if .Repository.IsPrivate}}<span class="label label-default">Private</span>{{else if .Repository.IsMirror}}<span class="label label-default">Mirror</span>{{end}}</h3> - <p class="desc">{{.Repository.DescriptionHtml}}{{if .Repository.Website}} <a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}</p> - </div> - <div class="col-md-5 actions text-right clone-group-btn"> - {{if not .IsBareRepo}} - <div class="btn-group" id="repo-clone"> - <a class="btn btn-default" href="{{.RepoLink}}/archive/{{.BranchName}}/{{.Repository.Name}}.zip"><i class="fa fa-download fa-lg fa-m"></i></a> - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> - <span class="caret"></span> - </button> - <div class="dropdown-menu clone-group-btn dropdown-menu-right no-propagation"> - <div class="input-group"> - <span class="input-group-btn"> - <button class="btn btn-default" data-link="{{.CloneLink.SSH}}" type="button">SSH</button> - <button class="btn btn-default" data-link="{{.CloneLink.HTTPS}}" type="button">HTTPS</button> - </span> - <input type="text" class="form-control clone-group-url" value="" readonly id="repo-clone-ipt"/> - <span class="input-group-btn"> - <button class="btn btn-default" type="button" data-toggle="tooltip" title="copy to clipboard" data-placement="top" data-init="copy" data-copy-val="val" data-copy-from="#repo-clone-ipt"><i class="fa fa-copy"></i></button> - </span> - </div> - <p class="help-block text-center">Need help cloning? Visit <a target="_blank" href="https://help.github.com/articles/fork-a-repo">Help</a>!</p> - <hr/> - <div class="clone-zip text-center"> - <a class="btn btn-success btn-lg" href="{{.RepoLink}}/archive/{{.BranchName}}/{{.Repository.Name}}.zip" rel="nofollow"><i class="fa fa-suitcase"></i>Download ZIP</a> - <a class="btn btn-success btn-lg" href="{{.RepoLink}}/archive/{{.BranchName}}/{{.Repository.Name}}.tar.gz" rel="nofollow"><i class="fa fa-suitcase"></i>Download TAR.GZ</a> - </div> - </div> - </div> - {{if .IsSigned}} - <div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="repo-watching" data-watch="{{AppSubUrl}}/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="{{AppSubUrl}}/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch"> - {{if .IsRepositoryWatching}} - <button type="button" class="btn btn-default"><i class="fa fa-eye fa-lg fa-m"></i></button> - {{else}} - <button type="button" class="btn btn-default"><i class="fa fa-eye-slash fa-lg fa-m"></i></button> - {{end}} - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> - <span class="caret"></span> - </button> - <div class="dropdown-menu dropdown-menu-right"> - <div class="dropdown-item text-left to-unwatch"> - <h4 role="presentation" class="dropdown-header {{if not .IsRepositoryWatching}}text-primary{{end}}">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 text-left to-watch"> - <h4 role="presentation" class="dropdown-header {{if .IsRepositoryWatching}}text-primary{{end}}">Watching</h4> - <p class="description">You receive notifications for all conversations in this repository.</p> - </div> - </div> - </div> - {{end}} - <!-- <div class="btn-group"> - <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Star"><i class="fa fa-star"></i> {{.Repository.NumStars}}</button> - </div> --> - {{end}} - <!-- <div class="btn-group"> - <a type="button" {{if not .IsRepositoryOwner}}href="{{AppSubUrl}}/{{.Username}}/{{.Reponame}}/fork"{{end}} class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Fork"><i class="fa fa-code-fork fa-lg"></i> {{.Repository.NumForks}}</a> - </div> --> - </div> - </div> - </div> -</div> diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl index fc556e491d..6a2ce43a58 100644 --- a/templates/repo/wiki/new.tmpl +++ b/templates/repo/wiki/new.tmpl @@ -3,16 +3,23 @@ {{template "repo/header" .}} <div class="ui container"> {{template "repo/sidebar" .}} + {{template "base/alert" .}} <div class="ui header"> {{.i18n.Tr "repo.wiki.new_page"}} + {{if .PageIsWikiEdit}} + <div class="ui right"> + <a class="ui green small button" href="{{.RepoLink}}/wiki/_new">{{.i18n.Tr "repo.wiki.new_page_button"}}</a> + </div> + {{end}} </div> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} - <div class="field"> + <input type="hidden" name="old_title" value="{{.old_title}}"> + <div class="field {{if .Err_Title}}error{{end}}"> <input name="title" value="{{.title}}" autofocus required> </div> <div class="field"> - <textarea id="edit-area" name="content" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}">{{.i18n.Tr "repo.wiki.welcome"}}</textarea required> + <textarea id="edit-area" name="content" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}">{{if .PageIsWikiEdit}}{{.content}}{{else}}{{.i18n.Tr "repo.wiki.welcome"}}{{end}}</textarea required> </div> <div class="field"> <input name="message" placeholder="{{.i18n.Tr "repo.wiki.default_commit_message"}}"> diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index f41e297ec0..a23076ef2a 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -3,15 +3,43 @@ {{template "repo/header" .}} <div class="ui container"> {{template "repo/sidebar" .}} + <div class="choose page"> + <div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}"> + <div class="ui basic small button"> + <span class="text"> + {{.i18n.Tr "repo.wiki.page"}}: + <strong>{{.title}}</strong> + </span> + <i class="dropdown icon"></i> + </div> + <div class="menu"> + <div class="ui icon search input"> + <i class="filter icon"></i> + <input name="search" placeholder="{{.i18n.Tr "repo.wiki.filter_page"}}..."> + </div> + <div class="scrolling menu" {{if .IsTag}}style="display: none"{{end}}> + {{range .Pages}} + <div class="item {{if eq $.Title .Name}}selected{{end}}" data-url="{{$.RepoLink}}/wiki/{{.URL}}">{{.Name}}</div> + {{end}} + </div> + </div> + </div> + </div> <div class="ui dividing header"> - {{.Title}} + {{.title}} + {{if .IsRepositoryPusher}} + <div class="ui right"> + <a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}/_edit">{{.i18n.Tr "repo.wiki.edit_page_button"}}</a> + <a class="ui green small button" href="{{.RepoLink}}/wiki/_new">{{.i18n.Tr "repo.wiki.new_page_button"}}</a> + </div> + {{end}} <div class="ui sub header"> {{$timeSince := TimeSince .Author.When $.Lang}} {{.i18n.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}} </div> </div> <div class="ui segment markdown"> - {{.Content | Str2html}} + {{.content | Str2html}} </div> </div> </div> |