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/repo/wiki | |
parent | 392f3ee21016476fb9794f78882d6c447acb8449 (diff) | |
download | gitea-e42fcb033d4a7ee44fe397be3e933d7031b7d8f7.tar.gz gitea-e42fcb033d4a7ee44fe397be3e933d7031b7d8f7.zip |
wiki: finish edit
Diffstat (limited to 'templates/repo/wiki')
-rw-r--r-- | templates/repo/wiki/new.tmpl | 11 | ||||
-rw-r--r-- | templates/repo/wiki/view.tmpl | 32 |
2 files changed, 39 insertions, 4 deletions
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> |