Browse Source

修改#1446,组织成员修改组织成员为新建组织,组织团队为新建团队

tags/v1.22.1.3^2
wangjr 3 years ago
parent
commit
0623956cd8
5 changed files with 82 additions and 13 deletions
  1. +46
    -11
      templates/org/header.tmpl
  2. +32
    -0
      templates/org/header_course.tmpl
  3. +2
    -0
      templates/org/member/course_members.tmpl
  4. +1
    -1
      templates/org/team/courseTeams.tmpl
  5. +1
    -1
      templates/repo/createCourse.tmpl

+ 46
- 11
templates/org/header.tmpl View File

@@ -8,21 +8,56 @@
<img class="ui image" src="{{.SizedRelAvatarLink 100}}"> <img class="ui image" src="{{.SizedRelAvatarLink 100}}">
<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span> <span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
{{end}} {{end}}
{{if .IsOrganizationOwner}}
<div class="ui right">
<a class="ui green button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus" 16}} {{.i18n.Tr "org.create_new_team"}}</a>
</div>
{{end}}
{{if .CanCreateOrgRepo}}
<div class="ui right">
<a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{svg "octicon-plus" 16}} {{.i18n.Tr "new_repo"}}</a>
</div>
{{end}}
{{if .IsCourse}}
{{if .CanCreateOrgRepo}}
<div class="ui right">
<a class="ui green button" onclick="jion_course_team()">{{svg "octicon-plus" 16}} {{.i18n.Tr "org.teams.join_teams"}}</a>
</div>
{{end}}
{{else}}
{{if .IsOrganizationOwner}}
<div class="ui right">
<a class="ui green button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus" 16}} {{.i18n.Tr "org.create_new_team"}}</a>
</div>
{{end}}
{{if .CanCreateOrgRepo}}
<div class="ui right">
<a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{svg "octicon-plus" 16}} {{.i18n.Tr "new_repo"}}</a>
</div>
{{end}}
{{end}}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>


<script>

function jion_course_team(){
$.ajax({
type:"GET",
url:"/course/addOrg",
dataType:"json",
async:false,
success:function(json){
data = json;
if (data.code==0) {
$('.alert').html('{{.i18n.Tr "repo.computing.success"}}').removeClass('alert-danger').addClass('alert-success').show().delay(1500).fadeOut();
} 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()

// }else{
// alert("Join failure")
// }
},
});
}

</script>



+ 32
- 0
templates/org/header_course.tmpl View File

@@ -0,0 +1,32 @@
<div class="organization-header">
<div class="ui container">
<div class="ui vertically grid head">
<div class="column">
<div class="ui header">
{{with .Org}}
<img class="ui image" src="{{.SizedRelAvatarLink 100}}">
<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
{{end}}
{{if .IsCourse}}
{{if .CanCreateOrgRepo}}
<div class="ui right">
<a class="ui green button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus" 16}} {{.i18n.Tr "org.create_new_team"}}</a>
</div>
{{end}}
{{else}}
{{if .IsOrganizationOwner}}
<div class="ui right">
<a class="ui green button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus" 16}} {{.i18n.Tr "org.create_new_team"}}</a>
</div>
{{end}}
{{if .CanCreateOrgRepo}}
<div class="ui right">
<a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{svg "octicon-plus" 16}} {{.i18n.Tr "new_repo"}}</a>
</div>
{{end}}
{{end}}
</div>
</div>
</div>
</div>
</div>

+ 2
- 0
templates/org/member/course_members.tmpl View File

@@ -45,6 +45,8 @@
</style> </style>


{{template "base/head" .}} {{template "base/head" .}}
<!-- 提示框 -->
<div class="alert"></div>
<div class="organization members"> <div class="organization members">
{{template "org/header" .}} {{template "org/header" .}}
{{template "org/navber_course" .}} {{template "org/navber_course" .}}


+ 1
- 1
templates/org/team/courseTeams.tmpl View File

@@ -6,7 +6,7 @@
</style> </style>
{{template "base/head" .}} {{template "base/head" .}}
<div class="organization teams"> <div class="organization teams">
{{template "org/header" .}}
{{template "org/header_course" .}}
{{template "org/navber_course" .}} {{template "org/navber_course" .}}


<div class="ui container"> <div class="ui container">


+ 1
- 1
templates/repo/createCourse.tmpl View File

@@ -65,7 +65,7 @@
<button class="ui green button" id="submit_reponame"> <button class="ui green button" id="submit_reponame">
{{.i18n.Tr "new_course"}} {{.i18n.Tr "new_course"}}
</button> </button>
<a class="ui button" href="{{AppSubUrl}}/">{{.i18n.Tr "cancel"}}</a>
<a class="ui button" href="javascript:history.go(-1)">{{.i18n.Tr "cancel"}}</a>
</div> </div>
</div> </div>
</form> </form>


Loading…
Cancel
Save