| @@ -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> | |||||
| @@ -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> | |||||
| @@ -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" .}} | ||||
| @@ -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"> | ||||
| @@ -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> | ||||