10 changed files with 263 additions and 15 deletions
@ -0,0 +1,104 @@ |
|||||||
|
/* |
||||||
|
* Spreed WebRTC. |
||||||
|
* Copyright (C) 2013-2014 struktur AG |
||||||
|
* |
||||||
|
* This file is part of Spreed WebRTC. |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as published by |
||||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
.contactsmanager { |
||||||
|
.head { |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
.desc { |
||||||
|
font-size: 20px; |
||||||
|
font-weight: normal; |
||||||
|
text-align: baseline; |
||||||
|
} |
||||||
|
.addbtn { |
||||||
|
font-size: 14px; |
||||||
|
.fa-users { |
||||||
|
font-size: 22px; |
||||||
|
} |
||||||
|
.fa-plus { |
||||||
|
font-size: 15px; |
||||||
|
} |
||||||
|
} |
||||||
|
.editpicture { |
||||||
|
vertical-align: middle; |
||||||
|
float: left; |
||||||
|
margin-right: 20px; |
||||||
|
} |
||||||
|
.uploadbtn { |
||||||
|
margin-top: 7px; |
||||||
|
} |
||||||
|
.buddyPicture { |
||||||
|
position: relative; |
||||||
|
width: 46px; |
||||||
|
height: 46px; |
||||||
|
background: $actioncolor1; |
||||||
|
border-radius: 2px; |
||||||
|
margin: 0 auto; |
||||||
|
&:after { |
||||||
|
content: "\f007"; |
||||||
|
color: $actioncolor2; |
||||||
|
font-family: fontAwesome; |
||||||
|
font-size: 3em; |
||||||
|
position: relative; |
||||||
|
top: -6px; |
||||||
|
} |
||||||
|
} |
||||||
|
.editlist { |
||||||
|
max-height: 250px; |
||||||
|
overflow-y: auto; |
||||||
|
} |
||||||
|
.table { |
||||||
|
margin-bottom: 0px; |
||||||
|
tr:first-child td { |
||||||
|
border-top: none; |
||||||
|
} |
||||||
|
.picture { |
||||||
|
width: 15%; |
||||||
|
min-height: 46px; |
||||||
|
text-align: center; |
||||||
|
vertical-align: middle; |
||||||
|
} |
||||||
|
.name { |
||||||
|
width: 70%; |
||||||
|
text-align: left; |
||||||
|
vertical-align: middle; |
||||||
|
} |
||||||
|
.action { |
||||||
|
text-align: center; |
||||||
|
vertical-align: middle; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.search { |
||||||
|
&:before { |
||||||
|
position: absolute; |
||||||
|
font-family: "fontAwesome"; |
||||||
|
content: "\f002"; |
||||||
|
font-size: 14px; |
||||||
|
opacity: .4; |
||||||
|
top: 6px; |
||||||
|
left: 22px; |
||||||
|
} |
||||||
|
~ input { |
||||||
|
padding-left: 25px; |
||||||
|
} |
||||||
|
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,68 @@ |
|||||||
|
/* |
||||||
|
* Spreed WebRTC. |
||||||
|
* Copyright (C) 2013-2014 struktur AG |
||||||
|
* |
||||||
|
* This file is part of Spreed WebRTC. |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as published by |
||||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
||||||
|
define(['jquery', 'underscore', 'text!partials/contactsmanagerbutton.html', 'text!partials/contactsmanager.html'], function($, _, templateContactsManagerButton, templateContactsManager) { |
||||||
|
|
||||||
|
return ['contacts', 'alertify', function(contacts, alertify) { |
||||||
|
|
||||||
|
var contactsManagerController = ['$scope', '$modalInstance', 'contactData', 'data', 'defaultModalController', function($scope, $modalInstance, contactData, data, defaultModalController) { |
||||||
|
$scope.contacts = []; |
||||||
|
$scope.search = {}; |
||||||
|
|
||||||
|
var getContacts = function() { |
||||||
|
$scope.contacts = contactData.getAll(); |
||||||
|
}; |
||||||
|
getContacts(); |
||||||
|
contacts.e.on('contactadded', function() { |
||||||
|
getContacts(); |
||||||
|
}); |
||||||
|
|
||||||
|
// Set state based on default controller
|
||||||
|
defaultModalController[3]($scope, $modalInstance, data); |
||||||
|
}]; |
||||||
|
|
||||||
|
var controller = ['$scope', '$modal', function($scope, $modal) { |
||||||
|
var windowClass = 'contactsmanager'; |
||||||
|
var modalController = contactsManagerController; |
||||||
|
|
||||||
|
$scope.contactsManager = function() { |
||||||
|
alertify.dialog.buildCustom({ |
||||||
|
'windowClass': windowClass, |
||||||
|
'header': _('Contacts Manager'), |
||||||
|
'bodydom': templateContactsManager, |
||||||
|
'footerdom': null, |
||||||
|
'controller': modalController |
||||||
|
}); |
||||||
|
}; |
||||||
|
}]; |
||||||
|
|
||||||
|
var link = function($scope, $element) {}; |
||||||
|
|
||||||
|
return { |
||||||
|
scope: true, |
||||||
|
restrict: 'E', |
||||||
|
replace: true, |
||||||
|
template: templateContactsManagerButton, |
||||||
|
controller: controller, |
||||||
|
link: link |
||||||
|
}; |
||||||
|
}]; |
||||||
|
|
||||||
|
}); |
@ -0,0 +1,26 @@ |
|||||||
|
<div class="modal-body"> |
||||||
|
<div class="row head"> |
||||||
|
<div class="col-xs-7" ng-if="contacts.length === 0"> |
||||||
|
<p>{{_('You have no contacts.')}}</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="row" ng-if="contacts.length > 0"> |
||||||
|
<div class="col-xs-12"> |
||||||
|
<div class="editlist nicescroll"> |
||||||
|
<table class="table table-hover table-condensed"> |
||||||
|
<tbody> |
||||||
|
<tr ng-repeat="contact in contacts"> |
||||||
|
<td class="picture"> |
||||||
|
<img ng-show="contact.Status.buddyPicture" ng-src="{{contact.Status.buddyPicture}}"> |
||||||
|
<div ng-show="!contact.Status.buddyPicture" class="buddyPicture"></div> |
||||||
|
</td> |
||||||
|
<td class="name"> |
||||||
|
<span>{{contact.Status.displayName}}</span> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,6 @@ |
|||||||
|
<div class="form-group" ng-if="userid"> |
||||||
|
<label class="col-xs-4 control-label">{{_('Contacts')}}</label> |
||||||
|
<div class="col-xs-8"> |
||||||
|
<button class="btn btn-success" ng-click="contactsManager()">{{_('Manage Contacts')}}</button> |
||||||
|
</div> |
||||||
|
</div> |
Loading…
Reference in new issue