MOBILE-3608 blocks: Add all prerendered blocks

main
Pau Ferrer Ocaña 2020-12-07 17:04:41 +01:00
parent c3372e8076
commit 6035865bc0
66 changed files with 2212 additions and 0 deletions

View File

@ -14,6 +14,17 @@
import { NgModule } from '@angular/core';
import { AddonBlockActivityResultsModule } from './block/activityresults/activityresults.module';
import { AddonBlockBadgesModule } from './block/badges/badges.module';
import { AddonBlockBlogMenuModule } from './block/blogmenu/blogmenu.module';
import { AddonBlockBlogRecentModule } from './block/blogrecent/blogrecent.module';
import { AddonBlockBlogTagsModule } from './block/blogtags/blogtags.module';
import { AddonBlockGlossaryRandomModule } from './block/glossaryrandom/glossaryrandom.module';
import { AddonBlockHtmlModule } from './block/html/html.module';
import { AddonBlockNewsItemsModule } from './block/newsitems/newsitems.module';
import { AddonBlockOnlineUsersModule } from './block/onlineusers/onlineusers.module';
import { AddonBlockRssClientModule } from './block/rssclient/rssclient.module';
import { AddonBlockTagsModule } from './block/tags/tags.module';
import { AddonPrivateFilesModule } from './privatefiles/privatefiles.module';
import { AddonFilterModule } from './filter/filter.module';
import { AddonUserProfileFieldModule } from './userprofilefield/userprofilefield.module';
@ -22,6 +33,17 @@ import { AddonUserProfileFieldModule } from './userprofilefield/userprofilefield
imports: [
AddonPrivateFilesModule,
AddonFilterModule,
AddonBlockActivityResultsModule,
AddonBlockBadgesModule,
AddonBlockBlogMenuModule,
AddonBlockBlogRecentModule,
AddonBlockBlogTagsModule,
AddonBlockGlossaryRandomModule,
AddonBlockHtmlModule,
AddonBlockNewsItemsModule,
AddonBlockOnlineUsersModule,
AddonBlockRssClientModule,
AddonBlockTagsModule,
AddonUserProfileFieldModule,
],
})

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockActivityResultsHandler } from './services/block-handler';
import { AddonBlockActivityResultsComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockActivityResultsComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockActivityResultsHandler.instance);
},
},
],
})
export class AddonBlockActivityResultsModule {}

View File

@ -0,0 +1,29 @@
:host .core-block-content ::ng-deep {
table.grades {
text-align: start;
width: 100%;
.number {
text-align: start;
width: 10%;
}
.name {
text-align: start;
width: 77%;
}
.grade {
text-align: end;
}
caption {
text-align: start;
padding-top: .75rem;
padding-bottom: .75rem;
color: var(--gray-darker);
font-weight: bold;
font-size: 18px;
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a activity results block.
*/
@Component({
selector: 'addon-block-activity-results',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['activityresults.scss'],
})
export class AddonBlockActivityResultsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockActivityResultsComponent } from './activityresults/activityresults';
@NgModule({
declarations: [
AddonBlockActivityResultsComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockActivityResultsComponent,
],
entryComponents: [
AddonBlockActivityResultsComponent,
],
})
export class AddonBlockActivityResultsComponentsModule {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Activity results"
}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockActivityResultsComponent } from '../components/activityresults/activityresults';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockActivityResultsHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockActivityResults';
blockName = 'activity_results';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_activityresults.pluginname',
class: 'addon-block-activity-results',
component: AddonBlockActivityResultsComponent,
};
}
}
export class AddonBlockActivityResultsHandler extends makeSingleton(AddonBlockActivityResultsHandlerService) {}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockBadgesHandler } from './services/block-handler';
import { AddonBlockBadgesComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockBadgesComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockBadgesHandler.instance);
},
},
],
})
export class AddonBlockBadgesModule {}

View File

@ -0,0 +1,22 @@
:host .core-block-content ::ng-deep {
ul.badges {
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li {
position: relative;
display: inline-block;
padding-top: 1em;
text-align: center;
vertical-align: top;
width: 150px;
.badge-name {
display: block;
padding: 5px;
}
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a badges block.
*/
@Component({
selector: 'addon-block-badges',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['badges.scss'],
})
export class AddonBlockBadgesComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockBadgesComponent } from './badges/badges';
@NgModule({
declarations: [
AddonBlockBadgesComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockBadgesComponent,
],
entryComponents: [
AddonBlockBadgesComponent,
],
})
export class AddonBlockBadgesComponentsModule {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Latest badges"
}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockBadgesComponent } from '../components/badges/badges';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockBadgesHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockBadges';
blockName = 'badges';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_badges.pluginname',
class: 'addon-block-badges',
component: AddonBlockBadgesComponent,
};
}
}
export class AddonBlockBadgesHandler extends makeSingleton(AddonBlockBadgesHandlerService) {}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockBlogMenuHandler } from './services/block-handler';
import { AddonBlockBlogMenuComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockBlogMenuComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockBlogMenuHandler.instance);
},
},
],
})
export class AddonBlockBlogMenuModule {}

View File

@ -0,0 +1,17 @@
:host {
.core-block-content ::ng-deep {
ul.list {
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li {
padding-bottom: 8px;
}
}
}
.core-block-footer ::ng-deep {
display: none;
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a blog menu block.
*/
@Component({
selector: 'addon-block-blog-menu',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['blogmenu.scss'],
})
export class AddonBlockBlogMenuComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockBlogMenuComponent } from './blogmenu/blogmenu';
@NgModule({
declarations: [
AddonBlockBlogMenuComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockBlogMenuComponent,
],
entryComponents: [
AddonBlockBlogMenuComponent,
],
})
export class AddonBlockBlogMenuComponentsModule {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Blog menu"
}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockBlogMenuComponent } from '../components/blogmenu/blogmenu';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockBlogMenuHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockBlogMenu';
blockName = 'blog_menu';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_blogmenu.pluginname',
class: 'addon-block-blog-menu',
component: AddonBlockBlogMenuComponent,
};
}
}
export class AddonBlockBlogMenuHandler extends makeSingleton(AddonBlockBlogMenuHandlerService) {}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockBlogRecentHandler } from './services/block-handler';
import { AddonBlockBlogRecentComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockBlogRecentComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockBlogRecentHandler.instance);
},
},
],
})
export class AddonBlockBlogRecentModule {}

View File

@ -0,0 +1,12 @@
:host .core-block-content ::ng-deep {
ul.list {
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li {
padding-bottom: 8px;
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a blog recent block.
*/
@Component({
selector: 'addon-block-blog-recent',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['blogrecent.scss'],
})
export class AddonBlockBlogRecentComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockBlogRecentComponent } from './blogrecent/blogrecent';
@NgModule({
declarations: [
AddonBlockBlogRecentComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockBlogRecentComponent,
],
entryComponents: [
AddonBlockBlogRecentComponent,
],
})
export class AddonBlockBlogRecentComponentsModule {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Recent blog entries"
}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockBlogRecentComponent } from '../components/blogrecent/blogrecent';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockBlogRecentHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockBlogRecent';
blockName = 'blog_recent';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_blogrecent.pluginname',
class: 'addon-block-blog-recent',
component: AddonBlockBlogRecentComponent,
};
}
}
export class AddonBlockBlogRecentHandler extends makeSingleton(AddonBlockBlogRecentHandlerService) {}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockBlogTagsHandler } from './services/block-handler';
import { AddonBlockBlogTagsComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockBlogTagsComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockBlogTagsHandler.instance);
},
},
],
})
export class AddonBlockBlogTagsModule {}

View File

@ -0,0 +1,99 @@
:host .core-block-content ::ng-deep {
ul.inline-list {
font-size: 80%;
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li {
padding: .2em;
display: inline-block;
a {
background: var(--ion-color-primary);
color: var(--ion-color-primary-contrast);
padding: 3px 8px;
-webkit-font-smoothing: antialiased;
display: inline-block;
min-width: 10px;
font-weight: bold;
line-height: 1;
text-align: center;
white-space: nowrap;
contain: content;
vertical-align: baseline;
text-decoration: none;
border-radius: 4px;
}
.s20 {
font-size: 1.5em;
font-weight: bold;
}
.s19 {
font-size: 1.5em;
}
.s18 {
font-size: 1.4em;
font-weight: bold;
}
.s17 {
font-size: 1.4em;
}
.s16 {
font-size: 1.3em;
font-weight: bold;
}
.s15 {
font-size: 1.3em;
}
.s14 {
font-size: 1.2em;
font-weight: bold;
}
.s13 {
font-size: 1.2em;
}
.s12,
.s11 {
font-size: 1.1em;
font-weight: bold;
}
.s10,
.s9 {
font-size: 1.1em;
}
.s8,
.s7 {
font-size: 1em;
font-weight: bold;
}
.s6,
.s5 {
font-size: 1em;
}
.s4,
.s3 {
font-size: 0.9em;
font-weight: bold;
}
.s2,
.s1 {
font-size: 0.9em;
}
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a blo gtags block.
*/
@Component({
selector: 'addon-block-blog-tags',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['blogtags.scss'],
})
export class AddonBlockBlogTagsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockBlogTagsComponent } from './blogtags/blogtags';
@NgModule({
declarations: [
AddonBlockBlogTagsComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockBlogTagsComponent,
],
entryComponents: [
AddonBlockBlogTagsComponent,
],
})
export class AddonBlockBlogTagsComponentsModule {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Blog tags"
}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockBlogTagsComponent } from '../components/blogtags/blogtags';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockBlogTagsHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockBlogTags';
blockName = 'blog_tags';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_blogtags.pluginname',
class: 'addon-block-blog-tags',
component: AddonBlockBlogTagsComponent,
};
}
}
export class AddonBlockBlogTagsHandler extends makeSingleton(AddonBlockBlogTagsHandlerService) {}

View File

@ -0,0 +1,36 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockGlossaryRandomHandler } from './services/block-handler';
@NgModule({
imports: [
IonicModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockGlossaryRandomHandler.instance);
},
},
],
})
export class AddonBlockGlossaryRandomModule {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Random glossary entry"
}

View File

@ -0,0 +1,48 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { CoreCourseBlock } from '@features/course/services/course';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockGlossaryRandomHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockGlossaryRandom';
blockName = 'glossary_random';
/**
* Returns the data needed to render the block.
*
* @param block The block to render.
* @return Data or promise resolved with the data.
*/
getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData {
return {
title: block.contents?.title || 'addon.block_glossaryrandom.pluginname',
class: 'addon-block-glossary-random',
component: CoreBlockPreRenderedComponent,
};
}
}
export class AddonBlockGlossaryRandomHandler extends makeSingleton(AddonBlockGlossaryRandomHandlerService) {}

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockHtmlHandler } from './services/block-handler';
@NgModule({
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockHtmlHandler.instance);
},
},
],
})
export class AddonBlockHtmlModule {}

View File

@ -0,0 +1,49 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { CoreCourseBlock } from '@features/course/services/course';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockHtmlHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockHtml';
blockName = 'html';
/**
* Returns the data needed to render the block.
*
* @param block The block to render.
* @return Data or promise resolved with the data.
*/
getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData {
return {
title: block.contents?.title || '',
class: 'addon-block-html',
component: CoreBlockPreRenderedComponent,
};
}
}
export class AddonBlockHtmlHandler extends makeSingleton(AddonBlockHtmlHandlerService) {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockNewsItemsComponent } from './newsitems/newsitems';
@NgModule({
declarations: [
AddonBlockNewsItemsComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockNewsItemsComponent,
],
entryComponents: [
AddonBlockNewsItemsComponent,
],
})
export class AddonBlockNewsItemsComponentsModule {}

View File

@ -0,0 +1,27 @@
:host {
.core-block-content ::ng-deep {
.unlist {
list-style-type: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li.post {
padding-bottom: 16px;
}
li.post:last-child {
padding-bottom: 0;
}
}
}
// Hide RSS link.
.core-block-footer ::ng-deep {
a {
display: none;
}
a:first-child {
display: inline;
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a news items block.
*/
@Component({
selector: 'addon-block-news-items',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['newsitems.scss'],
})
export class AddonBlockNewsItemsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Latest announcements"
}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockNewsItemsHandler } from './services/block-handler';
import { AddonBlockNewsItemsComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockNewsItemsComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockNewsItemsHandler.instance);
},
},
],
})
export class AddonBlockNewsItemsModule {}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockNewsItemsComponent } from '../components/newsitems/newsitems';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockNewsItemsHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockNewsItems';
blockName = 'news_items';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_newsitems.pluginname',
class: 'addon-block-news-items',
component: AddonBlockNewsItemsComponent,
};
}
}
export class AddonBlockNewsItemsHandler extends makeSingleton(AddonBlockNewsItemsHandlerService) {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockOnlineUsersComponent } from './onlineusers/onlineusers';
@NgModule({
declarations: [
AddonBlockOnlineUsersComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockOnlineUsersComponent,
],
entryComponents: [
AddonBlockOnlineUsersComponent,
],
})
export class AddonBlockOnlineUsersComponentsModule {}

View File

@ -0,0 +1,67 @@
:host .core-block-content ::ng-deep {
max-height: 200px;
overflow-y: auto;
.item-inner,
.input-wrapper {
overflow-y: visible;
align-self: start;
}
.list {
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li.listentry {
clear: both;
list-style-type: none;
.user {
float: left;
position: relative;
padding-bottom: 16px;
.core-adapted-img-container {
display: inline;
margin-left: 0;
margin-right: 8px;
}
.userpicture {
vertical-align: text-bottom;
}
}
.message {
float: right;
margin-top: 3px;
}
.uservisibility { // No support on the app.
display: none;
}
}
}
.info {
text-align: center;
}
}
:host-context([dir=rtl]) .core-block-content ::ng-deep {
.list li.listentry {
.user {
float: right;
.core-adapted-img-container {
margin-left: 8px;
margin-right: 0;
}
}
.message {
float: left;
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a online users block.
*/
@Component({
selector: 'addon-block-online-users',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['onlineusers.scss'],
})
export class AddonBlockOnlineUsersComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Online users"
}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockOnlineUsersHandler } from './services/block-handler';
import { AddonBlockOnlineUsersComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockOnlineUsersComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockOnlineUsersHandler.instance);
},
},
],
})
export class AddonBlockOnlineUsersModule {}

View File

@ -0,0 +1,46 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockOnlineUsersComponent } from '../components/onlineusers/onlineusers';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockOnlineUsersHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockOnlineUsers';
blockName = 'online_users';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_onlineusers.pluginname',
class: 'addon-block-online-users',
component: AddonBlockOnlineUsersComponent,
};
}
}
export class AddonBlockOnlineUsersHandler extends makeSingleton(AddonBlockOnlineUsersHandlerService) {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockRecentActivityComponent } from './recentactivity/recentactivity';
@NgModule({
declarations: [
AddonBlockRecentActivityComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockRecentActivityComponent,
],
entryComponents: [
AddonBlockRecentActivityComponent,
],
})
export class AddonBlockRecentActivityComponentsModule {}

View File

@ -0,0 +1,25 @@
:host .core-block-content ::ng-deep {
.activitydate, .activityhead {
text-align: center;
}
.unlist {
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li {
margin-bottom: 1em;
.head .date {
float: right;
}
}
}
}
:host-context([dir=rtl]) .core-block-content ::ng-deep {
.unlist li .head .date {
float: left;
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a recent activity block.
*/
@Component({
selector: 'addon-block-recent-activity',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['recentactivity.scss'],
})
export class AddonBlockRecentActivityComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Recent activity"
}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockRecentActivityHandler } from './services/block-handler';
import { AddonBlockRecentActivityComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockRecentActivityComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockRecentActivityHandler.instance);
},
},
],
})
export class AddonBlockRecentActivityModule {}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockRecentActivityComponent } from '../components/recentactivity/recentactivity';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockRecentActivityHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockRecentActivity';
blockName = 'recent_activity';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_recentactivity.pluginname',
class: 'addon-block-recent-activity',
component: AddonBlockRecentActivityComponent,
};
}
}
export class AddonBlockRecentActivityHandler extends makeSingleton(AddonBlockRecentActivityHandlerService) {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockRssClientComponent } from './rssclient/rssclient';
@NgModule({
declarations: [
AddonBlockRssClientComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockRssClientComponent,
],
entryComponents: [
AddonBlockRssClientComponent,
],
})
export class AddonBlockRssClientComponentsModule {}

View File

@ -0,0 +1,18 @@
:host .core-block-content ::ng-deep {
.list {
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li {
border-top: 1px solid var(--gray);
padding: 5px;
padding-bottom: 8px;
}
li:first-child {
border-top-width: 0;
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a rss client block.
*/
@Component({
selector: 'addon-block-rss-client',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['rssclient.scss'],
})
export class AddonBlockRssClientComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Remote RSS feeds"
}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockRssClientHandler } from './services/block-handler';
import { AddonBlockRssClientComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockRssClientComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockRssClientHandler.instance);
},
},
],
})
export class AddonBlockRssClientModule {}

View File

@ -0,0 +1,49 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { CoreCourseBlock } from '@features/course/services/course';
import { AddonBlockRssClientComponent } from '../components/rssclient/rssclient';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockRssClientHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockRssClient';
blockName = 'rss_client';
/**
* Returns the data needed to render the block.
*
* @param block The block to render.
* @return Data or promise resolved with the data.
*/
getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData {
return {
title: block.contents?.title || 'addon.block_rssclient.pluginname',
class: 'addon-block-rss-client',
component: AddonBlockRssClientComponent,
};
}
}
export class AddonBlockRssClientHandler extends makeSingleton(AddonBlockRssClientHandlerService) {}

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockTagsComponent } from './tags/tags';
@NgModule({
declarations: [
AddonBlockTagsComponent,
],
imports: [
CommonModule,
IonicModule,
FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
],
exports: [
AddonBlockTagsComponent,
],
entryComponents: [
AddonBlockTagsComponent,
],
})
export class AddonBlockTagsComponentsModule {}

View File

@ -0,0 +1,117 @@
:host .core-block-content ::ng-deep {
.tag_cloud {
font-size: 80%;
text-align: center;
ul.inline-list {
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
li {
padding: .2em;
display: inline-block;
a {
background: var(--ion-color-primary);
color: var(--ion-color-primary-contrast);
padding: 3px 8px;
-webkit-font-smoothing: antialiased;
display: inline-block;
min-width: 10px;
font-weight: bold;
line-height: 1;
text-align: center;
white-space: nowrap;
contain: content;
vertical-align: baseline;
text-decoration: none;
border-radius: 4px;
}
.s20 {
font-size: 2.7em;
}
.s19 {
font-size: 2.6em;
}
.s18 {
font-size: 2.5em;
}
.s17 {
font-size: 2.4em;
}
.s16 {
font-size: 2.3em;
}
.s15 {
font-size: 2.2em;
}
.s14 {
font-size: 2.1em;
}
.s13 {
font-size: 2em;
}
.s12 {
font-size: 1.9em;
}
.s11 {
font-size: 1.8em;
}
.s10 {
font-size: 1.7em;
}
.s9 {
font-size: 1.6em;
}
.s8 {
font-size: 1.5em;
}
.s7 {
font-size: 1.4em;
}
.s6 {
font-size: 1.3em;
}
.s5 {
font-size: 1.2em;
}
.s4 {
font-size: 1.1em;
}
.s3 {
font-size: 1em;
}
.s2 {
font-size: 0.9em;
}
.s1 {
font-size: 0.8em;
}
.s0 {
font-size: 0.7em;
}
}
}
}
}

View File

@ -0,0 +1,26 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block';
/**
* Component to render a tags block.
*/
@Component({
selector: 'addon-block-tags',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html',
styleUrls: ['tags.scss'],
})
export class AddonBlockTagsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Tags"
}

View File

@ -0,0 +1,47 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
import { AddonBlockTagsComponent } from '../components/tags/tags';
import { makeSingleton } from '@singletons';
/**
* Block handler.
*/
@Injectable({ providedIn: 'root' })
export class AddonBlockTagsHandlerService extends CoreBlockBaseHandler {
name = 'AddonBlockTags';
blockName = 'tags';
/**
* Returns the data needed to render the block.
*
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
return {
title: 'addon.block_tags.pluginname',
class: 'addon-block-tags',
component: AddonBlockTagsComponent,
};
}
}
export class AddonBlockTagsHandler extends makeSingleton(AddonBlockTagsHandlerService) {}

View File

@ -0,0 +1,38 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreBlockDelegate } from '@features/block/services/block-delegate';
import { AddonBlockTagsHandler } from './services/block-handler';
import { AddonBlockTagsComponentsModule } from './components/components.module';
@NgModule({
imports: [
IonicModule,
AddonBlockTagsComponentsModule,
TranslateModule.forChild(),
],
providers: [
{
provide: APP_INITIALIZER,
multi: true,
useValue: () => {
CoreBlockDelegate.instance.registerHandler(AddonBlockTagsHandler.instance);
},
},
],
})
export class AddonBlockTagsModule {}