| @@ -5,7 +5,6 @@ | |||
| package structs | |||
| import ( | |||
| "html/template" | |||
| "time" | |||
| ) | |||
| @@ -76,7 +75,6 @@ type Repository struct { | |||
| Created time.Time `json:"created_at"` | |||
| // swagger:strfmt date-time | |||
| Updated time.Time `json:"updated_at"` | |||
| TimeSinceUnixUpdatedHtml template.HTML `json:"timeSinceUnixUpdatedHtml"` | |||
| Permissions *Permission `json:"permissions,omitempty"` | |||
| HasIssues bool `json:"has_issues"` | |||
| InternalTracker *InternalTracker `json:"internal_tracker,omitempty"` | |||
| @@ -90,8 +88,6 @@ type Repository struct { | |||
| AllowRebaseMerge bool `json:"allow_rebase_explicit"` | |||
| AllowSquash bool `json:"allow_squash_merge"` | |||
| AvatarURL string `json:"avatar_url"` | |||
| PrimaryLanguage string `json:"primaryLanguage"` | |||
| PrimaryLanguageColor string `json:"primaryLanguageColor"` | |||
| } | |||
| // CreateRepoOption options when creating repository | |||
| @@ -16,7 +16,6 @@ import ( | |||
| "code.gitea.io/gitea/modules/log" | |||
| "code.gitea.io/gitea/modules/setting" | |||
| api "code.gitea.io/gitea/modules/structs" | |||
| "code.gitea.io/gitea/modules/timeutil" | |||
| "code.gitea.io/gitea/modules/util" | |||
| "code.gitea.io/gitea/modules/validation" | |||
| "code.gitea.io/gitea/routers/api/v1/utils" | |||
| @@ -200,7 +199,6 @@ func Search(ctx *context.APIContext) { | |||
| } | |||
| results := make([]*api.Repository, len(repos)) | |||
| for i, repo := range repos { | |||
| if err = repo.GetOwner(); err != nil { | |||
| ctx.JSON(http.StatusInternalServerError, api.SearchError{ | |||
| @@ -217,11 +215,6 @@ func Search(ctx *context.APIContext) { | |||
| }) | |||
| } | |||
| results[i] = repo.APIFormat(accessMode) | |||
| results[i].TimeSinceUnixUpdatedHtml = timeutil.TimeSinceUnix(repo.UpdatedUnix, ctx.Language()) | |||
| if repo.PrimaryLanguage != nil { | |||
| results[i].PrimaryLanguage = repo.PrimaryLanguage.Language | |||
| results[i].PrimaryLanguageColor = repo.PrimaryLanguage.Color | |||
| } | |||
| } | |||
| ctx.SetLinkHeader(int(count), opts.PageSize) | |||
| @@ -145,18 +145,18 @@ func Dashboard(ctx *context.Context) { | |||
| ctx.Data["MirrorCount"] = len(mirrors) | |||
| ctx.Data["Mirrors"] = mirrors | |||
| //retrieveFeeds(ctx, models.GetFeedsOptions{ | |||
| // RequestedUser: ctxUser, | |||
| // Actor: ctx.User, | |||
| // IncludePrivate: true, | |||
| // OnlyPerformedBy: false, | |||
| // IncludeDeleted: false, | |||
| //}) | |||
| retrieveFeeds(ctx, models.GetFeedsOptions{ | |||
| RequestedUser: ctxUser, | |||
| Actor: ctx.User, | |||
| IncludePrivate: true, | |||
| OnlyPerformedBy: false, | |||
| IncludeDeleted: false, | |||
| }) | |||
| if ctx.Written() { | |||
| return | |||
| } | |||
| //ctx.HTML(200, tplDashboard) | |||
| ctx.HTML(200, tplDashboard) | |||
| } | |||
| // Milestones render the user milestones page | |||
| @@ -178,17 +178,10 @@ func Profile(ctx *context.Context) { | |||
| total = ctxUser.NumFollowing | |||
| case "activity": | |||
| typeQuery := ctx.Query("type") | |||
| ctx.Data["ActTabName"] = typeQuery | |||
| onlyPerformedBy := true | |||
| if typeQuery == "all" { | |||
| onlyPerformedBy = false | |||
| } | |||
| retrieveFeeds(ctx, models.GetFeedsOptions{RequestedUser: ctxUser, | |||
| Actor: ctx.User, | |||
| IncludePrivate: showPrivate, | |||
| OnlyPerformedBy: onlyPerformedBy, | |||
| OnlyPerformedBy: true, | |||
| IncludeDeleted: false, | |||
| }) | |||
| if ctx.Written() { | |||
| @@ -268,8 +261,6 @@ func Profile(ctx *context.Context) { | |||
| ctx.Data["ShowUserEmail"] = len(ctxUser.Email) > 0 && ctx.IsSigned && (!ctxUser.KeepEmailPrivate || ctxUser.ID == ctx.User.ID) | |||
| Dashboard(ctx) | |||
| ctx.HTML(200, tplProfile) | |||
| } | |||
| @@ -9,7 +9,7 @@ | |||
| </div> | |||
| {{if .IsSigned}} | |||
| <a class="item {{if .PageIsDashboard}}active{{end}}" href="{{AppSubUrl}}/{{.SignedUser.Name}}">{{.i18n.Tr "dashboard"}}</a> | |||
| <a class="item {{if .PageIsDashboard}}active{{end}}" href="/dashboard">{{.i18n.Tr "dashboard"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi"}}</a> | |||
| {{if not .UnitIssuesGlobalDisabled}} | |||
| <a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a> | |||
| @@ -109,9 +109,13 @@ | |||
| </div> | |||
| <div class="divider"></div> | |||
| <a class="item" href="{{AppSubUrl}}/dashboard"> | |||
| {{svg "octicon-info" 16}} | |||
| {{.i18n.Tr "your_dashboard"}}<!-- Your dashboard --> | |||
| </a> | |||
| <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}"> | |||
| {{svg "octicon-person" 16}} | |||
| {{.i18n.Tr "your_dashboard"}}<!-- Your profile --> | |||
| {{.i18n.Tr "your_profile"}}<!-- Your profile --> | |||
| </a> | |||
| <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}?tab=stars"> | |||
| {{svg "octicon-star" 16}} | |||
| @@ -1,130 +0,0 @@ | |||
| <h2 class="ui left floated medium header"> | |||
| {{.i18n.Tr "explore.repos"}} | |||
| </h2> | |||
| <div class="ui clearing divider"></div> | |||
| <div id="app" class="six wide column"> | |||
| <repo-search | |||
| :search-limit=100 | |||
| :suburl="suburl" | |||
| :uid="uid" | |||
| :more-repos-link="'{{.ContextUser.HomeLink}}'" | |||
| {{if not .ContextUser.IsOrganization}} | |||
| :organizations="[ | |||
| {{range .ContextUser.Orgs}} | |||
| {name: '{{.Name}}', num_repos: '{{.NumRepos}}'}, | |||
| {{end}} | |||
| ]" | |||
| :is-organization="false" | |||
| :organizations-total-count="{{.ContextUser.GetOrganizationCount}}" | |||
| :can-create-organization="{{.SignedUser.CanCreateOrganization}}" | |||
| {{end}} | |||
| inline-template | |||
| v-cloak | |||
| > | |||
| <div> | |||
| <div v-show="tab === 'repos'" class="ui tab active list dashboard-repos"> | |||
| <div class="ui attached secondary segment repos-search"> | |||
| <div class="ui fluid right action left icon input" :class="{loading: isLoading}"> | |||
| <input @input="searchRepos(reposFilter)" v-model="searchQuery" ref="search" placeholder="{{.i18n.Tr "home.search_repos"}}"> | |||
| <i class="search icon"></i> | |||
| <div class="ui dropdown button" title="{{.i18n.Tr "home.filter"}}"> | |||
| <i class="icon filter"></i> | |||
| <div class="menu"> | |||
| <div class="item"> | |||
| <a @click="toggleArchivedFilter()"> | |||
| <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_both_archived_unarchived"}}" v-if="archivedFilter === 'both'"> | |||
| <input type="checkbox"> | |||
| <label><i class="archive icon archived-icon"></i>{{.i18n.Tr "home.show_archived"}}</label> | |||
| </div> | |||
| <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_only_unarchived"}}" v-if="archivedFilter === 'unarchived'"> | |||
| <input type="checkbox"> | |||
| <label><i class="archive icon archived-icon"></i>{{.i18n.Tr "home.show_archived"}}</label> | |||
| </div> | |||
| <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_only_archived"}}" v-if="archivedFilter === 'archived'"> | |||
| <input type="checkbox"> | |||
| <label><i class="archive icon archived-icon"></i>{{.i18n.Tr "home.show_archived"}}</label> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| <div class="item"> | |||
| <a @click="togglePrivateFilter()"> | |||
| <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_both_private_public"}}" v-if="privateFilter === 'both'"> | |||
| <input type="checkbox"> | |||
| <label><svg class="svg octicon-lock" width="16" height="16" aria-hidden="true"><use xlink:href="#octicon-lock" /></svg>{{.i18n.Tr "home.show_private"}}</label> | |||
| </div> | |||
| <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_only_public"}}" v-if="privateFilter === 'public'"> | |||
| <input type="checkbox"> | |||
| <label><svg class="svg octicon-lock" width="16" height="16" aria-hidden="true"><use xlink:href="#octicon-lock" /></svg>{{.i18n.Tr "home.show_private"}}</label> | |||
| </div> | |||
| <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_only_private"}}" v-if="privateFilter === 'private'"> | |||
| <input type="checkbox"> | |||
| <label><svg class="svg octicon-lock" width="16" height="16" aria-hidden="true"><use xlink:href="#octicon-lock" /></svg>{{.i18n.Tr "home.show_private"}}</label> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="ui secondary pointing borderless menu center aligned grid repos-filter"> | |||
| <a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')"> | |||
| {{.i18n.Tr "all"}} | |||
| <div v-show="reposFilter === 'all'" class="ui circular mini grey label">${repoTypeCount}</div> | |||
| </a> | |||
| <a class="item" :class="{active: reposFilter === 'sources'}" @click="changeReposFilter('sources')"> | |||
| {{.i18n.Tr "sources"}} | |||
| <div v-show="reposFilter === 'sources'" class="ui circular mini grey label">${repoTypeCount}</div> | |||
| </a> | |||
| <a class="item" :class="{active: reposFilter === 'forks'}" @click="changeReposFilter('forks')"> | |||
| {{.i18n.Tr "forks"}} | |||
| <div v-show="reposFilter === 'forks'" class="ui circular mini grey label">${repoTypeCount}</div> | |||
| </a> | |||
| <a class="item" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')"> | |||
| {{.i18n.Tr "mirrors"}} | |||
| <div v-show="reposFilter === 'mirrors'" class="ui circular mini grey label">${repoTypeCount}</div> | |||
| </a> | |||
| <a class="item" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')"> | |||
| {{.i18n.Tr "collaborative"}} | |||
| <div v-show="reposFilter === 'collaborative'" class="ui circular mini grey label">${repoTypeCount}</div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="ui attached table segment"> | |||
| <ul class="repo-owner-name-list"> | |||
| <div class="ui repository list" v-for="repo in repos"> | |||
| <div class="item"> | |||
| <div class="ui header"> | |||
| {{if .RelAvatarLink}} | |||
| <img class="ui avatar image" src="{{.RelAvatarLink}}"> | |||
| {{end}} | |||
| <a class="name" :href="repo.html_url"> | |||
| ${repo.full_name} | |||
| <i v-if="repo.archived" class="archive icon archived-icon"></i> | |||
| </a> | |||
| <span v-if="repo.private" class="middle text gold">{{svg "octicon-lock" 16}}</span> | |||
| <span v-if="repo.fork" class="middle">{{svg "octicon-repo-forked" 16}}</span> | |||
| <span v-if="repo.mirror" class="middle">{{svg "octicon-repo-clone" 16}}</span> | |||
| <div class="ui right metas"> | |||
| <span v-if="repo.primaryLanguage" class="text grey"> | |||
| <i class="color-icon" v-bind:style="{backgroundColor: repo.primaryLanguageColor}"></i> | |||
| ${repo.primaryLanguage} | |||
| </span> | |||
| <span class="text grey">{{svg "octicon-star" 16}} ${repo.stars_count}</span> | |||
| <span class="text grey">{{svg "octicon-git-branch" 16}} ${repo.forks_count}</span> | |||
| </div> | |||
| </div> | |||
| <div class="description"> | |||
| <p v-if="repo.description" class="has-emoji">${repo.description}</p> | |||
| <p class="time" >{{$.i18n.Tr "org.repo_updated"}}<span v-html="repo.timeSinceUnixUpdatedHtml"></span> | |||
| </p> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div v-if="repos.length==0"> | |||
| {{$.i18n.Tr "explore.repo_no_results"}} | |||
| </div> | |||
| </ul> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </repo-search> | |||
| </div> | |||
| @@ -89,7 +89,7 @@ | |||
| <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&type=own"> | |||
| <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"> | |||
| @@ -117,12 +117,6 @@ | |||
| </div> | |||
| <div class="ui divider"></div> | |||
| {{end}} | |||
| <div class="ui secondary stackable pointing menu"> | |||
| <a class='{{if eq .ActTabName "own"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=activity&type=own"> | |||
| {{svg "octicon-person" 16}} {{.i18n.Tr "user.own"}}</a> | |||
| <a class='{{if eq .ActTabName "all"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=activity&type=all"> | |||
| {{svg "octicon-organization" 16}} {{.i18n.Tr "user.all"}}</a> | |||
| </div> | |||
| <div class="feeds"> | |||
| {{template "user/dashboard/feeds" .}} | |||
| </div> | |||
| @@ -141,7 +135,9 @@ | |||
| {{template "explore/dataset_list" .}} | |||
| {{template "base/paginate" .}} | |||
| {{else}} | |||
| {{template "user/dashboard/repo_list_dashboard" .}} | |||
| {{template "explore/repo_search" .}} | |||
| {{template "explore/repo_list" .}} | |||
| {{template "base/paginate" .}} | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| @@ -3324,16 +3324,6 @@ function initVueComponents() { | |||
| self.$refs.search.focus(); | |||
| }); | |||
| }, | |||
| updated: function () { | |||
| $('.time-since').each(function () { | |||
| $(this) | |||
| .addClass('poping up') | |||
| .attr('data-content', $(this).attr('title')) | |||
| .attr('data-variation', 'inverted tiny') | |||
| .attr('title', ''); | |||
| }); | |||
| $('.poping.up').popup(); | |||
| }, | |||
| methods: { | |||
| changeTab(t) { | |||
| this.tab = t; | |||