update i18n services and auto-resizing height of table feature.

This commit is contained in:
kunw 2016-06-29 12:04:33 +08:00
parent c819049479
commit 48c9cbd3c3
11 changed files with 22 additions and 29 deletions

View File

@ -41,14 +41,6 @@ var mappingLangNames map[string]string
func (b *BaseController) Prepare() { func (b *BaseController) Prepare() {
var lang string var lang string
al := b.Ctx.Request.Header.Get("Accept-Language")
if len(al) > 4 {
al = al[:5] // Only compare first 5 letters.
if i18n.IsExist(al) {
lang = al
}
}
langCookie, err := b.Ctx.Request.Cookie("language") langCookie, err := b.Ctx.Request.Cookie("language")
if err != nil { if err != nil {

View File

@ -3,7 +3,7 @@ reset_email_subject = 重置您的密码
page_title_index = Harbor page_title_index = Harbor
page_title_dashboard = 消息中心 - Harbor page_title_dashboard = 消息中心 - Harbor
page_title_account_setting = 账户设置 - Harbor page_title_account_setting = 个人设置 - Harbor
page_title_reset_password = 重置密码 - Harbor page_title_reset_password = 重置密码 - Harbor
page_title_change_password = 修改密码 - Harbor page_title_change_password = 修改密码 - Harbor
page_title_forgot_password = 忘记密码 - Harbor page_title_forgot_password = 忘记密码 - Harbor

View File

@ -33,12 +33,11 @@
} }
.table-head-container { .table-head-container {
width: 96%;
} }
.table-body-container { .table-body-container {
overflow-y: auto; overflow-y: auto;
width: 98%;
} }
.gutter { .gutter {

View File

@ -47,7 +47,6 @@
margin: 15px; margin: 15px;
height: auto; height: auto;
min-height: 50px; min-height: 50px;
width: 100%;
} }
.well-split { .well-split {

View File

@ -23,15 +23,18 @@
}; };
if(!angular.isDefined(scope.subsHeight)) scope.subsHeight = 110; if(!angular.isDefined(scope.subsHeight)) scope.subsHeight = 110;
if(!angular.isDefined(scope.subsSection)) scope.subsSection = 32; if(!angular.isDefined(scope.subsSection)) scope.subsSection = 32;
if(!angular.isDefined(scope.subsSubPane)) scope.subsSubPane = 226; if(!angular.isDefined(scope.subsSubPane)) scope.subsSubPane = 226;
if(!angular.isDefined(scope.subsTblBody)) scope.subsTblBody = 40;
scope.$watch(scope.getDimension, function(current) { scope.$watch(scope.getDimension, function(current) {
if(current) { if(current) {
var h = current.h; var h = current.h;
element.find('.section').css({'height': (h - scope.subsHeight - scope.subsSection) + 'px'}); element.find('.section').css({'height': (h - scope.subsHeight - scope.subsSection) + 'px'});
element.find('.sub-pane').css({'height': (h - scope.subsHeight - scope.subsSubPane) + 'px'}); element.find('.sub-pane').css({'height': (h - scope.subsHeight - scope.subsSubPane) + 'px'});
element.find('.tab-pane').css({'height': (h - scope.subsHeight - scope.subsSubPane) + 'px'}); element.find('.tab-pane').css({'height': (h - scope.subsHeight - scope.subsSubPane) + 'px'});
var subPaneHeight = element.find('.sub-pane').height();
element.find('.table-body-container').css({'height': (subPaneHeight - scope.subsTblBody) + 'px'});
} }
}, true); }, true);

View File

@ -24,7 +24,7 @@
</thead> </thead>
</table> </table>
</div> </div>
<div class="table-body-container" style="height: 300px;"> <div class="table-body-container">
<table class="table table-pane"> <table class="table table-pane">
<tbody> <tbody>
<tr ng-repeat="log in vm.logs"> <tr ng-repeat="log in vm.logs">

View File

@ -35,7 +35,6 @@
} }
function logOutSuccess(data, status) { function logOutSuccess(data, status) {
currentUser.unset(); currentUser.unset();
I18nService().unset();
$window.location.href= '/'; $window.location.href= '/';
} }
function logOutFailed(data, status) { function logOutFailed(data, status) {

View File

@ -21,7 +21,7 @@
</thead> </thead>
</table> </table>
</div> </div>
<div class="table-body-container" style="height: 300px;"> <div class="table-body-container">
<table class="table table-pane"> <table class="table table-pane">
<tbody> <tbody>
<tr ng-repeat="pr in vm.projectMembers" edit-project-member username="pr.username" project-id="vm.projectId" user-id="pr.user_id" delete="vm.deleteProjectMember({projectId: vm.projectId, userId: pr.user_id})" current-user-id="vm.user.user_id" role-name="pr.role_name" reload='vm.search({projectId: vm.projectId, username: vm.username})'></tr> <tr ng-repeat="pr in vm.projectMembers" edit-project-member username="pr.username" project-id="vm.projectId" user-id="pr.user_id" delete="vm.deleteProjectMember({projectId: vm.projectId, userId: pr.user_id})" current-user-id="vm.user.user_id" role-name="pr.role_name" reload='vm.search({projectId: vm.projectId, username: vm.username})'></tr>

View File

@ -23,11 +23,11 @@
</thead> </thead>
</table> </table>
</div> </div>
<div class="table-body-container" style="height: 200px;"> <div class="table-body-container">
<table class="table table-pane"> <table class="table table-pane">
<tbody> <tbody>
<tr ng-if="vm.destinations.length == 0"> <tr ng-if="vm.destinations.length == 0">
<td colspan="7" height="100%" class="empty-hint" ><h3 class="text-muted">// 'no_destinations' | tr //</h3></td> <td colspan="7" height="100%" class="empty-hint" ><h3 class="text-muted">// 'no_destinations' | tr //</h3></td>
</tr> </tr>
<tr ng-if="vm.destinations.length > 0" ng-repeat="r in vm.destinations"> <tr ng-if="vm.destinations.length > 0" ng-repeat="r in vm.destinations">
<td>//r.name//</td> <td>//r.name//</td>
@ -43,8 +43,8 @@
</table> </table>
</div> </div>
</div> </div>
<div class="col-xs-4 col-md-12 well well-sm well-custom">
<div class="col-md-offset-10">//vm.destinations ? vm.destinations.length : 0// // 'items' | tr //</div>
</div>
</div> </div>
<div class="col-xs-4 col-md-12 well well-sm well-custom"><div class="col-md-offset-10">//vm.destinations ? vm.destinations.length : 0// // 'items' | tr //</div></div>
</div>
</div> </div>

View File

@ -11,7 +11,7 @@
function DestinationController($scope, ListDestinationService, DeleteDestinationService, $filter, trFilter) { function DestinationController($scope, ListDestinationService, DeleteDestinationService, $filter, trFilter) {
$scope.subsSubPane = 276; $scope.subsSubPane = 276;
$scope.subsTblBody = 40;
var vm = this; var vm = this;
vm.retrieve = retrieve; vm.retrieve = retrieve;

View File

@ -24,7 +24,7 @@
</thead> </thead>
</table> </table>
</div> </div>
<div class="table-body-container" style="height: 200px;"> <div class="table-body-container">
<table class="table table-pane"> <table class="table table-pane">
<tbody> <tbody>
<tr ng-if="vm.replications.length == 0"> <tr ng-if="vm.replications.length == 0">
@ -48,7 +48,7 @@
&nbsp; &nbsp;
<a href="javascript:void(0);" data-toggle="modal" data-target="#createPolicyModal" ng-click="vm.editReplication(r.id)"><span class="glyphicon glyphicon-pencil"></span></a> <a href="javascript:void(0);" data-toggle="modal" data-target="#createPolicyModal" ng-click="vm.editReplication(r.id)"><span class="glyphicon glyphicon-pencil"></span></a>
&nbsp; &nbsp;
<!--a href="javascript:void(0);"><span class="glyphicon glyphicon-trash"></span></a--> <!--a href="javascript:void(0);"><span class="glyphicon glyphicon-trash"></span></a-->
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -56,7 +56,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> <div class="col-xs-4 col-md-12 well well-sm well-custom">
<div class="col-xs-4 col-md-12 well well-sm well-custom"><div class="col-md-offset-10">//vm.replications ? vm.replications.length : 0// // 'items' | tr //</div></div> <div class="col-md-offset-10">//vm.replications ? vm.replications.length : 0// // 'items' | tr //</div>
</div> </div>
</div>
</div> </div>