Skip to content

Commit e892c97

Browse files
authored
Merge pull request #1048 from dpalou/MOBILE-2103
Mobile 2103
2 parents 42c6cfa + 438802b commit e892c97

File tree

14 files changed

+44
-35
lines changed

14 files changed

+44
-35
lines changed

www/addons/files/lang/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"emptyfilelist": "There are no files to show.",
66
"erroruploadnotworking": "Unfortunately it is currently not possible to upload files to your site.",
77
"files": "My files",
8-
"privatefiles": "My private files",
8+
"privatefiles": "Private files",
99
"myprivatefilesdesc": "The files that are available in your private area on this Moodle site.",
1010
"sitefiles": "Site files",
1111
"sitefilesdesc": "The other files that are available to you on this Moodle site.",

www/addons/messages/lang/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"message": "Message",
1919
"messages": "Messages",
2020
"mustbeonlinetosendmessages": "You must be online to send messages",
21-
"newmessage": "New message...",
21+
"newmessage": "New message",
2222
"newmessages": "New messages",
23-
"nomessages": "No messages.",
23+
"nomessages": "No messages",
2424
"nousersfound": "No users found",
2525
"removecontact": "Remove contact",
2626
"removecontactconfirm": "Contact will be removed from your contacts list.",

www/addons/mod/assign/lang/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"gradeoutof": "Grade out of {{$a}}",
4141
"gradingstatus": "Grading status",
4242
"groupsubmissionsettings": "Group submission settings",
43-
"hiddenuser": "Participant ",
43+
"hiddenuser": "Participant",
4444
"latesubmissions": "Late submissions",
4545
"latesubmissionsaccepted": "Allowed until {{$a}}",
4646
"markingworkflowstate": "Marking workflow state",

www/addons/mod/chat/controllers/chat.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ angular.module('mm.addons.mod_chat')
6464
$mmaModChat.getChatUsers($scope.chatsid).then(function(data) {
6565
$scope.chatUsers = data.users;
6666
}).catch(function(error) {
67-
showError(error, 'mma.mod_chat.errorwhilegettingchatusers');
67+
$mmUtil.showErrorModalDefault(error, 'mma.mod_chat.errorwhilegettingchatusers', true);
6868
}).finally(function() {
6969
$scope.usersLoaded = true;
7070
});
@@ -104,16 +104,6 @@ angular.module('mm.addons.mod_chat')
104104
});
105105
}
106106

107-
// Show error modal.
108-
function showError(error, defaultMessage) {
109-
if (typeof error === 'string') {
110-
$mmUtil.showErrorModal(error);
111-
} else {
112-
$mmUtil.showErrorModal(defaultMessage, true);
113-
}
114-
return $q.reject();
115-
}
116-
117107
// Start the polling to get chat messages periodically.
118108
function startPolling() {
119109
// We already have the polling in place.
@@ -145,7 +135,8 @@ angular.module('mm.addons.mod_chat')
145135
$interval.cancel($scope.polling);
146136
$scope.polling = undefined;
147137
}
148-
return showError(error, 'mma.mod_chat.errorwhileretrievingmessages');
138+
$mmUtil.showErrorModalDefault(error, 'mma.mod_chat.errorwhileretrievingmessages', true);
139+
return $q.reject();
149140
});
150141
}).finally(function() {
151142
pollingRunning = false;
@@ -175,17 +166,20 @@ angular.module('mm.addons.mod_chat')
175166
}
176167
text = $mmText.replaceNewLines(text, '<br>');
177168

169+
var modal = $mmUtil.showModalLoading('mm.core.sending', true);
178170
$mmaModChat.sendMessage($scope.chatsid, text, beep).then(function() {
179171
if (beep === '') {
180172
$scope.newMessage.text = '';
181173
}
182174
getMessagesInterval(); // Update messages to show the sent message.
183-
}, function(error) {
175+
}).catch(function(error) {
184176
// Only close the keyboard if an error happens, we want the user to be able to send multiple
185177
// messages withoutthe keyboard being closed.
186178
$mmApp.closeKeyboard();
187179

188-
showError(error, 'mma.mod_chat.errorwhilesendingmessage');
180+
$mmUtil.showErrorModalDefault(error, 'mma.mod_chat.errorwhilesendingmessage', true);
181+
}).finally(function() {
182+
modal.dismiss();
189183
});
190184
};
191185

@@ -206,10 +200,12 @@ angular.module('mm.addons.mod_chat')
206200
return getMessages().then(function() {
207201
startPolling();
208202
}).catch(function(error) {
209-
return showError(error, 'mma.mod_chat.errorwhileretrievingmessages');
203+
$mmUtil.showErrorModalDefault(error, 'mma.mod_chat.errorwhileretrievingmessages', true);
204+
$ionicHistory.goBack();
205+
return $q.reject();
210206
});
211207
}, function(error) {
212-
showError(error, 'mma.mod_chat.errorwhileconnecting');
208+
$mmUtil.showErrorModalDefault(error, 'mma.mod_chat.errorwhileconnecting', true);
213209
$ionicHistory.goBack();
214210
}).finally(function() {
215211
$scope.loaded = true;

www/addons/mod/chat/controllers/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ angular.module('mm.addons.mod_chat')
4242
$scope.title = chat.name || $scope.title;
4343
$scope.description = chat.intro || $scope.description;
4444
$scope.chatId = chat.id;
45-
$scope.chatScheduled = '';
4645

4746
var now = $mmUtil.timestamp();
4847
var span = chat.chattime - now;
4948

5049
if (chat.chattime && chat.schedule > 0 && span > 0) {
51-
$scope.chatScheduled = $mmUtil.formatTimeInstant(span);
50+
$scope.chatInfo = {
51+
date: moment(chat.chattime * 1000).format('LLL'),
52+
fromnow: $mmUtil.formatTimeInstant(span)
53+
};
54+
} else {
55+
$scope.chatInfo = false;
5256
}
5357

5458
}, function(error) {

www/addons/mod/chat/lang/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"mustbeonlinetosendmessages": "You must be online to send messages",
1515
"nomessages": "No messages yet",
1616
"send": "Send",
17-
"sessionstart": "The next chat session will start in {{$a}}",
17+
"sessionstart": "The next chat session will start on {{$a.date}}, ({{$a.fromnow}} from now)",
1818
"talk": "Talk"
1919
}

www/addons/mod/chat/scss/styles.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,13 @@ $mma-chat-notice-badge: "stable" !default;
4343
border: 0;
4444
}
4545
}
46+
47+
.button-bar {
48+
padding: 0;
49+
border: 0;
50+
51+
.button {
52+
border: 0;
53+
}
54+
}
4655
}

www/addons/mod/chat/templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<mm-loading hide-until="chatLoaded">
1414
<mm-course-mod-description watch="true" description="description" component="{{component}}" component-id="{{componentId}}"></mm-course-mod-description>
1515

16-
<div class="mm-info-card-icon" ng-if="chatScheduled != ''">
17-
<i class="icon ion-clock padding"></i> {{ 'mma.mod_chat.sessionstart' | translate:{$a: chatScheduled} }}
16+
<div class="mm-info-card-icon" ng-if="chatInfo">
17+
<i class="icon ion-clock padding"></i> {{ 'mma.mod_chat.sessionstart' | translate:{$a: chatInfo} }}
1818
</div>
1919

2020
<a class="button button-block button-positive" ui-sref="site.mod_chat-chat({chatid: chatId, title: title, courseid: courseid})">{{ 'mma.mod_chat.enterchat' | translate }}</a>

www/addons/mod/chat/templates/users.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ <h1 class="title">{{ 'mma.mod_chat.currentusers' | translate }}</h1>
1010
<div class="item item-avatar">
1111
<img ng-src="{{user.profileimageurl}}" alt="{{ 'mm.core.pictureof' | translate:{$a: user.fullname} }}" mm-external-content>
1212
<mm-format-text>{{user.fullname}}</mm-format-text>
13-
<div class="item tabs tabs-secondary tabs-icon-left" ng-if="currentUserId != user.id && !isAppOffline()">
14-
<a class="tab-item" ng-click="talkTo(user.fullname)">
13+
<div class="item button-bar" ng-if="currentUserId != user.id && !isAppOffline()">
14+
<a class="button button-icon-left" ng-click="talkTo(user.fullname)">
1515
<i class="icon ion-chatbox"></i>
1616
{{ 'mma.mod_chat.talk' | translate}}
1717
</a>
18-
<a class="tab-item" ng-click="beepTo(user.id)">
18+
<a class="button button-icon-left" ng-click="beepTo(user.id)">
1919
<i class="icon ion-ios-bell"></i>
2020
{{ 'mma.mod_chat.beep' | translate}}
2121
</a>

www/addons/mod/choice/lang/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"full": "(Full)",
77
"noresultsviewable": "The results are not currently viewable.",
88
"notopenyet": "Sorry, this activity is not available until {{$a}}",
9-
"numberofuser": "Number of participants",
10-
"numberofuserinpercentage": "Percentage of participants",
9+
"numberofuser": "Number of responses",
10+
"numberofuserinpercentage": "Percentage of responses",
1111
"previewonly": "This is just a preview of the available options for this activity. You will not be able to submit your choice until {{$a}}.",
1212
"removemychoice": "Remove my choice",
1313
"responses": "Responses",

0 commit comments

Comments
 (0)