]> source.dussan.org Git - gitea.git/commitdiff
fix #1960
authorUnknwon <u@gogs.io>
Mon, 16 Nov 2015 16:11:59 +0000 (11:11 -0500)
committerUnknwon <u@gogs.io>
Mon, 16 Nov 2015 16:11:59 +0000 (11:11 -0500)
13 files changed:
README.md
cmd/web.go
gogs.go
models/user.go
modules/avatar/avatar.go
public/css/gogs.css
public/less/_base.less
public/less/_explore.less
public/less/_user.less
templates/.VERSION
templates/explore/repos.tmpl
templates/repo/issue/navbar.tmpl
templates/user/profile.tmpl

index 8be1adc6f6111e87ae342cc91c0b8598fe4ac9f0..1e363ded54bbe03b147fa65b0e915447291ca1f2 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
 
 ![](public/img/gogs-large-resize.png)
 
-##### Current version: 0.7.12 Beta
+##### Current version: 0.7.13 Beta
 
 <table>
     <tr>
index 095ddeb1f0fdda19d00503dd9fae0afa60848c0a..dfe47021c74ae6ad900e29fa29dd230db2771a84 100644 (file)
@@ -515,10 +515,13 @@ func runWeb(ctx *cli.Context) {
                m.Group("", func() {
                        m.Get("/releases", repo.Releases)
                        m.Get("/^:type(issues|pulls)$", repo.RetrieveLabels, repo.Issues)
-                       m.Get("/^:type(issues|pulls)$/:index", repo.ViewIssue)
                        m.Get("/labels/", repo.RetrieveLabels, repo.Labels)
                        m.Get("/milestones", repo.Milestones)
-               }, middleware.RepoRef())
+               }, middleware.RepoRef(),
+                       func(ctx *middleware.Context) {
+                               ctx.Data["PageIsList"] = true
+                       })
+               m.Get("/^:type(issues|pulls)$/:index", repo.ViewIssue)
 
                m.Get("/branches", repo.Branches)
                m.Get("/archive/*", repo.Download)
diff --git a/gogs.go b/gogs.go
index 157133eda6fe1e67d4156ba5901ce71a223d299b..f8a39f3fc857c7a8864d2401e2991e3adab42da0 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
        "github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.7.12.1116 Beta"
+const APP_VER = "0.7.13.1116 Beta"
 
 func init() {
        runtime.GOMAXPROCS(runtime.NumCPU())
index 18dce976f6d763f3554ad167d9205a52463e074c..3131a88d55bafac41cb1212588c7b1813f7e3b78 100644 (file)
@@ -265,7 +265,7 @@ func (u *User) UploadAvatar(data []byte) error {
                return fmt.Errorf("Decode: %v", err)
        }
 
-       m := resize.Resize(234, 234, img, resize.NearestNeighbor)
+       m := resize.Resize(290, 290, img, resize.NearestNeighbor)
 
        sess := x.NewSession()
        defer sessionRelease(sess)
index 60f7e2ecb703695f3ddd927c696c74d60d2011a0..b25b1bfe4e97df4428ebec403d0d89ee20946ee3 100644 (file)
@@ -104,7 +104,7 @@ func New(hash string, cacheDir string) *Avatar {
                expireDuration: time.Minute * 10,
                reqParams: url.Values{
                        "d":    {"retro"},
-                       "size": {"200"},
+                       "size": {"290"},
                        "r":    {"pg"}}.Encode(),
                imagePath: filepath.Join(cacheDir, hash+".image"), //maybe png or jpeg
        }
@@ -194,7 +194,7 @@ func (this *service) mustInt(r *http.Request, defaultValue int, keys ...string)
 func (this *service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
        urlPath := r.URL.Path
        hash := urlPath[strings.LastIndex(urlPath, "/")+1:]
-       size := this.mustInt(r, 80, "s", "size") // default size = 80*80
+       size := this.mustInt(r, 290, "s", "size") // default size = 290*290
 
        avatar := New(hash, this.cacheDir)
        avatar.AlterImage = this.altImage
index 6300dfaa6681c563f157d0930570eea7406627e8..db86e3de3495d2931bce1dce309980d475d15570 100755 (executable)
@@ -848,6 +848,9 @@ pre.raw {
 .ui .text.yellow {
   color: #FBBD08 !important;
 }
+.ui .text.gold {
+  color: #a1882b !important;
+}
 .ui .text.left {
   text-align: left !important;
 }
@@ -2688,6 +2691,23 @@ footer .container .links > *:first-child {
 .user.settings .email.list .item:not(:first-child) .button {
   margin-top: -10px;
 }
+.user.profile .ui.card .username {
+  display: block;
+}
+.user.profile .ui.card .extra.content {
+  padding: 0;
+}
+.user.profile .ui.card .extra.content ul {
+  margin: 0;
+  padding: 0;
+}
+.user.profile .ui.card .extra.content ul li {
+  padding: 10px;
+  list-style: none;
+}
+.user.profile .ui.card .extra.content ul li:not(:last-child) {
+  border-bottom: 1px solid #eaeaea;
+}
 .dashboard {
   padding-top: 15px;
   padding-bottom: 80px;
@@ -2820,24 +2840,26 @@ footer .container .links > *:first-child {
   padding-top: 15px;
   padding-bottom: 80px;
 }
-.explore.repositories .ui.repository.list .item {
+.ui.repository.list .item {
+  padding-bottom: 25px;
+}
+.ui.repository.list .item:not(:first-child) {
   border-top: 1px solid #eee;
   padding-top: 25px;
-  padding-bottom: 25px;
 }
-.explore.repositories .ui.repository.list .item .ui.header {
+.ui.repository.list .item .ui.header {
   font-size: 1.5rem;
   padding-bottom: 10px;
 }
-.explore.repositories .ui.repository.list .item .ui.header .metas {
+.ui.repository.list .item .ui.header .metas {
   color: #888;
   font-size: 13px;
   font-weight: normal;
 }
-.explore.repositories .ui.repository.list .item .ui.header .metas span:not(:last-child) {
+.ui.repository.list .item .ui.header .metas span:not(:last-child) {
   margin-right: 5px;
 }
-.explore.repositories .ui.repository.list .item .time {
+.ui.repository.list .item .time {
   font-size: 12px;
   color: #808080;
 }
index fca214b396cc3879eb6ddc0c2e6b7a5686eb6f9a..086c687709d7cdee1c2ef47ee3781460beeabc6b 100644 (file)
@@ -139,6 +139,9 @@ pre {
                &.yellow {
                        color: #FBBD08 !important;
                }
+               &.gold {
+                       color: #a1882b !important;
+               }
 
                &.left {
                        text-align: left !important;
index 5d6be537773f4e7a93060c81bedfa673a245f0ce..b510c71a108c293376c7b9aba190f39ab8b4ce59 100644 (file)
@@ -1,30 +1,32 @@
 .explore {
        padding-top: 15px;
        padding-bottom: @footer-margin * 2;
+}
 
-       &.repositories {
-               .ui.repository.list {
-                       .item {
-                               border-top: 1px solid #eee;
-                               padding-top: 25px;
-                               padding-bottom: 25px;
-                               .ui.header {
-                                       font-size: 1.5rem;
-                                       padding-bottom: 10px;
-                                       .metas {
-                                               color: #888;
-                                               font-size: 13px;
-                                               font-weight: normal;
-                                               span:not(:last-child) {
-                                                       margin-right: 5px;
-                                               }
-                                       }
-                               }
-                               .time {
-                           font-size: 12px;
-                           color: #808080;
+.ui.repository.list {
+       .item {
+               padding-bottom: 25px;
+
+               &:not(:first-child) {
+                       border-top: 1px solid #eee;
+                       padding-top: 25px;
+               }
+
+               .ui.header {
+                       font-size: 1.5rem;
+                       padding-bottom: 10px;
+                       .metas {
+                               color: #888;
+                               font-size: 13px;
+                               font-weight: normal;
+                               span:not(:last-child) {
+                                       margin-right: 5px;
                                }
                        }
                }
+               .time {
+           font-size: 12px;
+           color: #808080;
+               }
        }
 }
\ No newline at end of file
index c403e3580d795edd38369cb4853fe8c6baad5025..bf0de5068a7937e7acffb5a9ec9a69305c088398 100644 (file)
                        }
                }
        }
+
+       &.profile {
+               .ui.card {
+                       .username {
+                               display: block;
+                       }
+                       .extra.content {
+                               padding: 0;
+
+                               ul {
+                                       margin: 0;
+                                       padding: 0;
+
+                                       li {
+                                               padding: 10px;
+                                               list-style: none;
+
+                                               &:not(:last-child) {
+                                                       border-bottom: 1px solid #eaeaea;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
 }
\ No newline at end of file
index 3501f1632e85f6b1c4e706fe3abd9bb86953c872..87a10ba387967322229697b8048cd1c391f0eaf2 100644 (file)
@@ -1 +1 @@
-0.7.12.1116 Beta
\ No newline at end of file
+0.7.13.1116 Beta
\ No newline at end of file
index 75940e1150db5bbb010f94bfb1f1fb84b21af0f1..6654a315d05befb343dd0de8617d20113ecb53ab 100644 (file)
@@ -5,7 +5,7 @@
                        {{template "explore/navbar" .}}
                        <div class="twelve wide column content">
                                <div class="ui repository list">
-                                       {{range $i, $v := .Repos}}
+                                       {{range .Repos}}
                                        <div class="item">
                                                <div class="ui header">
                                                        <a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">{{.Owner.Name}} / {{.Name}}</a>
index 7fdc41aa2114131bf6c6af1fdf37dd3ed32d4cba..d6d1074c6d5ac8dea5ea37a0d6ccbb9318b3819c 100644 (file)
@@ -1,5 +1,5 @@
 <div class="ui compact small menu">
-       {{if not .CommitsCount}}
+       {{if not .PageIsList}}
   <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">{{.i18n.Tr "repo.issues"}}</a>
   <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">{{.i18n.Tr "repo.pulls"}}</a>
   {{end}}
index abb2f194792eb76664b84cfea6b6df40d6da32ca..069529ca3b9399e117be3f429db443aa55e5e264 100644 (file)
-{{template "ng/base/head" .}}
-{{template "ng/base/header" .}}
-<div class="main-wrapper">
-    <div id="user-profile-page" class="container clear">
-        <div class="grid-1-5 left">
-            <div>
-                {{if and (.Owner.UseCustomAvatar) (eq .SignedUserName .Owner.Name)}}
-                <a href="{{AppSubUrl}}/user/settings" id="profile-avatar" original-title="{{.i18n.Tr "user.change_custom_avatar"}}">
-                {{else if eq .SignedUserName .Owner.Name}}
-                <a href="http://gravatar.com/emails/" id="profile-avatar" original-title="{{.i18n.Tr "user.change_avatar"}}">
-                {{else}}
-                <a id="profile-avatar">
-                {{end}}
-                    <img class="profile-avatar" src="{{.Owner.AvatarLink}}?s=234" title="{{.Owner.Name}}"/>
-                </a>
-                <div class="text-center" id="profile-name">
-                    {{if .Owner.FullName}}<span id="profile-fullname" class="center-block">{{.Owner.FullName}}</span><br>{{end}}
-                    <span class="center-block" id="profile-username">{{.Owner.Name}}</span>
-                </div>
-            </div>
-            <div class="profile-info">
-                <hr>
-                <ul class="list-no-style">
-                    {{if .Owner.Location}}
-                    <li class="list-group-item"><i class="octicon octicon-location"></i>&nbsp;&nbsp;{{.Owner.Location}}</li>
-                    {{end}}
-                    {{if and .Owner.Email .IsSigned}}
-                    <li class="list-group-item"><i class="octicon octicon-mail"></i>&nbsp;&nbsp;<a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a></li>
-                    {{end}}
-                    {{if .Owner.Website}}
-                    <li class="list-group-item"><i class="octicon octicon-link"></i>&nbsp;&nbsp;<a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a></li>
-                    {{end}}
-                    <li class="list-group-item"><i class="octicon octicon-clock"></i>&nbsp;&nbsp;{{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
-                </ul>
-                <hr>
-                <ul class="list-no-style">
-                    <li class="list-group-item profile-rel">
-                        <a class="text-black" href="">
-                            <strong>{{.Owner.NumFollowers}}</strong>
-                            <p>{{.i18n.Tr "user.followers"}}</p>
-                        </a>
-                    </li>
-                    <li class="list-group-item profile-rel">
-                        <a class="text-black" href="">
-                            <strong>{{.Owner.NumStars}}</strong>
-                            <p>{{.i18n.Tr "user.starred"}}</p>
-                        </a>
-                    </li>
-                    <li class="list-group-item profile-rel">
-                        <a class="text-black" href="">
-                            <strong>{{.Owner.NumFollowings}}</strong>
-                            <p>{{.i18n.Tr "user.following"}}</p>
-                        </a>
-                    </li>
-                </ul>
-                <hr>
-            </div>
+{{template "base/head" .}}
+<div class="user profile">
+  <div class="ui container">
+    <div class="ui grid">
+      <div class="ui five wide column">
+        <div class="ui card">
+          {{if and (.Owner.UseCustomAvatar) (eq .SignedUserName .Owner.Name)}}
+          <a class="image poping up" href="{{AppSubUrl}}/user/settings" id="profile-avatar" data-content="{{.i18n.Tr "user.change_custom_avatar"}}" data-variation="inverted tiny" data-position="bottom center">
+            <img src="{{.Owner.AvatarLink}}?s=290" title="{{.Owner.Name}}"/>
+          </a>
+          {{else if eq .SignedUserName .Owner.Name}}
+          <a class="image poping up" href="http://gravatar.com/emails/" id="profile-avatar" data-content="{{.i18n.Tr "user.change_avatar"}}" data-variation="inverted tiny" data-position="bottom center">
+            <img src="{{.Owner.AvatarLink}}?s=290" title="{{.Owner.Name}}"/>
+          </a>
+          {{else}}
+          <span class="image">
+            <img src="{{.Owner.AvatarLink}}?s=290" title="{{.Owner.Name}}"/>
+          </span>
+          {{end}}
+          <div class="content">
+            {{if .Owner.FullName}}<span class="header text center">{{.Owner.FullName}}</span>{{end}}
+            <span class="username text center">{{.Owner.Name}}</span>
+          </div>
+          <div class="extra content">
+            <ul class="text black">
+              {{if .Owner.Location}}
+              <li><i class="icon octicon octicon-location"></i> {{.Owner.Location}}</li>
+              {{end}}
+              {{if and .Owner.Email .IsSigned}}
+              <li>
+                <i class="icon octicon octicon-mail"></i>
+                <a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>
+              </li>
+              {{end}}
+              {{if .Owner.Website}}
+              <li>
+                <i class="icon octicon octicon-link"></i>
+                <a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a>
+              </li>
+              {{end}}
+              <li><i class="icon octicon octicon-clock"></i> {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
+            </ul>
+          </div>
+        </div>
+      </div>
+      <div class="ui eleven wide column">
+        <div class="ui secondary pointing menu">
+          <a class="{{if ne .TabName "activity"}}active{{end}} item" href="{{.Owner.HomeLink}}">
+            <i class="icon octicon octicon-repo"></i> {{.i18n.Tr "user.repositories"}}
+          </a>
+          <a class="item">
+          <a class="{{if eq .TabName "activity"}}active{{end}} item" href="{{.Owner.HomeLink}}?tab=activity">
+            <i class="icon octicon octicon-rss"></i> {{.i18n.Tr "user.activity"}}
+          </a>
+          </a>
         </div>
-        <div class="grid-4-5 left">
-            <div id="profile-body">
-                <ul class="menu menu-line" id="profile-header">
-                    <li>
-                        <a {{if not .TabName}}class="current"{{end}} href="{{.Owner.HomeLink}}"><i class="octicon octicon-repo"></i> {{.i18n.Tr "user.repositories"}}</a>
-                    </li>
-                    <li>
-                        <a {{if eq .TabName "activity"}}class="current"{{end}} href="{{.Owner.HomeLink}}?tab=activity"><i class="octicon octicon-repo"></i> {{.i18n.Tr "user.activity"}}</a>
-                    </li>
-                </ul>
-                <div class="tab-content">
-                    {{if eq .TabName "activity"}}
-                    <div class="tab-pane active" id="dashboard-news">
-                    <br>
-                    {{template "user/dashboard/feeds" .}}
-                    </div>
-                    {{else}}
-                    <div class="tab-pane active">
-                        <div id="org-repo-list">
-                            {{range .Repos}}
-                                {{if or (not .IsPrivate) (.HasAccess $.SignedUser)}}
-                                <div class="org-repo-item">
-                                    <ul class="org-repo-status right">
-                                        <li><i class="octicon octicon-star"></i> {{.NumStars}}</li>
-                                        <li><i class="octicon octicon-git-branch"></i> {{.NumForks}}</li>
-                                    </ul>
-                                    <h2>
-                                        <a href="{{AppSubUrl}}/{{$.Owner.Name}}/{{.Name}}">{{.Name}}</a>
-                                        {{if .IsPrivate}}
-                                        <span class="text-gold"><i class="octicon octicon-lock"></i></span>
-                                        {{end}}
-                                    </h2>
-                                    <p class="org-repo-description">{{.Description}}</p>
-                                    <p class="org-repo-updated">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
-                                </div>
-                                {{end}}
-                            {{end}}
-                        </div>
-                    </div>
-                    {{end}}
+        {{if ne .TabName "activity"}}
+        <div class="ui repository list">
+          {{range .Repos}}
+            {{if or (not .IsPrivate) (.HasAccess $.SignedUser)}}
+            <div class="item">
+              <div class="ui header">
+                <a href="{{AppSubUrl}}/{{$.Owner.Name}}/{{.Name}}">{{.Name}}</a>
+                {{if .IsPrivate}}
+                <span class="text gold"><i class="icon octicon octicon-lock"></i></span>
+                {{end}}
+
+                <div class="ui right metas">
+                  <span class="text grey"><i class="octicon octicon-star"></i> {{.NumStars}}</span>
+                  <span class="text grey"><i class="octicon octicon-git-branch"></i> {{.NumForks}}</span>
                 </div>
+              </div>
+              {{if .Description}}<p>{{.Description}}</p>{{end}}
+              <p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
             </div>
+            {{end}}
+          {{end}}
         </div>
+        {{else}}
+        <br>
+        {{template "user/dashboard/feeds" .}}
+        {{end}}
     </div>
+  </div>
 </div>
-{{template "ng/base/footer" .}}
+{{template "base/footer" .}}
\ No newline at end of file