From dccc50e9d4d217cea91d76f17fa60bf5c0a6fb03 Mon Sep 17 00:00:00 2001
From: fuxiaohei <fuxiaohei@vip.qq.com>
Date: Sat, 27 Sep 2014 17:08:57 +0800
Subject: [PATCH 1/3] template and ui fix

---
 public/ng/css/gogs.css              | 9 ++++++++-
 public/ng/less/gogs/dashboard.less  | 4 ++++
 public/ng/less/gogs/repository.less | 3 ++-
 templates/repo/home.tmpl            | 2 +-
 templates/repo/sidebar.tmpl         | 2 +-
 templates/repo/view_file.tmpl       | 4 ++--
 6 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css
index dbaa3db1c9..7116afc0cd 100644
--- a/public/ng/css/gogs.css
+++ b/public/ng/css/gogs.css
@@ -709,6 +709,7 @@ ol.linenums {
 #dashboard-header {
   border-bottom: 1px solid #d6d6d6;
   height: 69px;
+  background-color: #FFF;
 }
 #dashboard-header > .menu-line > li {
   padding: 12px 6px;
@@ -824,6 +825,11 @@ ol.linenums {
 #dashboard-my-repo .repo-contrib-header {
   border-top: 1px solid #d6d6d6;
 }
+#dashboard-my-mirror .panel-header,
+#dashboard-my-org .panel-header,
+#dashboard-my-repo .panel-header {
+  font-size: 14px;
+}
 #dashboard-my-repo .panel-header .octicon {
   margin-right: 6px;
   font-size: 12px;
@@ -1244,7 +1250,8 @@ The register and sign-in page style
   font-weight: normal;
   color: #888;
 }
-#repo-readme {
+#repo-readme,
+#repo-read-file {
   margin-bottom: 80px;
 }
 #repo-bare-start {
diff --git a/public/ng/less/gogs/dashboard.less b/public/ng/less/gogs/dashboard.less
index 24c433a31a..cf1b87cc6f 100644
--- a/public/ng/less/gogs/dashboard.less
+++ b/public/ng/less/gogs/dashboard.less
@@ -12,6 +12,7 @@
 #dashboard-header {
   border-bottom: 1px solid @dashboardHeaderBorderColor;
   height: 69px;
+  background-color: #FFF;
   > .menu-line {
     > li {
       padding: 12px 6px;
@@ -125,6 +126,9 @@
   .repo-contrib-header {
     border-top: 1px solid #d6d6d6;
   }
+  .panel-header{
+    font-size: 14px;
+  }
 }
 #dashboard-my-repo {
   .panel-header {
diff --git a/public/ng/less/gogs/repository.less b/public/ng/less/gogs/repository.less
index 7d6cdd0a5d..236271d47c 100644
--- a/public/ng/less/gogs/repository.less
+++ b/public/ng/less/gogs/repository.less
@@ -301,7 +301,8 @@
     }
   }
 }
-#repo-readme {
+#repo-readme,
+#repo-read-file{
   margin-bottom: 80px;
 }
 #repo-bare-start {
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 32fbf58226..a9d7f30403 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -3,7 +3,7 @@
 <div id="repo-wrapper">
     {{template "repo/header" .}}
     <div id="repo-content" class="clear container">
-        <div id="repo-main" class="left grid-4-5">
+        <div id="repo-main" class="left grid-5-6">
             <p id="repo-desc">
                 <span class="description">{{.Repository.DescriptionHtml}}</span>
                 <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
diff --git a/templates/repo/sidebar.tmpl b/templates/repo/sidebar.tmpl
index a4fa17b757..d43e36063d 100644
--- a/templates/repo/sidebar.tmpl
+++ b/templates/repo/sidebar.tmpl
@@ -1,4 +1,4 @@
-<div id="repo-sidebar" class="right grid-1-5">
+<div id="repo-sidebar" class="right grid-1-6">
     <ul class="menu menu-vertical" id="repo-sidebar-nav">
         <li>
             <a class="radius" href="{{.RepoLink}}/issues"><i class="octicon octicon-issue-opened"></i>{{.i18n.Tr "repo.issues"}}<span class="num right label label-blue label-radius">{{.Repository.NumOpenIssues}}</span></a>
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 96efcdac54..228d10cd99 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -1,4 +1,4 @@
-<div class="panel panel-radius" id="repo-readme">
+<div class="panel panel-radius" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
     <p class="panel-header">
         {{if .ReadmeExist}}
             <i class="icon fa fa-book fa-lg"></i>
@@ -12,7 +12,7 @@
         <strong class="file-name">{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
 	    {{end}}
     </p>
-    <div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view">
+    <div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view" id="repo-code-view">
     	{{if .ReadmeExist}}
     	{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
         {{else if not .IsFileText}}

From e3a27aeb25f5de7daaf279ec049830628e2cc3a6 Mon Sep 17 00:00:00 2001
From: fuxiaohei <fuxiaohei@vip.qq.com>
Date: Sat, 27 Sep 2014 17:31:44 +0800
Subject: [PATCH 2/3] template and ui fix

---
 public/ng/css/gogs.css              |  15 ++--
 public/ng/less/gogs/issue.less      |  11 +--
 public/ng/less/gogs/repository.less | 105 +++++++++++++++-------------
 templates/repo/home.tmpl            |   6 +-
 templates/repo/pulls.tmpl           |   2 +-
 5 files changed, 76 insertions(+), 63 deletions(-)

diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css
index 7116afc0cd..2d2ab7f3a0 100644
--- a/public/ng/css/gogs.css
+++ b/public/ng/css/gogs.css
@@ -1059,6 +1059,10 @@ The register and sign-in page style
 #repo-content {
   padding: 18px 0;
 }
+.repo-wide-wrapper {
+  padding: 18px 0;
+  position: relative;
+}
 #repo-clone-url {
   border-right: none;
   width: 190px;
@@ -1083,6 +1087,9 @@ The register and sign-in page style
 #repo-desc {
   font-size: 1.2em;
 }
+#repo-desc .no-description {
+  color: #999;
+}
 #repo-sidebar-nav .label {
   font-size: 12px;
   line-height: 1.4em;
@@ -1461,6 +1468,10 @@ The register and sign-in page style
 #commits-list {
   padding-top: 20px;
 }
+#commits-list h4 {
+  line-height: 30px;
+  margin-bottom: 0;
+}
 .commit-list th {
   background-color: #FFF;
   line-height: 28px !important;
@@ -1642,10 +1653,6 @@ The register and sign-in page style
 #user-ssh-add-form .field {
   margin-bottom: 24px;
 }
-.repo-issue-wrapper {
-  padding: 18px 0;
-  position: relative;
-}
 .pr-main {
   margin-right: 100px;
 }
diff --git a/public/ng/less/gogs/issue.less b/public/ng/less/gogs/issue.less
index d5ab081764..aaeb1af325 100644
--- a/public/ng/less/gogs/issue.less
+++ b/public/ng/less/gogs/issue.less
@@ -1,23 +1,16 @@
 @import "../ui/var";
-.repo-issue-wrapper {
-  padding: 18px 0;
-  position: relative;
-}
-
 // pull request main content
 .pr-main {
   margin-right: 100px;
 }
-
 // right bar in pull request page
 .pr-sidebar {
   border-left: 1px solid #DDD;
   box-sizing: border-box;
   position: absolute;
-  right:0;
-  top:12px;
+  right: 0;
+  top: 12px;
 }
-
 .pr-title {
   .pr-num {
     font-weight: normal;
diff --git a/public/ng/less/gogs/repository.less b/public/ng/less/gogs/repository.less
index 236271d47c..daa8983bcb 100644
--- a/public/ng/less/gogs/repository.less
+++ b/public/ng/less/gogs/repository.less
@@ -6,12 +6,12 @@
 /* repository main */
 
 #repo-wrapper {
-    padding-bottom: 100px;
+  padding-bottom: 100px;
 }
 #repo-header {
-    height: 69px;
-    border-bottom: 1px solid@repoHeaderBorderColor;
-    background-color: @repoHeaderBgColor;
+  height: 69px;
+  border-bottom: 1px solid@repoHeaderBorderColor;
+  background-color: @repoHeaderBgColor;
 }
 #repo-header-name {
   line-height: 66px;
@@ -91,6 +91,10 @@
 #repo-content {
   padding: 18px 0;
 }
+.repo-wide-wrapper {
+  padding: 18px 0;
+  position: relative;
+}
 #repo-clone-url {
   border-right: none;
   width: 190px;
@@ -114,6 +118,9 @@
 }
 #repo-desc {
   font-size: 1.2em;
+  .no-description{
+    color: #999;
+  }
 }
 #repo-sidebar-nav {
   .label {
@@ -136,14 +143,14 @@
     padding-left: 12px;
     width: 24px;
     text-align: center;
-    > i.octicon{
+    > i.octicon {
       font-size: 21px;
     }
   }
-  .num{
+  .num {
     position: absolute;
     font-size: 12px;
-    top:0;
+    top: 0;
     left: 36px;
     padding: 0 2px;
     min-width: 16px;
@@ -197,34 +204,34 @@
   box-sizing: border-box;
 }
 #repo-branch-tag {
-    .tab-nav {
-        border-bottom: 1px solid #EAEAEA;
-        a {
-            padding: .3em .8em;
-        }
-        .js-tab-nav-show {
-            background-color: #EEE;
-            font-weight: bold;
-        }
+  .tab-nav {
+    border-bottom: 1px solid #EAEAEA;
+    a {
+      padding: .3em .8em;
     }
-    .switching-list {
-        max-height: 300px;
-        overflow-y: auto;
+    .js-tab-nav-show {
+      background-color: #EEE;
+      font-weight: bold;
     }
+  }
+  .switching-list {
+    max-height: 300px;
+    overflow-y: auto;
+  }
 }
 #repo-branch-list,
 #repo-tag-list {
-    li {
-        i {
-            margin-right: 12px;
-            opacity: 0;
-        }
+  li {
+    i {
+      margin-right: 12px;
+      opacity: 0;
     }
-    li.checked {
-        i {
-            opacity: 1;
-        }
+  }
+  li.checked {
+    i {
+      opacity: 1;
     }
+  }
 }
 #repo-bread {
   .bread {
@@ -302,7 +309,7 @@
   }
 }
 #repo-readme,
-#repo-read-file{
+#repo-read-file {
   margin-bottom: 80px;
 }
 #repo-bare-start {
@@ -495,25 +502,29 @@
   list-style: none;
 }
 #commits-list {
-    padding-top: 20px;
+  padding-top: 20px;
+  h4{
+    line-height: 30px;
+    margin-bottom: 0;
+  }
 }
 .commit-list {
-    th {
-        background-color: #FFF;
-        line-height: 28px !important;
-    }
-    .date {
-        width: 120px;
-    }
-    .author {
-        padding-left: 20px;
-        min-width: 180px;
-        img {
-            margin-top: -4px;
-        }
-    }
-    .sha a {
-        font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace;
-        font-size: 14px;
+  th {
+    background-color: #FFF;
+    line-height: 28px !important;
+  }
+  .date {
+    width: 120px;
+  }
+  .author {
+    padding-left: 20px;
+    min-width: 180px;
+    img {
+      margin-top: -4px;
     }
+  }
+  .sha a {
+    font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace;
+    font-size: 14px;
+  }
 }
\ No newline at end of file
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index a9d7f30403..476277a807 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -4,9 +4,11 @@
     {{template "repo/header" .}}
     <div id="repo-content" class="clear container">
         <div id="repo-main" class="left grid-5-6">
-            <p id="repo-desc">
+            <p id="repo-desc">{{if .Repository.DescriptionHtml}}
                 <span class="description">{{.Repository.DescriptionHtml}}</span>
-                <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
+                <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{else}}
+                <span class="no-description text-italic"><i>No Description</i></span>
+                {{end}}
             </p>
             <ul id="repo-file-nav" class="clear menu menu-line">
                 <!-- <li>
diff --git a/templates/repo/pulls.tmpl b/templates/repo/pulls.tmpl
index a36c50ab0b..bfb0905557 100644
--- a/templates/repo/pulls.tmpl
+++ b/templates/repo/pulls.tmpl
@@ -2,7 +2,7 @@
 {{template "ng/base/header" .}}
 <div id="repo-wrapper">
     {{template "repo/header" .}}
-    <div class="clear container repo-issue-wrapper repo-pr">
+    <div class="clear container repo-wide-wrapper repo-pr">
         <div class="pr-main">
             <div class="pr-title clear">
                 <h2 class="pr-title grid-5-6 left">Fix: Repo Name can not be converted to lower in some cases <span class="pr-num">#256</span></h2>

From 7d48f811f16d3565f161a44e4e98c451cf6c857e Mon Sep 17 00:00:00 2001
From: fuxiaohei <fuxiaohei@vip.qq.com>
Date: Sat, 27 Sep 2014 19:03:07 +0800
Subject: [PATCH 3/3] add issue router for new issue page ui preview

---
 cmd/web.go                      | 1 +
 routers/repo/issue.go           | 6 ++++++
 templates/repo/issue2/list.tmpl | 6 ++++++
 3 files changed, 13 insertions(+)
 create mode 100644 templates/repo/issue2/list.tmpl

diff --git a/cmd/web.go b/cmd/web.go
index 8a87f86bb1..fc417618eb 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -345,6 +345,7 @@ func runWeb(*cli.Context) {
 		r.Get("/pulls", repo.Pulls)
 		r.Get("/branches", repo.Branches)
 		r.Get("/archive/*", repo.Download)
+		r.Get("/issues2/",repo.Issues2)
 	}, ignSignIn, middleware.RepoAssignment(true))
 
 	m.Group("/:username/:reponame", func(r *macaron.Router) {
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index f854a22bbc..e611032e37 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -1119,3 +1119,9 @@ func IssueGetAttachment(ctx *middleware.Context) {
 	// We must put the name in " manually.
 	ctx.ServeFile(attachment.Path, "\""+attachment.Name+"\"")
 }
+
+// testing route handler for new issue ui page
+// todo : move to Issue() function
+func Issues2(ctx *middleware.Context){
+	ctx.HTML(200,"repo/issue2/list")
+}
diff --git a/templates/repo/issue2/list.tmpl b/templates/repo/issue2/list.tmpl
new file mode 100644
index 0000000000..9616199e19
--- /dev/null
+++ b/templates/repo/issue2/list.tmpl
@@ -0,0 +1,6 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+    {{template "repo/header" .}}
+</div>
+{{template "ng/base/footer" .}}
\ No newline at end of file