1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-30 22:34:53 +00:00

Merge pull request #947 from haiwen/groups_v2

[groups] redesigned the UI
This commit is contained in:
Daniel Pan 2015-12-17 15:19:08 +08:00
commit c801ce4ad1
4 changed files with 36 additions and 12 deletions

View File

@ -3759,11 +3759,27 @@ img.thumbnail {
}
#groups .group-name {
font-size:16px;
margin:15px 0 10px;
padding-left:3px;
border-bottom:1px solid #e6e6e6;
margin:15px 0 0;
}
#groups .group-name .a {
color:#322;
}
#groups .empty-tips {
margin:10px 0 40px;
#groups table {
margin:0 0 32px;
}
#groups th {
font-size:0;
padding:0;
}
#groups th,
#groups td {
border-bottom:0;
}
#groups .empty-tip {
color:#a4a4a4;
padding:4px 0;
border-bottom:1px solid #e5e5e5;
margin:0 0 32px;
}

View File

@ -66,7 +66,9 @@
</td>
<td><%= size_formatted %></td>
<td><%= mtime_relative %></td>
<% if (show_shared_by) { %>
<td><span title="<%- owner %>"><%- owner_nickname %></span></td>
<% } %>
</script>
<script type="text/template" id="organization-repo-tmpl">
<td>
@ -872,19 +874,18 @@
<h4 class="group-name ellipsis"><a href="#group/<%= id %>/" title="<%- name %>" class="a normal"><%- name %></a></h4>
<% if (repos.length) { %>
<table>
<thead>
<thead class="vh"><!--use .vh for <td> width-->
<tr>
<th width="4%"><!--icon--></th>
<th width="40%">{% trans "Name" %}</th>
<th width="8%"><!--op--></th>
<th width="14%">{% trans "Size" %}</th>
<th width="18%">{% trans "Last Update" %}</th>
<th width="16%">{% trans "Shared By" %}</th>
<th width="46%">{% trans "Name" %}</th>
<th width="10%"><!--op--></th>
<th width="20%">{% trans "Size" %}</th>
<th width="20%">{% trans "Last Update" %}</th>
</tr>
</thead>
<tbody></tbody>
</table>
<% } else { %>
<p class="empty-tips alc">{% trans "No library is shared to this group" %}</p>
<p class="empty-tip alc">{% trans "No library is shared to this group" %}</p>
<% } %>
</script>

View File

@ -39,7 +39,8 @@ define([
var view = new GroupRepoView({
model: new Backbone.Model(item, {collection: groupRepos}),
group_id: group_id,
is_staff: is_staff
is_staff: is_staff,
show_shared_by: false // don't show 'Shared By'
});
$listContainer.append(view.render().el);
});

View File

@ -21,6 +21,11 @@ define([
this.group_id = options.group_id;
this.is_staff = options.is_staff;
this.show_shared_by = true; // default
if (options.show_shared_by !== undefined) { // e.g. views/group-item.js
this.show_shared_by = options.show_shared_by;
}
this.listenTo(this.model, 'destroy', this.remove);
},
@ -28,7 +33,8 @@ define([
var obj = this.model.toJSON();
$.extend(obj, {
group_id: this.group_id,
is_staff: this.is_staff
is_staff: this.is_staff,
show_shared_by: this.show_shared_by
});
this.$el.html(this.template(obj));
return this;