Browse Source

feat: add a simple data

tags/v1.21.12.1
colorfulberry 5 years ago
parent
commit
f25cd3199e
5 changed files with 50 additions and 2 deletions
  1. +1
    -0
      options/locale/locale_en-US.ini
  2. +1
    -0
      options/locale/locale_zh-CN.ini
  3. +41
    -0
      templates/datasets/dataset_list.tmpl
  4. +1
    -1
      templates/datasets/index.tmpl
  5. +6
    -1
      templates/user/profile.tmpl

+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -386,6 +386,7 @@ target_branch_not_exist = Target branch does not exist.
change_avatar = Change your avatar…
join_on = Joined on
repositories = Repositories
datasets = Datasets
activity = Public Activity
followers = Followers
starred = Starred Repositories


+ 1
- 0
options/locale/locale_zh-CN.ini View File

@@ -385,6 +385,7 @@ target_branch_not_exist=目标分支不存在。
change_avatar=修改头像
join_on=加入于
repositories=仓库列表
datasets=数据集
activity=公开活动
followers=关注者
starred=已点赞


+ 41
- 0
templates/datasets/dataset_list.tmpl View File

@@ -0,0 +1,41 @@
<div class="ui repository list">
{{range .Repos}}
<div class="item">
<div class="ui header">
{{if .RelAvatarLink}}
<img class="ui avatar image" src="{{.RelAvatarLink}}">
{{end}}
<a class="name" href="{{.Link}}">
{{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}}
{{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}}
</a>
{{if .IsPrivate}}
<span class="middle text gold">{{svg "octicon-lock" 16}}</span>
{{else if .IsFork}}
<span class="middle">{{svg "octicon-repo-forked" 16}}</span>
{{end}}
<div class="ui right metas">
{{if .PrimaryLanguage }}
<span class="text grey"><i class="color-icon" style="background-color: {{.PrimaryLanguage.Color}}"></i>{{ .PrimaryLanguage.Language }}</span>
{{end}}
<span class="text grey">{{svg "octicon-flame" 16}} {{.NumStars}}</span>
</div>
</div>
<div class="description">
{{if .DescriptionHTML}}<p>{{.DescriptionHTML}}</p>{{end}}
{{if .Topics }}
<div class="ui tags">
{{range .Topics}}
{{if ne . "" }}<a href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1"><div class="ui small label topic">{{.}}</div></a>{{end}}
{{end}}
</div>
{{end}}
<p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.i18n.Lang}}</p>
</div>
</div>
{{else}}
<div>
{{$.i18n.Tr "explore.repo_no_results"}}
</div>
{{end}}
</div>

+ 1
- 1
templates/datasets/index.tmpl View File

@@ -1,3 +1,3 @@
{{template "base/head" .}}
index.tmpl
{{template "datasets/dataset_list" .}}
{{template "base/footer" .}}

+ 6
- 1
templates/user/profile.tmpl View File

@@ -83,9 +83,12 @@
</div>
<div class="ui eleven wide column">
<div class="ui secondary stackable pointing menu">
<a class='{{if and (ne .TabName "activity") (ne .TabName "following") (ne .TabName "followers") (ne .TabName "stars")}}active{{end}} item' href="{{.Owner.HomeLink}}">
<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 "datasets"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=datasets">
{{svg "octicon-file-submodule" 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>
@@ -127,6 +130,8 @@
{{template "repo/user_cards" .}}
{{else if eq .TabName "followers"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "datasets"}}
{{template "datasets/dataset_list" .}}
{{else}}
{{template "explore/repo_search" .}}
{{template "explore/repo_list" .}}


Loading…
Cancel
Save