Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
1d5f8f37
Commit
1d5f8f37
authored
Jul 28, 2016
by
Vladimir Baranov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/advanced-messaging' into develop
parents
ce11ec8c
f05f250a
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
190 additions
and
283 deletions
+190
-283
app.css
app/app.css
+7
-1
crud_controller.js
app/components/crud/crud_controller.js
+8
-6
dashboard.html
app/components/dashboard/dashboard.html
+1
-240
messaging.js
app/components/messaging/messaging.js
+39
-13
messaging_service.js
app/components/messaging/messaging_service.js
+115
-4
conversation.html
app/components/messaging/templates/conversation.html
+1
-1
index.html
app/components/messaging/templates/index.html
+3
-3
directives.js
app/shared/directives.js
+12
-11
header-notification.html
app/shared/templates/directives/header-notification.html
+4
-4
No files found.
app/app.css
View file @
1d5f8f37
...
...
@@ -2087,7 +2087,7 @@ table.dataTable thead .sorting:after {
right
:
15px
;
-moz-box-shadow
:
0px
0px
45px
rgba
(
0
,
0
,
0
,
0.4
);
box-shadow
:
0px
0px
45px
rgba
(
0
,
0
,
0
,
0.4
);
z-index
:
1
0
;
z-index
:
210
0
;
border-radius
:
3px
;
}
...
...
@@ -2482,6 +2482,11 @@ table.dataTable thead .sorting:after {
font-family
:
'robotomedium'
;
}
.chat-app
.conversation-section
.message-content-url
{
display
:
block
;
}
.chat-app
.conversation-section
.user-message
.message-content
.attachment-message
{
color
:
#909090
;
}
...
...
@@ -2966,6 +2971,7 @@ table.dataTable thead .sorting:after {
.course-prg-scheduler
.action-selector.readonly
{
right
:
0
;
padding-right
:
0
;
cursor
:
default
;
}
.course-prg-scheduler
.action-selector.readonly
:after
{
...
...
app/components/crud/crud_controller.js
View file @
1d5f8f37
...
...
@@ -551,7 +551,8 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
key
:
data
.
oe_key
,
name
:
data
.
name
,
avatar_url
:
data
.
avatar_url
,
totalHours
:
data
.
toplam_ders_saati
totalHours
:
data
.
toplam_ders_saati
,
readonly
:
data
.
readonly
};
iScope
.
timetable
=
iScope
.
prepareTimetable
(
data
.
uygunluk_durumu
);
};
...
...
@@ -611,18 +612,19 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
iScope
.
currentTable
=
{
key
:
data
.
oe_key
,
name
:
data
.
name
,
avatar_url
:
data
.
avatar_url
avatar_url
:
data
.
avatar_url
,
readonly
:
data
.
readonly
};
iScope
.
timetable
=
iScope
.
prepareTimetable
(
data
.
zaman_plani
);
};
iScope
.
selectTable
=
function
(
lecturer
){
iScope
.
selectTable
=
function
(
table
){
iScope
.
loadingTable
=
true
;
iScope
.
get_wf
({
cmd
:
'
personel_sec
'
,
secili_
og_elemani
:
{
key
:
lecturer
.
key
}
cmd
:
'
derslik_degistir
'
,
secili_
derslik
:
{
key
:
table
.
key
}
}).
then
(
function
(
response
){
init
Lecturer
(
response
);
init
Table
(
response
);
}).
finally
(
function
(){
iScope
.
loadingTable
=
false
;
})
...
...
app/components/dashboard/dashboard.html
View file @
1d5f8f37
<div
ng-app=
"ulakbus.dashboard"
class=
"dashboard academician-dashboard"
>
<div
class=
"starter-template"
>
<div
class=
"row"
>
<div
class=
"col-md-12 course-prg-scheduler"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<div
class=
"panel-title"
>
Course Scheduler Widget
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"col-xs-3"
>
<!-- required for floating -->
<!-- Nav tabs -->
<ul
class=
"nav nav-tabs tabs-left"
>
<li
class=
"active"
><a
data-target=
"#one"
data-toggle=
"tab"
>
Eğitim Görevlisi 1
</a></li>
<li><a
data-target=
"#two"
data-toggle=
"tab"
>
Eğitim Görevlisi 2
</a></li>
<li><a
data-target=
"#three"
data-toggle=
"tab"
>
Eğitim Görevlisi 3
</a></li>
<li><a
data-target=
"#four"
data-toggle=
"tab"
>
Eğitim Görevlisi 4
</a></li>
<li><a
data-target=
"#five"
data-toggle=
"tab"
>
Eğitim Görevlisi 5
</a></li>
<li><a
data-target=
"#six"
data-toggle=
"tab"
>
Eğitim Görevlisi 6
</a></li>
<li><a
data-target=
"#seven"
data-toggle=
"tab"
>
Eğitim Görevlisi 7
</a></li>
</ul>
</div>
<div
class=
"col-xs-9"
>
<!-- Tab panes -->
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"one"
>
<div
class=
"info-header clearfix"
>
<div
class=
"info-wrapper"
>
<img
src=
"../../img/gokhan.jpg"
class=
"profile-pic"
>
<span
class=
"user-name"
>
Öğretim Görevlisi 1
</span>
</div>
<div
class=
"info-wrapper"
>
<div
style=
"margin-top:14px;"
>
<span>
Ders Yükü:
</span>
<span>
20 saat
</span>
</div>
</div>
<div
class=
"info-wrapper pull-right"
style=
"margin-right:0;"
>
<button
class=
"btn btn-success"
>
Kaydet
</button>
</div>
</div>
<!-- end of header -->
<div
class=
"table-warning"
>
<span
class=
"glyphicon glyphicon-exclamation-sign"
></span>
Tabloda en az 30 saat uygun olarak işaretlemelisiniz.
</div>
<table
border=
"1"
>
<tbody>
<tr
class=
"headers"
>
<td></td>
<td>
PZT
</td>
<td>
SAL
</td>
<td>
ÇAR
</td>
<td>
PER
</td>
<td>
CUM
</td>
<td>
CMT
</td>
<td>
PAZ
</td>
</tr>
<tr>
<td>
08:00 - 12:00
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
</tr>
<tr>
<td>
12:00 - 15:00
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
</tr>
<tr>
<td>
15:00 - 17:00
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
<td>
<select
id=
"basic"
class=
"form-control"
>
<option>
Uygun
</option>
<option>
Belirsiz
</option>
<option>
Meşgul
</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end of one -->
<div
class=
"tab-pane"
id=
"two"
>
Tab Two
</div>
<div
class=
"tab-pane"
id=
"three"
>
Tab Three
</div>
<div
class=
"tab-pane"
id=
"four"
>
Tab Four
</div>
<div
class=
"tab-pane"
id=
"five"
>
Tab Five
</div>
<div
class=
"tab-pane"
id=
"six"
>
Tab Six
</div>
<div
class=
"tab-pane"
id=
"seven"
>
Tab Seven
</div>
</div>
</div>
</div>
<!-- end of panel-body -->
</div>
<!-- end of panel -->
</div>
<!-- end of course-prg-scheduler -->
</div>
<!-- end of row -->
<academic-calendar></academic-calendar>
<ng-include
src=
"'components/dashboard/user-templates/student.html'"
ng-if=
"$root.current_user.is_student"
></ng-include>
<ng-include
src=
"'components/dashboard/user-templates/staff.html'"
ng-if=
"!$root.current_user.is_student"
></ng-include>
...
...
app/components/messaging/messaging.js
View file @
1d5f8f37
angular
.
module
(
"ulakbus.messaging"
)
.
directive
(
'messaging'
,
function
(
Generator
,
MessagingService
,
$log
,
$rootScope
,
MessagingPopup
,
Utils
)
{
.
directive
(
'messaging'
,
function
(
Generator
,
MessagingService
,
$log
,
$rootScope
,
MessagingPopup
,
Utils
,
$q
)
{
// get channel key
function
getKey
(
channel
)
{
...
...
@@ -32,11 +32,24 @@ angular.module("ulakbus.messaging")
link
:
function
(
iScope
,
iElem
,
iAttrs
){
iScope
.
chatAppIsHidden
=
true
;
// reset state when user log in/log out
$rootScope
.
$watch
(
'loggedInUser'
,
function
(
v
){
iScope
.
loggedIn
=
v
;
reset
();
});
// shared object to populate models through scopes
iScope
.
shared
=
{};
var
popupRootElement
=
$
(
iElem
).
find
(
'.popup-placeholder'
);
function
reset
(){
iScope
.
selectedChannel
=
null
;
iScope
.
publicChannels
=
[];
iScope
.
notificationsChannel
=
[];
iScope
.
directChannels
=
[];
}
function
editChannelPopup
(
channel
){
return
MessagingPopup
.
show
({
templateUrl
:
"components/messaging/templates/create_channel.html"
,
...
...
@@ -66,8 +79,9 @@ angular.module("ulakbus.messaging")
if
(
channel
.
messages
){
channel
.
messages
.
push
(
message
);
}
}
}
;
updateLastMessage
(
message
);
reportLastSeenMessage
();
}
function
updateAndSelect
(
channelKey
){
...
...
@@ -103,10 +117,12 @@ angular.module("ulakbus.messaging")
};
iScope
.
updateChannelsList
=
function
(){
return
MessagingService
.
list_channels
().
then
(
function
(
groupedChannels
)
{
return
MessagingService
.
list_channels
().
then
(
function
(
channels
)
{
var
groupedChannels
=
channels
.
grouped
;
iScope
.
publicChannels
=
groupedChannels
[
MessagingService
.
CHANNEL_TYPE
.
PUBLIC
];
iScope
.
notificationsChannel
=
groupedChannels
[
MessagingService
.
CHANNEL_TYPE
.
NOTIFICATION
][
0
];
iScope
.
directChannels
=
groupedChannels
[
MessagingService
.
CHANNEL_TYPE
.
DIRECT
];
});
}
...
...
@@ -123,11 +139,13 @@ angular.module("ulakbus.messaging")
iScope
.
hideApp
=
function
(){
iScope
.
chatAppIsHidden
=
true
;
MessagingService
.
toggle_messaging_window_visibility
(
false
);
};
iScope
.
showApp
=
function
(){
iScope
.
chatAppIsHidden
=
false
;
iScope
.
updateChannelsList
();
MessagingService
.
toggle_messaging_window_visibility
(
true
);
return
iScope
.
updateChannelsList
();
}
iScope
.
searchUser
=
function
(){
...
...
@@ -221,9 +239,8 @@ angular.module("ulakbus.messaging")
function
selectChannel
(
channelKey
,
silent
){
if
(
!
silent
)
iScope
.
loadingChannel
=
true
;
return
MessagingService
.
show_channel
(
channelKey
).
then
(
function
(
result
){
return
result
;
}).
finally
(
function
(){
return
MessagingService
.
show_channel
(
channelKey
)
.
finally
(
function
(){
iScope
.
loadingChannel
=
false
;
})
}
...
...
@@ -308,12 +325,21 @@ angular.module("ulakbus.messaging")
$rootScope
.
$on
(
"user_ready"
,
function
(){
// init service after user logged in
iScope
.
selectedChannel
=
null
;
iScope
.
publicChannels
=
[];
iScope
.
notificationsChannel
=
[];
iScope
.
directChannels
=
[]
reset
();
iScope
.
hideApp
();
});
$rootScope
.
$on
(
MessagingService
.
SHOW_MESSAGING_WINDOW_EVENT
,
function
(
e
,
channelKey
){
var
showApp
=
$q
.
when
();
if
(
iScope
.
chatAppIsHidden
){
showApp
=
iScope
.
showApp
();
}
if
(
channelKey
&&
channelKey
!=
getKey
(
iScope
.
selectedChannel
)){
showApp
.
then
(
function
(){
iScope
.
selectChannel
(
channelKey
);
})
}
})
}
};
})
...
...
app/components/messaging/messaging_service.js
View file @
1d5f8f37
...
...
@@ -18,6 +18,9 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
.
factory
(
'MessagingService'
,
function
(
$q
,
$timeout
,
$compile
,
$log
,
$rootScope
,
Moment
,
WSOps
,
Utils
)
{
var
msg
=
{};
var
notificationsChannelKey
;
var
channelsMap
=
{};
// channels loader promise
var
channelsLoader
;
msg
.
CHANNEL_TYPE
=
{
"PUBLIC"
:
15
,
...
...
@@ -25,6 +28,16 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
"NOTIFICATION"
:
5
};
msg
.
SHOW_MESSAGING_WINDOW_EVENT
=
"show_messaging_window"
;
var
unread
=
{
messages
:
{
count
:
0
},
notifications
:
{
count
:
0
}
};
var
currentChannelKey
;
// track messaging app state for proper unread messages count
var
messagingAppIsHidden
=
true
;
function
wsReady
()
{
/**
* wait until websocket will be open
...
...
@@ -52,6 +65,44 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
}
}
function
increaseUnread
(
message
,
messageType
){
// skip current channel messages. Don't update counters
if
(
!
messagingAppIsHidden
&&
message
.
channel_key
==
currentChannelKey
){
return
;
}
checkIfInitialized
().
then
(
function
(){
var
channel
=
channelsMap
[
message
.
channel_key
];
if
(
channel
){
channel
.
unread
+=
1
;
}
unread
[
messageType
].
count
+=
1
;
})
}
function
decreaseUnread
(
channel
){
// get channel from channelsMap. Channels in channelMap has unread property
// which is updated when messages arrive
channel
=
channelsMap
[
channel
.
key
];
if
(
channel
&&
channel
.
unread
){
var
counter
;
if
(
channel
.
type
==
msg
.
CHANNEL_TYPE
.
NOTIFICATION
){
counter
=
unread
.
notifications
}
else
{
counter
=
unread
.
messages
;
}
counter
.
count
-=
channel
.
unread
;
if
(
counter
.
count
<
0
)
counter
.
count
=
0
;
channel
.
unread
=
0
;
}
}
function
checkIfInitialized
(){
if
(
!
channelsLoader
){
return
msg
.
list_channels
()
}
return
channelsLoader
;
}
// prepare message to show in UI
msg
.
prepareMessage
=
function
(
message
){
if
(
!
message
.
timestamp
){
...
...
@@ -64,9 +115,35 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
};
msg
.
get_notifications_channel_key
=
function
(){
return
checkIfInitialized
().
then
(
function
(){
return
notificationsChannelKey
;
});
};
msg
.
get_unread_counters
=
function
(){
return
unread
;
};
msg
.
reset_state
=
function
(){
currentChannelKey
=
null
;
notificationsChannelKey
=
null
;
channelsMap
=
{};
unread
.
messages
.
count
=
0
;
unread
.
notifications
.
count
=
0
;
channelsLoader
=
false
;
}
msg
.
toggle_messaging_window_visibility
=
function
(
visibility
,
resetState
){
messagingAppIsHidden
=
!
visibility
;
if
(
resetState
){
msg
.
reset_state
();
}
};
msg
.
show_messaging_window
=
function
(
channelKey
){
$rootScope
.
$broadcast
(
msg
.
SHOW_MESSAGING_WINDOW_EVENT
,
channelKey
);
}
/**
* API
*
...
...
@@ -100,13 +177,21 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
var
outgoing
=
{
view
:
'_zops_list_channels'
};
return
wsRequest
(
outgoing
).
then
(
function
(
data
)
{
console
.
error
(
"channels: "
,
data
.
channels
);
channelsLoader
=
wsRequest
(
outgoing
).
then
(
function
(
data
)
{
var
grouped
=
Utils
.
groupBy
(
data
.
channels
||
[],
"type"
);
// add all channels to channels map
for
(
var
i
=
0
;
i
<
data
.
channels
.
length
;
i
++
){
var
channel
=
data
.
channels
[
i
];
channelsMap
[
channel
.
key
]
=
channel
;
}
// save notifications channel key
notificationsChannelKey
=
grouped
[
msg
.
CHANNEL_TYPE
.
NOTIFICATION
][
0
].
key
;
return
grouped
;
return
{
grouped
:
grouped
,
channelsMap
:
channelsMap
};
});
return
channelsLoader
;
};
msg
.
search_user
=
function
(
query
)
{
...
...
@@ -226,6 +311,10 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
};
return
wsRequest
(
outgoing
).
then
(
function
(
result
){
$log
.
info
(
"Show channel "
,
channelKey
,
": "
,
result
);
// decrease unread messages for current channel
decreaseUnread
(
result
);
// save current channel key
currentChannelKey
=
result
.
key
;
prepareMessages
(
result
.
last_messages
);
return
result
;
})
...
...
@@ -249,6 +338,9 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
};
return
wsRequest
(
outgoing
).
then
(
function
(
result
){
$log
.
info
(
"Get unread messages count: "
,
result
);
// update internal unread messages counters
unread
.
messages
.
count
=
result
.
messages
;
unread
.
notifications
.
count
=
result
.
notifications
;
return
result
;
})
};
...
...
@@ -379,6 +471,25 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
});
};
/**
* Event listeners
*/
$rootScope
.
$on
(
"message"
,
function
(
e
,
message
){
increaseUnread
(
message
,
'messages'
);
});
$rootScope
.
$on
(
"notifications"
,
function
(
e
,
message
){
increaseUnread
(
message
,
'notifications'
);
});
// reset state on logout
$rootScope
.
$watch
(
"loggedInUser"
,
function
(
value
){
if
(
!
value
){
msg
.
reset_state
();
};
});
return
msg
;
})
...
...
app/components/messaging/templates/conversation.html
View file @
1d5f8f37
...
...
@@ -40,7 +40,6 @@
<div
class=
"conversation-block clearfix"
ng-repeat=
"msg in selectedChannel.messages"
>
<div
class=
"conversation-actions"
>
<div
class=
"action"
><span
class=
"glyphicon glyphicon-star-empty"
></span></div>
<div
class=
"action dropdown-toggle"
data-toggle=
"dropdown"
ng-click=
"getMessageActions(msg)"
>
<span
class=
"glyphicon glyphicon-option-horizontal"
></span>
</div>
...
...
@@ -59,6 +58,7 @@
</div>
<div
class=
"message-content"
>
{{::msg.content}}
<a
class=
"message-content-url"
href=
"{{::msg.url}}"
ng-if=
"msg.url"
>
{{msg.url}}
</a>
</div>
</div>
</div>
...
...
app/components/messaging/templates/index.html
View file @
1d5f8f37
<div>
<div
ng-show=
"loggedIn"
>
<a
class=
"chat-app-button"
ng-show=
"chatAppIsHidden"
ng-click=
"showApp()"
><i
class=
"glyphicon glyphicon-comment"
></i></a>
<div
class=
"chat-app"
ng-hide=
"chatAppIsHidden"
>
...
...
@@ -11,12 +11,12 @@
<ul
class=
"channels"
>
<li
class=
"title"
>
KANALLAR
<span
class=
"add-action glyphicon glyphicon-plus-sign"
ng-click=
"createChannel()"
></span></li>
<li
ng-class=
"{'
notification
': ch.unread, 'active': isChannelSelected(ch)}"
title=
"{{ch.description}}"
ng-repeat=
"ch in publicChannels"
ng-click=
"selectChannel(ch)"
>
{{ch.name}}
</li>
<li
ng-class=
"{'
unread
': ch.unread, 'active': isChannelSelected(ch)}"
title=
"{{ch.description}}"
ng-repeat=
"ch in publicChannels"
ng-click=
"selectChannel(ch)"
>
{{ch.name}}
</li>
</ul>
<ul
class=
"direct-messages"
>
<li
class=
"title"
>
MESAJLAR
<span
class=
"add-action glyphicon glyphicon-plus-sign"
ng-click=
"searchUser()"
></span></li>
<li
ng-class=
"{'
notification
': userChannel.unread, 'active': isChannelSelected(userChannel), 'online': userChannel.is_online}"
ng-repeat=
"userChannel in directChannels"
ng-click=
"selectChannel(userChannel)"
>
{{userChannel.name}}
</li>
<li
ng-class=
"{'
unread
': userChannel.unread, 'active': isChannelSelected(userChannel), 'online': userChannel.is_online}"
ng-repeat=
"userChannel in directChannels"
ng-click=
"selectChannel(userChannel)"
>
{{userChannel.name}}
</li>
</ul>
</div>
...
...
app/shared/directives.js
View file @
1d5f8f37
...
...
@@ -42,18 +42,19 @@ angular.module('ulakbus')
replace
:
true
,
scope
:
{},
controller
:
function
(
$scope
,
$log
)
{
$scope
.
count
=
{
messages
:
0
,
notifications
:
0
};
function
initCounters
(
){
MessagingService
.
get_unread_messages_count
()
.
then
(
function
(
result
){
$scope
.
count
.
messages
=
result
.
messages
;
$scope
.
count
.
notifiations
=
result
.
notifications
;
$scope
.
count
=
MessagingService
.
get_unread_counters
();
// initialize counters
MessagingService
.
get_unread_messages_count
();
$scope
.
showMessagesWindow
=
function
(
type
){
if
(
type
==
'notifications'
){
return
MessagingService
.
get_notifications_channel_key
()
.
then
(
function
(
channelKey
){
return
MessagingService
.
show_messaging_window
(
channelKey
)
;
})
}
initCounters
();
MessagingService
.
show_messaging_window
();
}
}
};
})
...
...
app/shared/templates/directives/header-notification.html
View file @
1d5f8f37
...
...
@@ -31,8 +31,8 @@
<!– /.dropdown-messages –>
</li>-->
<li
uib-dropdown
auto-close=
"outsideClick"
>
<a
uib-dropdown-toggle
>
<div
class=
"badge"
ng-show=
"count.messages
> 0"
>
{{count.messages
}}
</div>
<a
uib-dropdown-toggle
ng-click=
"showMessagesWindow('messages')"
>
<div
class=
"badge"
ng-show=
"count.messages
.count > 0"
>
{{count.messages.count
}}
</div>
<i
class=
"fa fa-envelope fa-fw"
tooltip-placement=
"bottom"
uib-tooltip=
"Mesajlar"
></i>
<!--<i class="fa fa-caret-down"></i>-->
</a>
...
...
@@ -99,8 +99,8 @@
</li>
<!-- /.dropdown -->
<li
uib-dropdown
auto-close=
"outsideClick"
>
<a
uib-dropdown-toggle
>
<div
class=
"badge"
ng-if=
"count.notifications > 0"
>
{{count.notifications
}}
</div>
<a
uib-dropdown-toggle
ng-click=
"showMessagesWindow('notifications')"
>
<div
class=
"badge"
ng-if=
"count.notifications.count > 0"
>
{{count.notifications.count
}}
</div>
<i
class=
"fa fa-bell fa-fw"
tooltip-placement=
"bottom"
uib-tooltip=
"Duyurular"
></i>
<!--<i class="fa fa-caret-down"></i>-->
</a>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment