Browse Source

Merge branch 'V20220228' into fix-cloudbrain-jobid

pull/1510/head
lewis 3 years ago
parent
commit
db765c2c78
10 changed files with 208 additions and 40 deletions
  1. +140
    -16
      custom/public/css/git.openi.css
  2. +3
    -0
      options/locale/locale_en-US.ini
  3. +3
    -0
      options/locale/locale_zh-CN.ini
  4. +34
    -3
      public/home/home.js
  5. +4
    -2
      routers/repo/user_data_analysis.go
  6. +1
    -1
      routers/user/notification.go
  7. +8
    -4
      templates/home.tmpl
  8. +13
    -12
      templates/org/select_pro.tmpl
  9. +1
    -1
      web_src/js/components/MinioUploader.vue
  10. +1
    -1
      web_src/js/components/ObsUploader.vue

+ 140
- 16
custom/public/css/git.openi.css View File

@@ -44,6 +44,12 @@
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.ui.label{
font-weight: normal;
}
.active {
color: #0366D6 !important;
}


.opacity5{ opacity:0.5;} .opacity5{ opacity:0.5;}
.radius15{ border-radius:1.5rem !important; } .radius15{ border-radius:1.5rem !important; }
@@ -250,9 +256,13 @@
box-shadow: none !important; box-shadow: none !important;
} }
.homeorg-list .card .ui.small.header .content{ .homeorg-list .card .ui.small.header .content{
width: calc(100% - 3.25em);
width: calc(100% - 3.75em);
} }
.homepro-list{
.homepro-tit{
z-index: 9;
position: relative;
}
.homepro-list, .homeorg-list{
position: relative; position: relative;
z-index: 9; z-index: 9;
padding: 1.0em 1.0em 3.0em; padding: 1.0em 1.0em 3.0em;
@@ -261,42 +271,156 @@
.homepro-list .ui.card{ .homepro-list .ui.card{
border-radius: 15px; border-radius: 15px;
background-color: #FFF; background-color: #FFF;
box-shadow: 0px 5px 10px 0px rgba(105, 192, 255, 30);
border: 1px solid rgba(105, 192, 255, 40);
box-shadow: 0px 5px 10px 0px rgba(105, 192, 255, .3);
border: 1px solid rgba(105, 192, 255, .4);
min-height: 10.8em; min-height: 10.8em;
} }
.homepro-list .ui.card>.content>.header{ .homepro-list .ui.card>.content>.header{
line-height: 40px !important; line-height: 40px !important;
} }


.homepro-list .swiper-pagination-bullet-active{
.homepro-list .swiper-pagination-bullet-active, .homeorg-list .swiper-pagination-bullet-active{
width: 40px; width: 40px;
border-radius: 4px;
border-radius: 4px;
} }
.i-env > div{ .i-env > div{
position: relative; position: relative;
} }


/**seach**/
/**搜索导航条适配窄屏**/
.seachnav{
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none; /* firefox */
-ms-overflow-style: none; /* IE 10+ */
}
.seachnav::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
.ui.green.button, .ui.green.buttons .button{
background-color: #5BB973;
}
.seach .repos--seach{
padding-bottom: 0;
border-bottom: none;
}
.seach .ui.secondary.pointing.menu{
border-bottom: none;
}
.seach .ui.secondary.pointing.menu .item > i{
margin-right: 5px;
}
.seach .ui.secondary.pointing.menu .active.item{
border-bottom-width: 2px;
margin: 0 0 -1px;
}
.seach .ui.menu .active.item>.label {
background: #1684FC;
color: #FFF;
}
.seach .ui.menu .item>.label:not(.active.item>.label) {
background: #e8e8e8;
color: rgba(0,0,0,.6);
}

.highlight{
color: red;
}
.ui.list .list>.item>img.image+.content, .ui.list>.item>img.image+.content {
width: calc(100% - 3.0em);
margin-left: 0;
}

.seach .ui.list .list>.item .header, .seach .ui.list>.item .header{
margin-bottom: 0.5em;
font-size: 1.4rem !important;
font-weight: normal;
}
.seach .time, .seach .time a{
font-size: 12px;
color: grey;
}

.seach .list .item.members .ui.avatar.image {
width: 3.2em;
height: 3.2em;
}
.ui.list .list>.item.members>img.image+.content, .ui.list>.item.members>img.image+.content {
width: calc(100% - 4.0em);
margin-left: 0;
}

@media only screen and (max-width: 767px) { @media only screen and (max-width: 767px) {
.am-mt-30{ margin-top: 1.5rem !important;} .am-mt-30{ margin-top: 1.5rem !important;}
.ui.secondary.hometop.segment{ .ui.secondary.hometop.segment{
margin-bottom: 2.0rem;
margin-bottom: 5.0rem;
} }
.bannerpic, .i-code-pic{
.bannerpic{
display: none; display: none;
} }
.i-code h2::before {
left: calc(-5.0rem + 6px);
#homenews{
bottom: -3em;
} }
.i-code h2.am-bw::before{
left: calc(-4.0rem + 6px);
#homenews > p {
margin-left: 1.0em;
}
.homenews{
padding-left: 1.3em !important;
border-radius: 1.5em;
}
.homenews::before{
left: 2em;
}
.homepro-tit > p{
background: #FFF;
}
.homeorg{
padding-left: 3.5em;
}
.homeorg-tit::after {
left: -2.3em;
}
.homeorg-list{
margin: 0 0 2.0em !important;
}
.homeorg-list > .column{
width: 3em !important;
margin-left: -0.5em;
padding: 0.5rem 0 0 !important;
}
.homeorg-list .card{
background: none !important;
}
.homeorg-list .card > .content{
padding: 0 !important;
}
.homeorg-list > .column .card .ui.header>img{
width: 3.0em;
height: 3.0em;
border-radius: 2.0em;
border: 2px solid #FFF;
}
.homeorg-list > .column .card .ui.header > .content{
display: none;
} }
.leftline01{ .leftline01{
width: calc(50% - 4.0rem);
width: 4.0em;
bottom: 4em;
border-radius: 0 0 0 3.0em;
} }
.leftline02{
left: calc(50% - 1.0rem);
top: calc(-3.5rem - 2px);
.leftline02, .leftline02-2{
left: 6.0em;
top: calc(-4.0em - 2px);
border-radius: 0 3.0em 3.0em 0;
width: calc(50% - 6.0em);
}
.leftline02-2 {
width: calc(50% - 8.0em);
}
.i-env .ui.cards>.card>.content .description{
display: none;
} }
} }




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

@@ -2078,6 +2078,9 @@ custom_select_courses = Customize selected courses
recommend_remain_pro = Remain recommend_remain_pro = Remain
save_fail_tips = The upper limit is exceeded save_fail_tips = The upper limit is exceeded
select_again = Select more than 9, please select again! select_again = Select more than 9, please select again!
custom_select_projects = Customize selected projects
customize = Customize
selected_project=Selected Projects


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

@@ -2088,6 +2088,9 @@ custom_select_courses = 自定义精选课程
recommend_remain_pro = 还能推荐 recommend_remain_pro = 还能推荐
save_fail_tips = 最多可选9个,保存失败 save_fail_tips = 最多可选9个,保存失败
select_again = 选择超过9个,请重新选择! select_again = 选择超过9个,请重新选择!
custom_select_projects = 自定义精选项目
customize = 自定义
selected_project=精选项目


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


+ 34
- 3
public/home/home.js View File

@@ -6,7 +6,6 @@ if(isEmpty(token)){
token = meta.attr("content"); token = meta.attr("content");
} }
} }

var swiperNewMessage = new Swiper(".newslist", { var swiperNewMessage = new Swiper(".newslist", {
direction: "vertical", direction: "vertical",
slidesPerView: 10, slidesPerView: 10,
@@ -17,7 +16,7 @@ var swiperNewMessage = new Swiper(".newslist", {
}, },
}); });
var swiperRepo = new Swiper(".homepro-list", { var swiperRepo = new Swiper(".homepro-list", {
slidesPerView: 3,
slidesPerView: 1,
slidesPerColumn: 2, slidesPerColumn: 2,
slidesPerColumnFill:'row', slidesPerColumnFill:'row',
spaceBetween: 30, spaceBetween: 30,
@@ -29,6 +28,37 @@ var swiperRepo = new Swiper(".homepro-list", {
delay: 2500, delay: 2500,
disableOnInteraction: false, disableOnInteraction: false,
}, },
breakpoints: {
768: {
slidesPerView: 2,
},
1024: {
slidesPerView: 3,
},
},
});

var swiperOrg = new Swiper(".homeorg-list", {
slidesPerView: 1,
slidesPerColumn: 4,
slidesPerColumnFill:'row',
spaceBetween: 15,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
autoplay: {
delay: 4500,
disableOnInteraction: false,
},
breakpoints: {
768: {
slidesPerView: 2,
},
1024: {
slidesPerView: 3,
},
},
}); });


var output = document.getElementById("newmessage"); var output = document.getElementById("newmessage");
@@ -392,7 +422,7 @@ function displayOrg(json){
if (json != null && json.length > 0){ if (json != null && json.length > 0){
for(var i = 0; i < json.length;i++){ for(var i = 0; i < json.length;i++){
var record = json[i] var record = json[i]
html += "<div class=\"column\">";
html += "<div class=\"swiper-slide\">";
html += " <a href=\"/" + record["Name"] + "\" class=\"ui fluid card\">"; html += " <a href=\"/" + record["Name"] + "\" class=\"ui fluid card\">";
html += " <div class=\"content\">"; html += " <div class=\"content\">";
html += " <div class=\"ui small header\">"; html += " <div class=\"ui small header\">";
@@ -408,4 +438,5 @@ function displayOrg(json){
} }
} }
orgDiv.innerHTML = html; orgDiv.innerHTML = html;
swiperOrg.updateSlides();
} }

+ 4
- 2
routers/repo/user_data_analysis.go View File

@@ -63,11 +63,13 @@ func queryUserDataPage(ctx *context.Context, tableName string, queryObj interfac
_, count := models.QueryUserStaticDataByTableName(1, 1, tableName, queryObj, userName) _, count := models.QueryUserStaticDataByTableName(1, 1, tableName, queryObj, userName)
var indexTotal int64 var indexTotal int64
indexTotal = 0 indexTotal = 0
row := 1
for { for {
re, _ := models.QueryUserStaticDataByTableName(int(indexTotal), PAGE_SIZE, tableName, queryObj, "") re, _ := models.QueryUserStaticDataByTableName(int(indexTotal), PAGE_SIZE, tableName, queryObj, "")
log.Info("return count=" + fmt.Sprint(count)) log.Info("return count=" + fmt.Sprint(count))
for i, userRecord := range re {
rows := fmt.Sprint(i + 2)
for _, userRecord := range re {
row++
rows := fmt.Sprint(row)
xlsx.SetCellValue(sheetName, "A"+rows, userRecord.ID) xlsx.SetCellValue(sheetName, "A"+rows, userRecord.ID)
xlsx.SetCellValue(sheetName, "B"+rows, userRecord.Name) xlsx.SetCellValue(sheetName, "B"+rows, userRecord.Name)
xlsx.SetCellValue(sheetName, "C"+rows, userRecord.CodeMergeCount) xlsx.SetCellValue(sheetName, "C"+rows, userRecord.CodeMergeCount)


+ 1
- 1
routers/user/notification.go View File

@@ -132,7 +132,7 @@ func getNotifications(c *context.Context) {
} }


c.Data["Title"] = c.Tr("notifications") c.Data["Title"] = c.Tr("notifications")
c.Data["Keyword"] = keyword
//c.Data["Keyword"] = keyword
c.Data["Status"] = status c.Data["Status"] = status
c.Data["Notifications"] = notifications c.Data["Notifications"] = notifications




+ 8
- 4
templates/home.tmpl View File

@@ -20,7 +20,7 @@
<div id="homenews" class="ui container"> <div id="homenews" class="ui container">
<p>* {{.page_only_dynamic}}</p> <p>* {{.page_only_dynamic}}</p>
<div class="ui grid"> <div class="ui grid">
<div class="twelve wide tablet ten wide computer column homenews">
<div class="sixteen wide mobile twelve wide tablet ten wide computer column homenews">
<div class="newslist"> <div class="newslist">
<div class="ui mini aligned list swiper-wrapper" id="newmessage"> <div class="ui mini aligned list swiper-wrapper" id="newmessage">
@@ -42,7 +42,11 @@
<a href="{{AppSubUrl}}/explore/organizations" class="circular ui primary basic button">{{.page_recommend_org_more}} <i class="arrow circle right icon"></i></a> <a href="{{AppSubUrl}}/explore/organizations" class="circular ui primary basic button">{{.page_recommend_org_more}} <i class="arrow circle right icon"></i></a>
</div> </div>
<div class="sixteen wide tablet twelve wide computer column"> <div class="sixteen wide tablet twelve wide computer column">
<div class="ui stackable three column grid homeorg-list" id="recommendorg">
<div class="homeorg-list">
<div class="swiper-wrapper" id="recommendorg">
</div>
<div class="swiper-pagination"></div>
</div> </div>
</div> </div>
@@ -78,7 +82,7 @@
<h2>{{.page_dev_env}}</h2> <h2>{{.page_dev_env}}</h2>
<p><span class="ui text grey">{{.page_dev_env_desc}}</p> <p><span class="ui text grey">{{.page_dev_env_desc}}</p>
</div> </div>
<div class="ui four stackable cards">
<div class="ui four doubling cards">
<div class="card"> <div class="card">
<div class="image"> <div class="image">
<img src="/img/i-pic-01.svg"> <img src="/img/i-pic-01.svg">
@@ -158,4 +162,4 @@
<script src="/home/home.js?v={{MD5 AppVer}}" type="text/javascript"></script> <script src="/home/home.js?v={{MD5 AppVer}}" type="text/javascript"></script>




{{template "base/footer" .}}
{{template "base/footer" .}}

+ 13
- 12
templates/org/select_pro.tmpl View File

@@ -70,11 +70,11 @@
<div style="width: 100%;margin:15px 0;"> <div style="width: 100%;margin:15px 0;">
{{if .tags}} {{if .tags}}
<span class="header"> <span class="header">
精选项目
{{.i18n.Tr "org.selected_project"}}
</span> </span>
<!-- {{.IsOrganizationOwner}} --> <!-- {{.IsOrganizationOwner}} -->
{{if .IsOrganizationOwner}} {{if .IsOrganizationOwner}}
<a class="text-right" id="model" onclick="showcreate()" >{{svg "octicon-gear" 16}}自定义</a>
<a class="text-right" id="model" onclick="showcreate()" >{{svg "octicon-gear" 16}}{{.i18n.Tr "org.customize"}}</a>
{{end}} {{end}}
{{end}} {{end}}
@@ -137,10 +137,10 @@


<div class="ui modal"> <div class="ui modal">
<div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);"> <div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
<h4 id="model_header">自定义精选项目</h4>
<h4 id="model_header">{{.i18n.Tr "org.custom_select_projects"}}</h4>
</div> </div>
<div class="content content-padding" style="color: black;"> <div class="content content-padding" style="color: black;">
<p>最多可选9个公开项目</p>
<p>{{.i18n.Tr "org.max_selectedPro"}}</p>
<div class="ui search" > <div class="ui search" >
<div class="ui input" style="width: 100%;"> <div class="ui input" style="width: 100%;">
<input type="text" id = 'search_selectPro' placeholder="Search ..." value = '' oninput="search()"> <input type="text" id = 'search_selectPro' placeholder="Search ..." value = '' oninput="search()">
@@ -223,12 +223,12 @@
function saveSeletedPro(typeTag){ function saveSeletedPro(typeTag){
var saveData=[]; var saveData=[];
$('input[name="select_pro_name"]:checked').each(function(){ $('input[name="select_pro_name"]:checked').each(function(){
console.log('值',this.dataset.repoid)
// console.log('值',this.dataset.repoid)


saveData.push(parseInt(this.dataset.repoid)); saveData.push(parseInt(this.dataset.repoid));
}) })
if(saveData.length>9){ if(saveData.length>9){
alert("最多可选9个,保存失败")
alert("{{.i18n.Tr "org.save_fail_tips"}}")
return return
} }
// saveData = getSelecteDataID(); // saveData = getSelecteDataID();
@@ -242,7 +242,7 @@
data:JSON.stringify({'repoList':saveData data:JSON.stringify({'repoList':saveData
}), }),
success:function(res){ success:function(res){
console.log('保存成功');
// console.log('保存成功');
location.reload() location.reload()


} }
@@ -270,15 +270,15 @@
filterData.push(data[i]) filterData.push(data[i])
} }
} }
console.log("选中的值:",selectedData)
console.log("筛选包括选中的值:",filterData)
// console.log("选中的值:",selectedData)
// console.log("筛选包括选中的值:",filterData)
var showData=[]; var showData=[];
for(i=0;i<selectedData.length;i++){ for(i=0;i<selectedData.length;i++){
filterData =filterData.filter((item)=>{ filterData =filterData.filter((item)=>{
return item.RepoID!=selectedData[i].RepoID return item.RepoID!=selectedData[i].RepoID
}); });
} }
console.log("筛选后不包括选中的值:",filterData)
// console.log("筛选后不包括选中的值:",filterData)
$("#org_list").empty() $("#org_list").empty()
if(searchValue!=""){ if(searchValue!=""){
if (filterData.length!=0){ if (filterData.length!=0){
@@ -307,7 +307,7 @@
num++ num++
if(num>9){ if(num>9){
document.getElementById(id).checked=false document.getElementById(id).checked=false
alert("选择超过9个,请重新选择!")
alert("{{.i18n.Tr "org.select_again"}}")
return return
} }
} }
@@ -315,7 +315,8 @@
} }


var show_num = 9-num; var show_num = 9-num;
document.getElementById("recommend").innerHTML="还能推荐"+show_num+"个"
let rec = "{{.i18n.Tr "org.recommend_remain_pro"}}"
document.getElementById("recommend").innerHTML=rec +" : "+ show_num


} }



+ 1
- 1
web_src/js/components/MinioUploader.vue View File

@@ -81,7 +81,7 @@ export default {
dictInvalidFileType: this.dropzoneParams.data('invalid-input-type'), dictInvalidFileType: this.dropzoneParams.data('invalid-input-type'),
dictFileTooBig: this.dropzoneParams.data('file-too-big'), dictFileTooBig: this.dropzoneParams.data('file-too-big'),
dictRemoveFile: this.dropzoneParams.data('remove-file'), dictRemoveFile: this.dropzoneParams.data('remove-file'),
previewTemplate
// previewTemplate
}); });
dropzoneUploader.on('addedfile', (file) => { dropzoneUploader.on('addedfile', (file) => {
setTimeout(() => { setTimeout(() => {


+ 1
- 1
web_src/js/components/ObsUploader.vue View File

@@ -82,7 +82,7 @@ export default {
dictInvalidFileType: this.dropzoneParams.data('invalid-input-type'), dictInvalidFileType: this.dropzoneParams.data('invalid-input-type'),
dictFileTooBig: this.dropzoneParams.data('file-too-big'), dictFileTooBig: this.dropzoneParams.data('file-too-big'),
dictRemoveFile: this.dropzoneParams.data('remove-file'), dictRemoveFile: this.dropzoneParams.data('remove-file'),
previewTemplate
// previewTemplate
}); });
dropzoneUploader.on('addedfile', (file) => { dropzoneUploader.on('addedfile', (file) => {
setTimeout(() => { setTimeout(() => {


Loading…
Cancel
Save