Browse Source

Merge branch 'V20211213' into zouap

tags/v1.21.12.1^2
zouap 4 years ago
parent
commit
98e127e5c8
7 changed files with 33 additions and 23 deletions
  1. +8
    -4
      models/repo.go
  2. +4
    -4
      templates/base/head_navbar.tmpl
  3. +4
    -4
      templates/base/head_navbar_fluid.tmpl
  4. +4
    -4
      templates/base/head_navbar_home.tmpl
  5. +3
    -3
      templates/base/head_navbar_pro.tmpl
  6. +3
    -4
      templates/user/profile.tmpl
  7. +7
    -0
      web_src/less/openi.less

+ 8
- 4
models/repo.go View File

@@ -653,8 +653,9 @@ func (repo *Repository) getReviewersPrivate(e Engine, doerID, posterID int64) (u
users = make([]*User, 0, 20)

if err = e.
SQL("SELECT * FROM `user` WHERE id in (SELECT user_id FROM `access` WHERE repo_id = ? AND mode >= ? AND user_id NOT IN ( ?, ?)) ORDER BY name",
repo.ID, AccessModeRead,
SQL("SELECT * FROM `user` WHERE id in (SELECT user_id FROM `access` WHERE repo_id = ? AND mode >= ? "+
" UNION SELECT owner_id FROM `repository` WHERE id = ?) AND id NOT IN ( ?, ?) ORDER BY name",
repo.ID, AccessModeWrite, repo.ID,
doerID, posterID).
Find(&users); err != nil {
return nil, err
@@ -668,11 +669,14 @@ func (repo *Repository) getReviewersPublic(e Engine, doerID, posterID int64) (_
users := make([]*User, 0)

const SQLCmd = "SELECT * FROM `user` WHERE id IN ( " +
"SELECT user_id FROM `access` WHERE repo_id = ? AND mode >= ? AND user_id NOT IN ( ?, ?) ) ORDER BY name "
"SELECT user_id FROM `access` WHERE repo_id = ? AND mode >= ? " +
" UNION" +
" SELECT owner_id FROM `repository` WHERE id = ?)" +
" AND id NOT IN ( ?, ?) ORDER BY name "

if err = e.
SQL(SQLCmd,
repo.ID, AccessModeWrite, doerID, posterID).
repo.ID, AccessModeWrite, repo.ID, doerID, posterID).
Find(&users); err != nil {
return nil, err
}


+ 4
- 4
templates/base/head_navbar.tmpl View File

@@ -19,8 +19,8 @@
{{if .IsSigned}}
<div class=" item edge">
<div class="dropdown-menu">
<a class=" item" href="/dashboard">
<span > {{.i18n.Tr "index"}} &nbsp <i class="dropdown icon"></i></span>
<a class=" item lfpd" href="/dashboard" >
{{.i18n.Tr "index"}} <i class="dropdown icon mglf" ></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">
@@ -49,8 +49,8 @@
{{else if .IsLandingPageHome}}
<div class="item edge">
<div class="dropdown-menu">
<a class=" item" href="/user/login">
<span > {{.i18n.Tr "home"}} &nbsp <i class="dropdown icon"></i></span>
<a class=" item lfpd" href="/user/login">
{{.i18n.Tr "home"}} <i class="dropdown icon mglf"></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">


+ 4
- 4
templates/base/head_navbar_fluid.tmpl View File

@@ -19,8 +19,8 @@
{{if .IsSigned}}
<div class="item edge" >
<div class="dropdown-menu">
<a class=" item" href="/dashboard">
<span > {{.i18n.Tr "index"}} &nbsp <i class="dropdown icon"></i></span>
<a class=" item lfpd" href="/dashboard">
{{.i18n.Tr "index"}} <i class="dropdown icon mglf"></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">
@@ -48,8 +48,8 @@
{{else if .IsLandingPageHome}}
<div class="item edge" >
<div class="dropdown-menu">
<a class=" item" href="/user/login">
<span > {{.i18n.Tr "home"}} &nbsp <i class="dropdown icon"></i></span>
<a class=" item lfpd" href="/user/login">
{{.i18n.Tr "home"}} <i class="dropdown icon mglf"></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">


+ 4
- 4
templates/base/head_navbar_home.tmpl View File

@@ -11,8 +11,8 @@
{{if .IsSigned}}
<div class="item edge" >
<div class="dropdown-menu">
<a class=" item" href="/dashboard">
<span > {{.i18n.Tr "index"}} &nbsp <i class="dropdown icon"></i></span>
<a class=" item lfpd" href="/dashboard">
{{.i18n.Tr "index"}} <i class="dropdown icon mglf"></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">
@@ -40,8 +40,8 @@
{{else if .IsLandingPageHome}}
<div class="item edge" >
<div class="dropdown-menu">
<a class=" item" href="/user/login">
<span > {{.i18n.Tr "home"}} &nbsp <i class="dropdown icon"></i></span>
<a class=" item lfpd" href="/user/login">
{{.i18n.Tr "home"}} <i class="dropdown icon mglf"></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">


+ 3
- 3
templates/base/head_navbar_pro.tmpl View File

@@ -20,8 +20,8 @@
<div class=" item edge" >
<div class="dropdown-menu">
<a class=" item" href="/dashboard">
<span > {{.i18n.Tr "index"}} &nbsp <i class="dropdown icon"></i></span>
<a class=" item lfpd" href="/dashboard">
{{.i18n.Tr "index"}} <i class="dropdown icon mglf"></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">
@@ -51,7 +51,7 @@
<div class="item edge">
<div class="dropdown-menu">
<a class=" item" href="/user/login">
<span > {{.i18n.Tr "home"}} &nbsp <i class="dropdown icon"></i></span>
{{.i18n.Tr "home"}} <i class="dropdown icon mglf"></i>
</a>
<div class="dropdown-content" style="min-width: 110px;border-radius:4px">


+ 3
- 4
templates/user/profile.tmpl View File

@@ -116,16 +116,15 @@
<!-- <a class='{{if and (ne .TabName "datasets") (ne .TabName "activity") (ne .TabName "following") (ne .TabName "followers") (ne .TabName "stars")}}active{{end}} item' href="{{.Owner.HomeLink}}">
{{svg "octicon-repo" 16}} {{.i18n.Tr "user.repositories"}}
</a> -->
<a class='{{if eq .TabName "activity"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=activity">
{{svg "octicon-rss" 16}} {{.i18n.Tr "user.activity"}}
</a>
<a class='{{if eq .TabName "repository" }}active{{end}} item' href="{{.Owner.HomeLink}}?tab=repository">
{{svg "octicon-repo" 16}} {{.i18n.Tr "user.repositories"}}
</a>
<a class='{{if eq .TabName "datasets"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=datasets">
{{svg "octicon-inbox" 16}} {{.i18n.Tr "user.datasets"}}
</a>
<a class='{{if eq .TabName "activity"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=activity">
{{svg "octicon-rss" 16}} {{.i18n.Tr "user.activity"}}
</a>
<a class='{{if eq .TabName "stars"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=stars">
{{svg "octicon-star" 16}} {{.i18n.Tr "user.starred"}}
<div class="ui label">{{.Owner.NumStars}}</div>


+ 7
- 0
web_src/less/openi.less View File

@@ -571,3 +571,10 @@ display: block;
padding-left:0 !important;
padding-right:0 !important;
}
.lfpd {
padding-left:0 !important;
padding-right: 0 !important;
}
.mglf{
margin-left:0.5em !important;
}

Loading…
Cancel
Save