Browse Source

修改课程组织成员页样式

pull/1425/head
wangjr 3 years ago
parent
commit
0da4ae1d7f
4 changed files with 103 additions and 73 deletions
  1. +2
    -0
      options/locale/locale_en-US.ini
  2. +2
    -0
      options/locale/locale_zh-CN.ini
  3. +95
    -69
      templates/org/member/course_members.tmpl
  4. +4
    -4
      templates/repo/view_list.tmpl

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

@@ -2096,6 +2096,8 @@ members.remove = Remove
members.leave = Leave
members.invite_desc = Add a new member to %s:
members.invite_now = Invite Now
course_members.remove = Remove
course_members.leave = Leave

teams.join = Join
teams.leave = Leave


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

@@ -2109,6 +2109,8 @@ members.remove=移除成员
members.leave=离开组织
members.invite_desc=邀请新的用户加入 %s:
members.invite_now=立即邀请
course_members.remove=移除
course_members.leave=离开

teams.join=加入团队
teams.leave=离开团队


+ 95
- 69
templates/org/member/course_members.tmpl View File

@@ -3,6 +3,45 @@
margin-bottom: 0px !important;
border-bottom:none !important
}
.course_header{
color: rgba(3, 102, 214, 100);
font-size: 16px;
text-align: left;
font-family: SourceHanSansSC-medium;
font-weight: bolder;
vertical-align: bottom;
}
.meb_label{
border-radius: 5px;
background-color: rgba(255, 255, 255, 100) !important;
color: rgba(255, 255, 255, 100);
font-size: 12px;
text-align: center;
font-family: Roboto;
border: 1px solid rgba(212, 212, 213, 100) !important;
margin-left: 1em !important;
}
.ui.small.label.topic {
margin-bottom: 0px !important;
}
.cor{
color:#888888 !important
}
.card_course{
padding:1em;
border: 1px solid #F5F5F6;
margin:1em;box-shadow: 0px 4px 4px 0px rgba(232, 232, 232, 60);
border-radius: 5px;border: 1px solid rgba(232, 232, 232, 100);
display: flex; width:calc(33.33333333333333% - 2em)
}
.button_leaveOrg{
position:absolute;right: -1px;top:0px;
}
.bt_mr{
margin-right: 0px !important;
font-size: 12px !important;
padding: 5px !important;
}
</style>

{{template "base/head" .}}
@@ -13,88 +52,64 @@
{{template "base/alert" .}}
<div class="ui stackable grid">
<div class="ui sixteen wide computer column list">
{{ range .Members}}
<div class="item ui grid">
<div class="ui two wide column">
<img class="ui avatar" src="{{.SizedRelAvatarLink 48}}">
</div><div class="ui three wide column">
<div class="meta"><a href="{{.HomeLink}}">{{.Name}}</a></div>
<div class="meta">{{.FullName}}</div>
</div><div class="ui four wide column center">
<div class="meta">
{{$.i18n.Tr "org.members.membership_visibility"}}
</div>
<div class="meta">
<div class="ui three cards" >
{{ range .Members}}
<div class="card_course" style="position: relative;" id = "{{.ID}}" onmouseover ="show_bt( {{.ID}} )" onmouseout="hide_bt({{.ID}})">
<div >
<img class="ui avatar " style="width: 45px;height:45px;margin-top: 2px;" src="{{.SizedRelAvatarLink 48}}">
<!-- <a style="display: block;font-size: 12px;text-align: center;margin-top: 0.5em;">显示</a> -->
<div class="meta" style="text-align: center; margin-top: 0.5em;">
{{ $isPublic := index $.MembersIsPublicMember .ID}}
{{if $isPublic}}
<strong>{{$.i18n.Tr "org.members.public"}}</strong>
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.i18n.Tr "org.members.public_helper"}}</a>){{end}}
<!-- <strong>{{$.i18n.Tr "org.members.public"}}</strong> -->
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}} <a class="link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.i18n.Tr "org.members.public_helper"}}</a> {{end}}
{{else}}
<strong>{{$.i18n.Tr "org.members.private"}}</strong>
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{$.i18n.Tr "org.members.private_helper"}}</a>){{end}}
<!-- <strong>{{$.i18n.Tr "org.members.private"}}</strong> -->
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}} <a class="link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{$.i18n.Tr "org.members.private_helper"}}</a> {{end}}
{{end}}
</div>
</div><div class="ui three wide column center">
<div class="meta">
{{$.i18n.Tr "org.members.member_role"}}
</div>
<div class="meta">
<strong>{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock" 16}} {{$.i18n.Tr "org.members.owner"}}{{else}}{{$.i18n.Tr "org.members.member"}}{{end}}</strong>
</div>
</div><div class="ui one wide column center">
<div class="meta">
2FA
</div>
<div class="meta">
<strong>
{{if index $.MembersTwoFaStatus .ID}}
<span class="text green">{{svg "octicon-check" 16}}</span>
{{else}}
{{svg "octicon-x" 16}}
{{end}}
</strong>
</div>
<div style="padding-left: 0.8em;">
<div>
<a href="{{.HomeLink}}" class="course_header"> {{.Name}}</a>
<div class="ui small label topic meb_label" >
{{if index $.MembersIsUserOrgOwner .ID}} {{$.i18n.Tr "org.members.owner"}}{{else}}{{$.i18n.Tr "org.members.member"}}{{end}}
</div>
</div>
</div><div class="ui three wide column">
<div class="text right">
{{if eq $.SignedUser.ID .ID}}
<form method="post" action="{{$.OrgLink}}/members/action/leave">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red small button" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.members.leave"}}</button>
</form>
{{else if $.IsOrganizationOwner}}
<form method="post" action="{{$.OrgLink}}/members/action/remove">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red small button" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.members.remove"}}</button>
</form>
{{end}}
<div class="meta" style="margin-top: 0.5em;">
{{.FullName}}
</div>
</div>
</div>
{{end}}
</div>

<!-- <div class="ui three cards" style="margin-bottom: 10px;">
{{ range .Members}}
<div class="card" >
<div class="image">
<img src="/images/avatar2/large/kristy.png">
</div>
<div class="content">
<a class="header">Kristy</a>
<div class="meta">
<span class="date">Joined in 2013</span>
</div>
<div class="description">
Kristy is an art director living in New York.
<div class="meta" style="margin-top: 0.5em;">
{{svg "octicon-mail" 16}}
<a class="cor" href="mailto:{{.Email}}" rel="nofollow"> {{.Email}}</a>
</div>
</div>
<div class="button_leaveOrg" style="display:none" >
{{if eq $.SignedUser.ID .ID}}
<form method="post" action="{{$.OrgLink}}/members/action/leave">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red basic button bt_mr" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.course_members.leave"}}</button>
</form>
{{else if $.IsOrganizationOwner}}
<form method="post" action="{{$.OrgLink}}/members/action/remove">
{{$.CsrfTokenHtml}}
<button type="submit" class="ui red basic button bt_mr" name="uid" value="{{.ID}}">{{$.i18n.Tr "org.course_members.remove"}}</button>
</form>
{{end}}
</div>
</div>
{{end}}

</div> -->
</div>
</div>
{{template "base/paginate" .}}
</div>
@@ -102,3 +117,14 @@
</div>
</div>
{{template "base/footer" .}}

<script>
function show_bt(bt_id){
console.log(bt_id)
document.getElementById(""+bt_id).getElementsByClassName("button_leaveOrg")[0].style.display="inline-block";
}
function hide_bt(bt_id){
document.getElementById(""+bt_id).getElementsByClassName("button_leaveOrg")[0].style.display="none";
}
</script>

+ 4
- 4
templates/repo/view_list.tmpl View File

@@ -73,7 +73,7 @@
</span>
</td>
{{else}}
<td class="name thirteen wide">
<td class="name four wide">
<span class="truncate">
{{if $entry.IsDir}}
{{$subJumpablePathName := $entry.GetSubJumpablePathName}}
@@ -94,12 +94,12 @@
</td>
{{end}}
<!-- <td class="message nine wide">
<td class="message nine wide">
<span class="truncate">
<a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
</span>
</td> -->
<td class="text right age one wide" style="text-align: right;">{{TimeSince $commit.Committer.When $.Lang}}</td>
</td>
<td class="text right age three wide">{{TimeSince $commit.Committer.When $.Lang}}</td>
</tr>
{{end}}
</tbody>


Loading…
Cancel
Save