Browse Source

fix-1250 组织主页增加标签

pull/1603/head
wangjr 3 years ago
parent
commit
e959e7ebd2
3 changed files with 98 additions and 3 deletions
  1. +3
    -0
      options/locale/locale_en-US.ini
  2. +3
    -0
      options/locale/locale_zh-CN.ini
  3. +92
    -3
      templates/org/home.tmpl

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

@@ -2088,6 +2088,7 @@ team_unit_disabled = (Disabled)
selected_couse=Selected Courses selected_couse=Selected Courses
release_course = Publish Course release_course = Publish Course
all_keywords=All keywords all_keywords=All keywords
all_org_topics=All
max_selectedPro= Select up to 9 public projects max_selectedPro= Select up to 9 public projects
custom_select_courses = Customize selected courses custom_select_courses = Customize selected courses
recommend_remain_pro = Remain recommend_remain_pro = Remain
@@ -2096,6 +2097,8 @@ select_again = Select more than 9, please select again!
custom_select_projects = Customize selected projects custom_select_projects = Customize selected projects
customize = Customize customize = Customize
selected_project=Selected Projects selected_project=Selected Projects
fold = Fold
unfold = Unfold


form.name_reserved = The organization name '%s' is reserved. form.name_reserved = The organization name '%s' is reserved.
form.name_pattern_not_allowed = The pattern '%s' is not allowed in an organization name. form.name_pattern_not_allowed = The pattern '%s' is not allowed in an organization name.


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

@@ -2096,6 +2096,7 @@ team_unit_disabled=(已禁用)
selected_couse=精选课程 selected_couse=精选课程
release_course = 发布课程 release_course = 发布课程
all_keywords=全部关键字 all_keywords=全部关键字
all_org_topics=全部
max_selectedPro= 最多可选9个公开项目 max_selectedPro= 最多可选9个公开项目
custom_select_courses = 自定义精选课程 custom_select_courses = 自定义精选课程
recommend_remain_pro = 还能推荐 recommend_remain_pro = 还能推荐
@@ -2104,6 +2105,8 @@ select_again = 选择超过9个,请重新选择!
custom_select_projects = 自定义精选项目 custom_select_projects = 自定义精选项目
customize = 自定义 customize = 自定义
selected_project=精选项目 selected_project=精选项目
fold = 折叠
unfold = 展开


form.name_reserved=组织名称 '%s' 是被保留的。 form.name_reserved=组织名称 '%s' 是被保留的。
form.name_pattern_not_allowed=组织名称中不允许使用 "%s"。 form.name_pattern_not_allowed=组织名称中不允许使用 "%s"。


+ 92
- 3
templates/org/home.tmpl View File

@@ -1,3 +1,47 @@
<style>
.tag_key{
max-width:100%;
margin: 3px 3px;
display:inline-flex;
}
.tag_lable{
border: 1px solid rgba(232, 232, 232, 100) ;
border-radius: 4px;
color: rgba(65, 80, 88, 100);
font-family: Microsoft Yahei;
font-size: 14px;
padding: 0.3em 0.5em;
height: 30px;
text-align: center;
margin: 0.2em;
}
.tag_lable_first{
border: 1px solid rgba(232, 232, 232, 100) ;
border-radius: 4px;
color: rgba(65, 80, 88, 100);
font-family: Microsoft Yahei;
font-size: 14px;
padding: 0.3em 0.5em;
height: 30px;
text-align: center;
margin: 0.2em;
margin-left: none;
}
.omit{
overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tag_bg{
background-color: #0366D6 !important;
color:#FFFFFF !important;
}
.margin-top20{
margin-top: 20px;
}
.maxheight{
max-height: 88px;
overflow: hidden;
}
</style>
{{template "base/head" .}} {{template "base/head" .}}
<div class="organization profile"> <div class="organization profile">
{{/* overflow: auto is the clearfix - this avoids the image going beyond {{/* overflow: auto is the clearfix - this avoids the image going beyond
@@ -23,21 +67,50 @@
{{template "org/navber" .}} {{template "org/navber" .}}
{{template "org/select_pro" .}} {{template "org/select_pro" .}}
<div class="ui stackable grid"> <div class="ui stackable grid">
<div class="ui sixteen wide computer column">
<div class="ui mobile reversed stackable grid">
<div class="ui sixteen wide tablet sixteen wide computer column margin-top20 maxheight" id='key_tag'>
{{if .OrgTopics}}
<a class="{{if eq $.Keyword "" }} tag_bg {{end}} tag_key ui small tag_lable topic omit" href="{{$.Link}}?" >{{$.i18n.Tr "org.all_org_topics"}}</span></a>
{{end}}

{{range .OrgTopics}}
{{if ne .Name ""}}
<a class="{{if eq $.Keyword .Name }} tag_bg {{end}} tag_key ui small tag_lable topic omit" href="{{$.Link}}?q={{.Name}}" >
{{.Name}}
</a>
{{end}}
{{end}}
</div>
<div style="width: 100%;margin:-3px 5px 10px;">
<a class="text-right" onclick="isUnfold()" id="icon_btn"><i class="ri-arrow-down-s-line" style="display:inline-block;vertical-align:top"></i>&nbsp{{.i18n.Tr "org.fold"}}</a>
</div>
</div>
</div>
</div>
<div class="ui stackable grid">
<div class="ui sixteen wide computer column"> <div class="ui sixteen wide computer column">
<div class="ui mobile reversed stackable grid"> <div class="ui mobile reversed stackable grid">
<div class="ui ten wide tablet eleven wide computer column"> <div class="ui ten wide tablet eleven wide computer column">
{{if .CanCreateOrgRepo}}
<!-- {{if .CanCreateOrgRepo}}
<div class="text right"> <div class="text right">
<a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{.i18n.Tr "new_repo"}}</a> <a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{.i18n.Tr "new_repo"}}</a>
</div> </div>
{{end}}
{{end}} -->
{{template "org/repo_list" .}} {{template "org/repo_list" .}}
{{template "base/paginate" .}} {{template "base/paginate" .}}
</div> </div>


<div class="ui sixteen wide mobile six wide tablet five wide computer column"> <div class="ui sixteen wide mobile six wide tablet five wide computer column">
<h4 class="ui top attached header">
{{if .CanCreateOrgRepo}}
<div class="text right">
<a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{.i18n.Tr "new_repo"}}</a>
</div>
{{end}}
<h4 class="ui top attached header" style="margin-top: 10px;">
<strong>{{.i18n.Tr "org.people"}}</strong> <strong>{{.i18n.Tr "org.people"}}</strong>
<div class="ui right"> <div class="ui right">
<a class="text grey" href="{{.OrgLink}}/members">{{.MembersTotal}} {{svg "octicon-chevron-right" 16}}</a> <a class="text grey" href="{{.OrgLink}}/members">{{.MembersTotal}} {{svg "octicon-chevron-right" 16}}</a>
@@ -99,3 +172,19 @@
</div> </div>
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}

<script>

function isUnfold(){
var isContain= document.querySelector("#key_tag").classList.contains("maxheight");
if(isContain){
document.querySelector("#key_tag").classList.remove("maxheight");
document.getElementById("icon_btn").innerHTML="<i class=\"ri-arrow-up-s-line\" style=\"display:inline-block;vertical-align:top\"></i> &nbsp {{.i18n.Tr "org.fold"}}"
}else{
document.querySelector("#key_tag").classList.add("maxheight");
document.getElementById("icon_btn").innerHTML="<i class=\"ri-arrow-down-s-line\" style=\"display:inline-block;vertical-align:top\"></i> &nbsp {{.i18n.Tr "org.unfold"}}"


}
}
</script>

Loading…
Cancel
Save