Browse Source

修改项目首页模板,增加侧边栏内容:contributor及近期动态列表

tags/v1.21.7^2
OpenIhu 4 years ago
parent
commit
2350d54bf6
1 changed files with 104 additions and 38 deletions
  1. +104
    -38
      templates/repo/home.tmpl

+ 104
- 38
templates/repo/home.tmpl View File

@@ -4,10 +4,7 @@
<div class="ui container">
{{template "base/alert" .}}
<div class="ui repo-description stackable grid">
<div id="repo-desc" class="ui twelve wide column">
{{if .Repository.DescriptionHTML}}<span class="description">{{.Repository.DescriptionHTML}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
</div>
{{if .RepoSearchEnabled}}
<div class="ui repo-search four wide column">
<form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get">
@@ -23,33 +20,7 @@
</div>
{{end}}
</div>
<div class="ui" id="repo-topics">
{{range .Topics}}<a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<a id="manage_topic">{{.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}}
</div>
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
<div class="ui repo-topic-edit grid form segment error" id="topic_edit" style="display:none">
<div class="fourteen wide column">
<div class="field">
<div class="ui fluid multiple search selection dropdown">
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if lt (Add $i 1) (len $.Topics)}},{{end}}{{end}}">
{{range .Topics}}
<div class="ui small label topic transition visible" data-value="{{.Name}}" style="display: inline-block !important; cursor: default;">{{.Name}}<i class="delete icon"></i></div>
{{end}}
<div class="text"></div>
</div>
</div>
</div>
<div class="two wide column">
<a class="ui button primary" href="javascript:;" id="save_topic"
data-link="{{.RepoLink}}/topics">{{.i18n.Tr "repo.topic.done"}}</a>
</div>
</div>
{{end}}
<div class="hide" id="validate_prompt">
<span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span>
<span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span>
</div>
{{if .Repository.IsArchived}}
<div class="ui warning message">
{{.i18n.Tr "repo.archive.title"}}
@@ -141,13 +112,108 @@
{{end}}
</div>
</div>
{{if .IsViewFile}}
{{template "repo/view_file" .}}
{{else if .IsBlame}}
{{template "repo/blame" .}}
{{else}}
{{template "repo/view_list" .}}
{{end}}
<div class="ui container">
<div class="ui mobile reversed stackable grid">
<div class="ui ten wide tablet twelve wide computer column">
{{if .IsViewFile}}
{{template "repo/view_file" .}}
{{else if .IsBlame}}
{{template "repo/blame" .}}
{{else}}
{{template "repo/view_list" .}}
{{end}}
</div>
<div class="ui six wide tablet four wide computer column">
<div id="repo-desc">
<h4 class="ui header">简介</h4>
{{if .Repository.DescriptionHTML}}<span class="description">{{.Repository.DescriptionHTML}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
</div>

<div class="ui" id="repo-topics">
<i class="bookmark outline icon"></i>
{{range .Topics}}<a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<a id="manage_topic">{{.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}}
</div>
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
<div class="ui repo-topic-edit grid form segment error" id="topic_edit" style="display:none">
<div class="fourteen wide column">
<div class="field">
<div class="ui fluid multiple search selection dropdown">
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if lt (Add $i 1) (len $.Topics)}},{{end}}{{end}}">
{{range .Topics}}
<div class="ui small label topic transition visible" data-value="{{.Name}}" style="display: inline-block !important; cursor: default;">{{.Name}}<i class="delete icon"></i></div>
{{end}}
<div class="text"></div>
</div>
</div>
</div>
<div class="two wide column">
<a class="ui button primary" href="javascript:;" id="save_topic"
data-link="{{.RepoLink}}/topics">{{.i18n.Tr "repo.topic.done"}}</a>
</div>
</div>
{{end}}
<div class="hide" id="validate_prompt">
<span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span>
<span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span>
</div>

<div class="ui">
<i class="terminal icon"></i>
TensorFlow 1.2, Python 3.7
</div>
<div class="ui">
<i class="clone outline icon"></i>
MIT
</div>

<div >
<h4 class="ui header">
<strong>贡献者</strong>
<div class="ui right">
<a class="text grey" href="">全部 {{svg "octicon-chevron-right" 16}}</a>
</div>
</h4>
<div class="ui members">
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}"><img class="ui avatar image" src="https://git.openi.org.cn/user/avatar/coral/-1"></a>
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}"><img class="ui avatar image" src="https://git.openi.org.cn/user/avatar/dlvc/-1"></a>
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}"><img class="ui avatar image" src="https://git.openi.org.cn/user/avatar/fangwei123456/-1"></a>
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}"><img class="ui avatar image" src="https://git.openi.org.cn/user/avatar/fisheryu/-1"></a>
</div>
</div>

<div >
<h4 class="ui header">
<strong>近期动态</strong>
</h4>
<div class="ui list">
<div class="item">
<img class="ui avatar image" src="https://git.openi.org.cn/user/avatar/coral/-1">
<div class="content">
<a href="">10小时前推送了新的提交到 master 分支,e2bfb75...0059d20</a>
</div>
</div>
<div class="item">
<img class="ui avatar image" src="https://git.openi.org.cn/user/avatar/coral/-1">
<div class="content">
<a href="">10小时前推送了新的提交到 master 分支,e2bfb75...0059d20</a>
</div>
</div>
<div class="item">
<img class="ui avatar image" src="https://git.openi.org.cn/user/avatar/coral/-1">
<div class="content">
<a href="">10小时前推送了新的提交到 master 分支,e2bfb75...0059d20</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{template "base/footer" .}}

Loading…
Cancel
Save