diff options
author | Andrew Boyarshin <andrew.boyarshin@gmail.com> | 2017-02-14 08:13:59 +0700 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-14 09:13:59 +0800 |
commit | dc8248f8a49e4801e119008a32b28cd2ad6e1a57 (patch) | |
tree | f3749cdfb1b4766e6f9d7d601f2de7654b747087 /templates | |
parent | 5cc275b1defc56d54bec23d1a5740c3fadcff2b0 (diff) | |
download | gitea-dc8248f8a49e4801e119008a32b28cd2ad6e1a57.tar.gz gitea-dc8248f8a49e4801e119008a32b28cd2ad6e1a57.zip |
Markdown rendering overhaul (#186)
* Markdown rendering overhaul
Cleaned up and squashed commits into single one.
Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com>
* Fix markdown API, add markdown module and API tests, improve code coverage
Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base/footer.tmpl | 1 | ||||
-rw-r--r-- | templates/repo/wiki/pages.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/wiki/view.tmpl | 25 |
3 files changed, 25 insertions, 3 deletions
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 08a079ebb6..1a9202d271 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -60,6 +60,7 @@ {{if .RequireDropzone}} <script src="{{AppSubUrl}}/plugins/dropzone-4.2.0/dropzone.js"></script> {{end}} + <script src="{{AppSubUrl}}/js/libs/autolink.js"></script> <script src="{{AppSubUrl}}/js/libs/emojify-1.1.0.min.js"></script> <script src="{{AppSubUrl}}/js/libs/clipboard-1.5.9.min.js"></script> </body> diff --git a/templates/repo/wiki/pages.tmpl b/templates/repo/wiki/pages.tmpl index 1cfbddce5a..123e65bc23 100644 --- a/templates/repo/wiki/pages.tmpl +++ b/templates/repo/wiki/pages.tmpl @@ -4,9 +4,11 @@ <div class="ui container"> <div class="ui header"> {{.i18n.Tr "repo.wiki.pages"}} + {{if and .IsRepositoryWriter (not .IsRepositoryMirror)}} <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> <table class="ui table"> <tbody> diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index b8b0d2702a..9a1a984b63 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -50,7 +50,7 @@ </div> </div> </div> - <div class="ui dividing header"> + <div class="ui header"> {{.title}} {{if and .IsRepositoryWriter (not .Repository.IsMirror)}} <div class="ui right"> @@ -64,9 +64,28 @@ {{.i18n.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}} </div> </div> - <div class="ui segment markdown"> - {{.content | Str2html}} + {{if .FormatWarning}} + <div class="ui negative message"> + <p>{{.FormatWarning}}</p> + </div> + {{end}} + <div class="ui {{if .sidebarPresent}}grid equal width{{end}}" style="margin-top: 1rem;"> + <div class="ui {{if .sidebarPresent}}eleven wide column{{end}} segment markdown"> + {{.content | Str2html}} + </div> + {{if .sidebarPresent}} + <div class="column" style="padding-top: 0;"> + <div class="ui segment"> + {{.sidebarContent | Str2html}} + </div> + </div> + {{end}} + </div> + {{if .footerPresent}} + <div class="ui grey segment"> + {{.footerContent | Str2html}} </div> + {{end}} </div> </div> |