@@ -200,14 +200,16 @@ var _hmt = _hmt || []; | |||
<div class="ui top secondary stackable main menu following bar dark"> | |||
{{template "base/head_navbar" .}} | |||
</div><!-- end bar --> | |||
<div class="notic_content" id ="notic_content" > | |||
<a href={{.notice.Link}} class="a_width"> | |||
<marquee behavior="scroll" direction="left"> | |||
{{.notice.Title}} | |||
</marquee> | |||
</a> | |||
<i class="ri-close-fill x_icon" onclick="closeNoice()"></i> | |||
</div> | |||
{{if not .IsCourse}} | |||
<div class="notic_content" id ="notic_content" > | |||
<a href={{.notice.Link}} class="a_width"> | |||
<marquee behavior="scroll" direction="left"> | |||
{{.notice.Title}} | |||
</marquee> | |||
</a> | |||
<i class="ri-close-fill x_icon" onclick="closeNoice()"></i> | |||
</div> | |||
{{end}} | |||
{{end}} | |||
{{/* | |||
</div> | |||
@@ -247,5 +249,8 @@ var _hmt = _hmt || []; | |||
document.getElementById("notic_content").style.display='none' | |||
} | |||
} | |||
isShowNotice(); | |||
if(! ".PageIsInstall") { | |||
isShowNotice(); | |||
} | |||
</script> |
@@ -62,9 +62,9 @@ | |||
-webkit-line-clamp: 2; | |||
-webkit-box-orient: vertical; | |||
} | |||
.ui.label{ | |||
.course_topic{ | |||
color:#0366D6 !important; | |||
background-color: #B3DBDB !important; | |||
background-color: rgba(179, 219, 219, 0.4) !important; | |||
font-weight:normal !important | |||
} | |||
.tag_text{ | |||
@@ -75,8 +75,16 @@ | |||
.card{ | |||
box-shadow: 0px 4px 4px 0px rgba(232, 232, 232, 60) !important; | |||
border-radius: 5px; | |||
border: 1px solid #E8E8E8 !important; | |||
border:1px solid #E8E8E8 !important; | |||
} | |||
.tags{ | |||
position: relative; | |||
overflow: hidden; | |||
height: 30px; | |||
line-height: 30px; | |||
-webkit-line-clamp: 1; | |||
-webkit-box-orient: vertical; | |||
} | |||
</style> | |||
<div style="width: 100%;"> | |||
@@ -86,9 +94,9 @@ | |||
<div class="extra full_height cor" > | |||
<div class="content " > | |||
{{if .Topics }} | |||
<div class=" tags " style="position: relative;"> | |||
<div class="omit tags " style="position: relative;"> | |||
{{range .Topics}} | |||
{{if ne . "" }}<a style="max-width:100%;margin: 5px 0;display:inline-flex;" ><span class="ui small label topic omit" >{{.}}</span></a>{{end}} | |||
{{if ne . "" }}<a style="max-width:100%;margin: 5px 0;display:inline-flex;" ><span class="ui small label topic course_topic" >{{.}}</span></a>{{end}} | |||
{{end}} | |||
</div> | |||
@@ -127,158 +135,3 @@ | |||
</div> | |||
</div> | |||
<script> | |||
console.log({{.Repos}}) | |||
var data; | |||
var filterData=[]; | |||
var num=0; | |||
function showcreate(obj){ | |||
document.getElementById("search_selectPro").value='' | |||
$('.ui.modal') | |||
.modal({ | |||
centered: false, | |||
onShow:function(){ | |||
$("#org_list").empty() | |||
getPro(1) | |||
}, | |||
onHide:function(){ | |||
} | |||
}) | |||
.modal('show') | |||
} | |||
function getPro(typeTag){ | |||
$.ajax({ | |||
type:"GET", | |||
url:"/org/{{.Org.Name}}/org_tag/repo_list?tagId="+typeTag, | |||
dataType:"json", | |||
async:false, | |||
success:function(json){ | |||
data = json.data; | |||
var n_length = data.length | |||
pro_html = getHTML(data) | |||
$("#org_list").append(pro_html) | |||
// console.log('原始',data) | |||
checkedNum(0) | |||
} | |||
}); | |||
} | |||
function getHTML(data){ | |||
let pro_html='' | |||
for (let i=0;i<data.length;i++){ | |||
if (data[i].Selected==true){ | |||
console.log("data[i]:",data[i]) | |||
pro_html += `<div class="ui checkbox" style="width: 33%;margin-bottom:10px" > <input type="checkbox" id = " ${i}" checked="" onclick="checkedNum(${i})" class="Relist" name ='select_pro_name' data-repoid="${data[i].RepoID}" data-reponame="${data[i].RepoName}" data-selected=${data[i].Selected} > <label class='omit image poping up' data-content=${data[i].RepoName} data-position="top left " data-variation="mini"> ${data[i].RepoName}</label></div>` | |||
pro_html += '</div>' | |||
} | |||
else{ | |||
pro_html += `<div class="ui checkbox" style="width: 33%;margin-bottom:10px" > <input type="checkbox" id = "${i}" onclick="checkedNum(${i})" class="Relist" name ='select_pro_name' data-repoid="${data[i].RepoID}" data-reponame="${data[i].RepoName}" data-selected= ${data[i].Selected}> <label class='omit image poping up' data-content=${data[i].RepoName} data-position="top left " data-variation="mini"> ${data[i].RepoName} </label></div>` | |||
pro_html += '</div>' | |||
} | |||
} | |||
return pro_html | |||
} | |||
function saveSeletedPro(typeTag){ | |||
var saveData=[]; | |||
$('input[name="select_pro_name"]:checked').each(function(){ | |||
// console.log('值',this.dataset.repoid) | |||
saveData.push(parseInt(this.dataset.repoid)); | |||
}) | |||
if(saveData.length>9){ | |||
alert("最多可选9个,保存失败") | |||
return | |||
} | |||
// saveData = getSelecteDataID(); | |||
// console.log("数据:",saveData) | |||
$.ajax({ | |||
type:"POST", | |||
url:"/org/{{.Org.Name}}/org_tag/repo_submit?tagId="+typeTag, | |||
contentType:'application/json', | |||
dataType:"json", | |||
async:false, | |||
data:JSON.stringify({'repoList':saveData | |||
}), | |||
success:function(res){ | |||
console.log('保存成功'); | |||
location.reload() | |||
} | |||
}); | |||
} | |||
function getSelecteData(){ | |||
var selectedData=[]; | |||
$('input[name="select_pro_name"]:checked').each(function(){ | |||
// console.log(this) | |||
// console.log('值',this.dataset.selected) | |||
selectedData.push({"RepoID":parseInt(this.dataset.repoid),"RepoName":this.dataset.reponame,"Selected":JSON.parse(this.dataset.selected)}); | |||
}) | |||
return selectedData | |||
} | |||
function search(){ | |||
var selectedData = getSelecteData(); | |||
var searchValue = document.getElementById("search_selectPro").value; | |||
filterData=[]; | |||
console.log("searchValue:",searchValue) | |||
for (let i=0;i<data.length;i++){ | |||
var isInclude=false; | |||
if(data[i].RepoName.toLowerCase().includes(searchValue.toLowerCase())){ | |||
filterData.push(data[i]) | |||
} | |||
} | |||
// console.log("选中的值:",selectedData) | |||
// console.log("筛选包括选中的值:",filterData) | |||
var showData=[]; | |||
for(i=0;i<selectedData.length;i++){ | |||
filterData =filterData.filter((item)=>{ | |||
return item.RepoID!=selectedData[i].RepoID | |||
}); | |||
} | |||
console.log("筛选后不包括选中的值:",filterData) | |||
$("#org_list").empty() | |||
if(searchValue!=""){ | |||
if (filterData.length!=0){ | |||
var pro_html = getHTML(selectedData); | |||
console.log("selectedData_pro_html:",pro_html) | |||
$("#org_list").append(pro_html) | |||
pro_html= getHTML(filterData); | |||
$("#org_list").append(pro_html) | |||
}else{ | |||
var pro_html = getHTML(selectedData); | |||
$("#org_list").append(pro_html) | |||
} | |||
}else{ | |||
var pro_html = getHTML(data); | |||
$("#org_list").append(pro_html) | |||
} | |||
} | |||
function checkedNum(id){ | |||
num=0; | |||
var inputs = document.getElementsByName("select_pro_name") | |||
for (var i=0;i<inputs.length;i++){ | |||
if(inputs[i].checked){ | |||
num++ | |||
if(num>9){ | |||
document.getElementById(id).checked=false | |||
alert("选择超过9个,请重新选择!") | |||
return | |||
} | |||
} | |||
} | |||
var show_num = 9-num; | |||
document.getElementById("recommend").innerHTML="还能推荐"+show_num+"个" | |||
} | |||
</script> |
@@ -79,10 +79,15 @@ | |||
.noborder{ | |||
border: none !important; | |||
} | |||
.div_bt{ | |||
text-align: center; | |||
margin-top: 5px; | |||
margin-top: 10px; | |||
} | |||
</style> | |||
{{template "base/head_course" .}} | |||
{{template "base/head" .}} | |||
<!-- 提示框 --> | |||
<div class="alert"></div> | |||
<div class="organization profile"> | |||
@@ -131,7 +136,7 @@ | |||
<div class="ui sixteen wide mobile six wide tablet four wide computer column"> | |||
<!-- {{if .CanCreateOrgRepo}} --> | |||
<div class="text center" > | |||
<div class=" ui bottom attached segment text center noborder text center" > | |||
<a style="width: 80%;" class="ui green button bpadding" href="{{AppSubUrl}}/course/create"><i class="ri-folder-add-line" style="vertical-align: middle;"></i> {{.i18n.Tr "org.release_course"}} </a> | |||
</div> | |||
<!-- {{end}} --> | |||
@@ -148,44 +153,49 @@ | |||
{{template "base/paginate" .}} | |||
</div> | |||
<div class="ui sixteen wide mobile six wide tablet four wide computer column"> | |||
<h4 class="ui top attached header noborder"> | |||
<strong>{{.i18n.Tr "org.selected_couse"}}</strong> | |||
<div class="ui right"> | |||
<a class="text grey" id="model" onclick="showcreate()">{{svg "octicon-gear" 16}}</a> | |||
</div> | |||
</h4> | |||
<div class="ui attached table segment course items noborder"> | |||
{{ range .tags}} | |||
{{if eq .TagName "精选项目"}} | |||
{{range $i, $v := .RepoList}} | |||
{{if gt $i 0}} | |||
<div class="ui divider" style="margin-bottom:10px;"></div> | |||
{{end}} | |||
<div class="item"> | |||
<i class="large icon ri-bookmark-3-line course_color"></i> | |||
<div class="content" style="margin-left: 10px;"> | |||
<a href="{{.Link}}"><strong class="team-name">{{.Alias}}</strong></a> | |||
<p class="text grey"> | |||
{{if ne .CreatorID 0}} | |||
{{$.i18n.Tr "home.contributors"}} : {{.Creator.Name}} | |||
{{else}} | |||
{{$.i18n.Tr "home.contributors"}}:{{.Owner.Name}} | |||
{{end}} | |||
</p> | |||
{{if .tags}} | |||
<h4 class="ui top attached header noborder"> | |||
<strong>{{.i18n.Tr "org.selected_couse"}}</strong> | |||
{{if .IsOrganizationOwner}} | |||
<div class="ui right"> | |||
<a class="text grey" id="model" onclick="showcreate()">{{svg "octicon-gear" 16}}</a> | |||
</div> | |||
{{end}} | |||
</h4> | |||
<div class="ui attached table segment course items noborder"> | |||
{{ range .tags}} | |||
{{if eq .TagName "精选项目"}} | |||
{{range $i, $v := .RepoList}} | |||
{{if gt $i 0}} | |||
<div class="ui divider" style="margin-bottom:10px;"></div> | |||
{{end}} | |||
<div class="item"> | |||
<i class="large icon ri-bookmark-3-line course_color"></i> | |||
<div class="content" style="margin-left: 10px;"> | |||
<a href="{{.Link}}"><strong class="team-name">{{.Alias}}</strong></a> | |||
<p class="text grey"> | |||
{{if ne .CreatorID 0}} | |||
{{$.i18n.Tr "home.contributors"}} : {{.Creator.Name}} | |||
{{else}} | |||
{{$.i18n.Tr "home.contributors"}}:{{.Owner.Name}} | |||
{{end}} | |||
</p> | |||
</div> | |||
</div> | |||
</div> | |||
{{end}} | |||
{{end}} | |||
{{end}} | |||
{{end}} | |||
</div> | |||
</div> | |||
{{end}} | |||
<h4 class="ui top attached header noborder"> | |||
<strong>{{.i18n.Tr "org.people"}}</strong> | |||
<div class="ui right"> | |||
<a class="text grey" href="{{.OrgLink}}/members">{{.MembersTotal}} {{svg "octicon-chevron-right" 16}}</a> | |||
</div> | |||
</h4> | |||
<div class="ui attached segment members noborder"> | |||
<div class="ui attached segment members course noborder"> | |||
{{$isMember := .IsOrganizationMember}} | |||
{{range .Members}} | |||
{{if or $isMember (.IsPublicMember $.Org.ID)}} | |||
@@ -193,8 +203,8 @@ | |||
{{end}} | |||
{{end}} | |||
<div style="text-align: center;margin-top: 5px;"> | |||
<a class="ui blue basic button" onclick="jion_course_team()"> <i class="ri-user-add-line"></i> {{.i18n.Tr "org.teams.join_teams"}}</a> | |||
<div class="ui bottom attached segment text center noborder"> | |||
<a class="ui blue basic button" onclick="jion_course_team()" style="width: 80%;"> <i class="ri-user-add-line"></i> {{.i18n.Tr "org.teams.join_teams"}}</a> | |||
</div> | |||
</div> | |||
{{if .IsOrganizationMember}} | |||
@@ -204,9 +214,9 @@ | |||
<a class="text grey" href="{{.OrgLink}}/teams"><span>{{.Org.NumTeams}}</span> {{svg "octicon-chevron-right" 16}}</a> | |||
</div> | |||
</div> | |||
<div class="ui attached table segment teams noborder"> | |||
<div class="ui attached table segment teams noborder"> | |||
{{range .Teams}} | |||
<div class="item"> | |||
<div style="margin-top: 10px;"> | |||
<a href="{{$.OrgLink}}/teams/{{.LowerName}}"><strong class="team-name">{{.Name}}</strong></a> | |||
<p class="text grey"> | |||
<a href="{{$.OrgLink}}/teams/{{.LowerName}}"><strong>{{.NumMembers}}</strong> {{$.i18n.Tr "org.lower_members"}}</a> · | |||
@@ -427,6 +437,7 @@ | |||
} else { | |||
$('.alert').html(data.error_msg).removeClass('alert-success').addClass('alert-danger').show().delay(5000).fadeOut(); | |||
} | |||
location.reload() | |||
// if(data.code==0){ | |||
// alert("Join success") | |||
// location.reload() | |||
@@ -44,7 +44,7 @@ | |||
} | |||
</style> | |||
{{template "base/head_course" .}} | |||
{{template "base/head" .}} | |||
<div class="organization members"> | |||
{{template "org/header" .}} | |||
{{template "org/navber_course" .}} | |||
@@ -4,7 +4,7 @@ | |||
border-bottom:none !important | |||
} | |||
</style> | |||
{{template "base/head_course" .}} | |||
{{template "base/head" .}} | |||
<div class="organization teams"> | |||
{{template "org/header" .}} | |||
{{template "org/navber_course" .}} | |||