From 963354c5d7e78eb9fed447ab9b9984420573649c Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 11 Oct 2014 18:02:48 -0400 Subject: Add raw, history file button, and other mirror fixes --- templates/repo/home.tmpl | 6 ++--- templates/repo/single.tmpl | 40 -------------------------------- templates/repo/single_bare.tmpl | 40 -------------------------------- templates/repo/single_file.tmpl | 51 ----------------------------------------- templates/repo/single_list.tmpl | 51 ----------------------------------------- templates/repo/view_file.tmpl | 16 +++++++++---- templates/repo/view_list.tmpl | 4 ++-- 7 files changed, 17 insertions(+), 191 deletions(-) delete mode 100644 templates/repo/single.tmpl delete mode 100644 templates/repo/single_bare.tmpl delete mode 100644 templates/repo/single_file.tmpl delete mode 100644 templates/repo/single_list.tmpl (limited to 'templates/repo') diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index e7d4c45d..49bf1fd1 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -54,16 +54,16 @@ {{end}} {{end}} - + {{if .IsFile}} {{template "repo/view_file" .}} diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl deleted file mode 100644 index d640fb00..00000000 --- a/templates/repo/single.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -{{template "base/head" .}} -{{template "base/navbar" .}} -{{template "repo/nav" .}} -{{template "repo/toolbar" .}} -
-
-
- {{ $n := len .Treenames}} - {{if not .IsFile}}{{end}} - - {{ $l := Subtract $n 1}} - -
- {{if .IsFile}} - {{template "repo/single_file" .}} - {{else}} - {{template "repo/single_list" .}} - {{end}} -
-
-{{template "base/footer" .}} diff --git a/templates/repo/single_bare.tmpl b/templates/repo/single_bare.tmpl deleted file mode 100644 index f2b19561..00000000 --- a/templates/repo/single_bare.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -{{template "base/head" .}} -{{template "base/navbar" .}} -{{template "repo/nav" .}} -{{template "repo/toolbar" .}} -
-
-
-
-

Quick Guide

-
-
-

Clone this repository

-
- - - - - - - - -
-

We recommend every repository include a README, LICENSE, and .gitignore.

-
-

Create a new repository on the command line

-
touch README.md
-git init
-git add README.md
-git commit -m "first commit"
-git remote add origin 
-git push -u origin master
-
-

Push an existing repository from the command line

-
git remote add origin 
-git push -u origin master
-
-
-
-
-{{template "base/footer" .}} diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl deleted file mode 100644 index 0ce04e13..00000000 --- a/templates/repo/single_file.tmpl +++ /dev/null @@ -1,51 +0,0 @@ -
-
- {{if .ReadmeExist}} - - {{if .ReadmeInSingle}} - {{.FileName}} - {{else}} - {{.FileName}} {{FileSize .FileSize}} - {{end}} - {{else}} - - {{.FileName}} {{FileSize .FileSize}} - {{end}} - {{if not .ReadmeInSingle}} -
- - Raw - - History - -
- {{end}} -
- - {{if not .FileIsText}} -
- {{if .IsImageFile}} - - {{else}} - View Raw - {{end}} -
- {{else}} - {{if .ReadmeExist}} -
- {{.FileContent|str2html}} -
- {{else}} -
- - - - - - - -
{{.FileContent}}
-
- {{end}} - {{end}} -
diff --git a/templates/repo/single_list.tmpl b/templates/repo/single_list.tmpl deleted file mode 100644 index 03511a80..00000000 --- a/templates/repo/single_list.tmpl +++ /dev/null @@ -1,51 +0,0 @@ -
- -
- {{.LastCommit.Author.Name}} {{TimeSince .LastCommit.Author.When}} -
- - - - - - - - - - - {{if .HasParentPath}} - - - - - - - {{end}} - {{range $item := .Files}} - {{$entry := index $item 0}} - {{$commit := index $item 1}} - - - - - - - {{end}} - - -
-{{if .ReadmeExist}} - {{template "repo/single_file" .}} -{{end}} diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 228d10cd..4e2d4fc6 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -2,15 +2,23 @@

{{if .ReadmeExist}} - {{if .ReadmeInHome}} + {{if .ReadmeInList}} {{.FileName}} {{else}} {{.FileName}}{{FileSize .FileSize}} {{end}} {{else}} - - {{.FileName}}{{FileSize .FileSize}} + + {{.FileName}}{{FileSize .FileSize}} {{end}} + {{if not .ReadmeInList}} + + + + + + + {{end}}

{{if .ReadmeExist}} @@ -20,7 +28,7 @@ {{if .IsImageFile}} {{else}} - View Raw + {{.i18n.Tr "repo.file_view_raw"}} {{end}}
{{else if .FileSize}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index e6c43d9e..032b9e0f 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -10,7 +10,7 @@ {{ShortSha .LastCommit.Id.String}} {{.LastCommit.Summary}} - {{TimeSince .LastCommit.Author.When .i18n.Lang}} + {{TimeSince .LastCommit.Author.When $.Lang}} @@ -45,7 +45,7 @@ {{$commit.Summary}} - {{TimeSince $commit.Committer.When $.i18n.Lang}} + {{TimeSince $commit.Committer.When $.Lang}} {{end}} -- cgit v1.2.3