Skip to content

Commit f62eacb

Browse files
authored
Merge pull request #849 from moodlehq/integration
Integration
2 parents f2a1f61 + 63d1f70 commit f62eacb

File tree

77 files changed

+1233
-515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1233
-515
lines changed

bower.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@
1919
},
2020
"resolutions": {
2121
"angular": "1.5.3"
22+
},
23+
"dependencies": {
24+
"chart.js": "^2.4.0",
25+
"angular-chart.js": "^1.0.2"
2226
}
2327
}

upgrade.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ information provided here is intended especially for developers.
66
* mmaGrades addon has been moved to core with mmGrades name (and derivatives).
77
* The promise returned by $mmaMessages#sendMessage is now resolved with an object instead of a boolean.
88
* mm-format-text directive is now depending on height so new parameter max-height has been added and parameters shorten and expand-on-click have been deprecated.
9+
* Now mmUser#formatRoleList is returning a String instead of a Promise.
910

1011
=== 3.2 ===
1112

www/addons/badges/services/handlers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ angular.module('mm.addons.badges')
2323
* @ngdoc service
2424
* @name $mmaBadgesHandlers
2525
*/
26-
.factory('$mmaBadgesHandlers', function($mmaBadges, $mmUtil, $q, $mmContentLinksHelper) {
26+
.factory('$mmaBadgesHandlers', function($mmaBadges, $mmUtil, $q, $mmContentLinksHelper, mmUserProfileHandlersTypeNewPage) {
2727

2828
var self = {};
2929

@@ -36,7 +36,9 @@ angular.module('mm.addons.badges')
3636
*/
3737
self.userProfile = function() {
3838

39-
var self = {};
39+
var self = {
40+
type: mmUserProfileHandlersTypeNewPage
41+
};
4042

4143
/**
4244
* Check if handler is enabled.

www/addons/competency/services/handlers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ angular.module('mm.addons.competency')
2323
* @ngdoc service
2424
* @name $mmaCompetencyHandlers
2525
*/
26-
.factory('$mmaCompetencyHandlers', function($log, $mmaCompetency, mmCoursesAccessMethods) {
26+
.factory('$mmaCompetencyHandlers', function($log, $mmaCompetency, mmCoursesAccessMethods, mmUserProfileHandlersTypeNewPage) {
2727
$log = $log.getInstance('$mmaCompetencyHandlers');
2828

2929
var self = {},
@@ -201,7 +201,9 @@ angular.module('mm.addons.competency')
201201
*/
202202
self.learningPlan = function() {
203203

204-
var self = {};
204+
var self = {
205+
type: mmUserProfileHandlersTypeNewPage
206+
};
205207

206208
/**
207209
* Check if handler is enabled.

www/addons/coursecompletion/services/handlers.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ angular.module('mm.addons.coursecompletion')
2323
* @ngdoc service
2424
* @name $mmaCourseCompletionHandlers
2525
*/
26-
.factory('$mmaCourseCompletionHandlers', function($mmaCourseCompletion, $state, mmCoursesAccessMethods) {
26+
.factory('$mmaCourseCompletionHandlers', function($mmaCourseCompletion, $state, mmCoursesAccessMethods, mmUserProfileHandlersTypeNewPage) {
2727

2828
// We use "caches" to decrease network usage.
2929
var self = {},
@@ -79,7 +79,9 @@ angular.module('mm.addons.coursecompletion')
7979
*/
8080
self.viewCompletion = function() {
8181

82-
var self = {};
82+
var self = {
83+
type: mmUserProfileHandlersTypeNewPage
84+
};
8385

8486
/**
8587
* Check if handler is enabled.
@@ -135,8 +137,9 @@ angular.module('mm.addons.coursecompletion')
135137
return function($scope) {
136138

137139
// Button title.
138-
$scope.title = 'mma.coursecompletion.viewcoursereport';
140+
$scope.title = 'mma.coursecompletion.coursecompletion';
139141
$scope.class = 'mma-coursecompletion-user-handler';
142+
$scope.icon = 'ion-android-checkbox-outline';
140143

141144
$scope.action = function($event) {
142145
$event.preventDefault();

www/addons/frontpage/directives/frontpageitemnews.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ angular.module('mm.addons.frontpage')
2121
* @ngdoc directive
2222
* @name mmaFrontpageItemNews
2323
*/
24-
.directive('mmaFrontpageItemNews', function($mmCourse, $state, $mmSite, $mmAddonManager) {
24+
.directive('mmaFrontpageItemNews', function($mmCourse, $state, $mmSite, $mmAddonManager, $mmCourseDelegate) {
2525
return {
2626
restrict: 'A',
2727
priority: 100,
@@ -49,10 +49,10 @@ angular.module('mm.addons.frontpage')
4949
if (forum) {
5050
return $mmCourse.getModuleBasicInfo(forum.cmid).then(function(module) {
5151
scope.show = true;
52-
scope.icon = $mmCourse.getModuleIconSrc('forum');
53-
scope.action = function() {
54-
$state.go('site.mod_forum', {module: module, courseid: courseId});
55-
};
52+
scope.module = module;
53+
scope.module._controller =
54+
$mmCourseDelegate.getContentHandlerControllerFor(module.modname, module, courseId,
55+
module.section);
5656
});
5757
}
5858
});

www/addons/frontpage/scss/styles.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,16 @@
88
left: 11px;
99
}
1010
}
11+
12+
.mm-frontpageitemnews {
13+
img {
14+
max-width: 30px;
15+
max-height: 30px;
16+
}
17+
18+
.mm-module-buttons {
19+
width: 30px;
20+
height: 22px;
21+
}
22+
}
1123
}

www/addons/frontpage/templates/frontpage.html

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,21 @@
66
<mm-loading hide-until="frontpageLoaded" loading-padding-top="loadingPaddingTop">
77

88
<section class="card" ng-if="section && sectionHasContent(section)">
9-
<div class="item item-text-wrap" ng-if="section.summary">
9+
<div class="item item-text-wrap clearfix" ng-if="section.summary">
1010
<mm-format-text>{{ section.summary }}</mm-format-text>
1111
</div>
1212

13-
<a class="item item-text-wrap mm-course-module-handler clearfix {{class}}" ng-repeat="module in section.modules" ng-click="action($event)" ng-class="{'item-media': icon}" ng-controller="module._controller" title="{{ module.name }}">
14-
15-
<img ng-src="{{ icon }}" alt="" role="presentation" ng-if="icon">
16-
17-
<div class="buttons mm-module-buttons" ng-if="(buttons && buttons.length > 0) || spinner">
18-
19-
<button ng-repeat="button in buttons" ng-hide="button.hidden" ng-click="button.action($event)" class="button button-icon" aria-label="{{ button.label | translate }}">
20-
<i class="icon positive" ng-class="{'{{button.icon}}': button.icon}"></i>
21-
</button>
22-
23-
<ion-spinner ng-if="spinner"></ion-spinner>
24-
</div>
25-
26-
<mm-format-text watch="true">{{ title }}</mm-format-text>
27-
</a>
13+
<mm-course-module class="item item-complex" ng-repeat="module in section.modules" module="module"></mm-course-module>
2814
</section>
2915

3016
<mma-frontpage-item ng-repeat="item in items" name="{{item}}"></mma-frontpage-item>
3117

3218
<section class="card" ng-if="block && sectionHasContent(block)">
33-
<div class="item item-text-wrap" ng-if="block.summary">
19+
<div class="item item-text-wrap clearfix" ng-if="block.summary">
3420
<mm-format-text>{{ block.summary }}</mm-format-text>
3521
</div>
3622

37-
<a class="item item-text-wrap mm-course-module-handler clearfix {{class}}" ng-repeat="module in block.modules" ng-click="action($event)" ng-class="{'item-media': icon}" ng-controller="module._controller" title="{{ module.name }}">
38-
39-
<img ng-src="{{ icon }}" alt="" role="presentation" ng-if="icon">
40-
41-
<div class="buttons mm-module-buttons" ng-if="(buttons && buttons.length > 0) || spinner">
42-
43-
<button ng-repeat="button in buttons" ng-hide="button.hidden" ng-click="button.action($event)" class="button button-icon" aria-label="{{ button.label | translate }}">
44-
<i class="icon positive" ng-class="{'{{button.icon}}': button.icon}"></i>
45-
</button>
46-
47-
<ion-spinner ng-if="spinner"></ion-spinner>
48-
</div>
49-
50-
<mm-format-text watch="true">{{ title }}</mm-format-text>
51-
</a>
23+
<mm-course-module class="item item-complex" ng-repeat="module in block.modules" module="module"></mm-course-module>
5224
</section>
5325

5426
<p class="padding" ng-if="!hasContent">{{ 'mm.course.nocontentavailable' | translate }}</p>
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<a ng-if="show" ng-click="action($event)" class="item item-text-wrap item-media item-icon-right">
2-
<img ng-src="{{ icon }}" alt="" role="presentation" ng-if="icon">
3-
<h2>{{ 'mma.frontpage.sitenews' | translate}}</h2>
4-
<i class="icon icon-accessory ion-chevron-right"></i>
5-
</a>
1+
<mm-course-module class="mm-frontpageitemnews" ng-if="show" module="module"></mm-course-module>

www/addons/grades/scss/styles.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.mm-site_coursesgrades .item .badge {
2+
right: 16px;
3+
}

0 commit comments

Comments
 (0)