forked from EVOgeek/Vmeda.Online
		
	MOBILE-3608 blocks: Add all prerendered blocks
This commit is contained in:
		
							parent
							
								
									c3372e8076
								
							
						
					
					
						commit
						6035865bc0
					
				| @ -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, | ||||
|     ], | ||||
| }) | ||||
|  | ||||
							
								
								
									
										38
									
								
								src/addons/block/activityresults/activityresults.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/activityresults/activityresults.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
| @ -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; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -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 {} | ||||
| @ -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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/activityresults/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/activityresults/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Activity results" | ||||
| } | ||||
							
								
								
									
										47
									
								
								src/addons/block/activityresults/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/activityresults/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										38
									
								
								src/addons/block/badges/badges.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/badges/badges.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										22
									
								
								src/addons/block/badges/components/badges/badges.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/addons/block/badges/components/badges/badges.scss
									
									
									
									
									
										Normal 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; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								src/addons/block/badges/components/badges/badges.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/addons/block/badges/components/badges/badges.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/badges/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/badges/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/badges/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/badges/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Latest badges" | ||||
| } | ||||
							
								
								
									
										47
									
								
								src/addons/block/badges/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/badges/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										38
									
								
								src/addons/block/blogmenu/blogmenu.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/blogmenu/blogmenu.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										17
									
								
								src/addons/block/blogmenu/components/blogmenu/blogmenu.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/addons/block/blogmenu/components/blogmenu/blogmenu.scss
									
									
									
									
									
										Normal 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; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								src/addons/block/blogmenu/components/blogmenu/blogmenu.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/addons/block/blogmenu/components/blogmenu/blogmenu.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/blogmenu/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/blogmenu/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/blogmenu/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/blogmenu/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Blog menu" | ||||
| } | ||||
							
								
								
									
										47
									
								
								src/addons/block/blogmenu/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/blogmenu/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										38
									
								
								src/addons/block/blogrecent/blogrecent.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/blogrecent/blogrecent.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
| @ -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; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -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 {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/blogrecent/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/blogrecent/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/blogrecent/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/blogrecent/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Recent blog entries" | ||||
| } | ||||
							
								
								
									
										47
									
								
								src/addons/block/blogrecent/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/blogrecent/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										38
									
								
								src/addons/block/blogtags/blogtags.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/blogtags/blogtags.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										99
									
								
								src/addons/block/blogtags/components/blogtags/blogtags.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								src/addons/block/blogtags/components/blogtags/blogtags.scss
									
									
									
									
									
										Normal 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; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								src/addons/block/blogtags/components/blogtags/blogtags.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/addons/block/blogtags/components/blogtags/blogtags.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/blogtags/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/blogtags/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/blogtags/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/blogtags/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Blog tags" | ||||
| } | ||||
							
								
								
									
										47
									
								
								src/addons/block/blogtags/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/blogtags/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										36
									
								
								src/addons/block/glossaryrandom/glossaryrandom.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/addons/block/glossaryrandom/glossaryrandom.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/glossaryrandom/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/glossaryrandom/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Random glossary entry" | ||||
| } | ||||
							
								
								
									
										48
									
								
								src/addons/block/glossaryrandom/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/addons/block/glossaryrandom/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										30
									
								
								src/addons/block/html/html.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/addons/block/html/html.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										49
									
								
								src/addons/block/html/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								src/addons/block/html/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/newsitems/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/newsitems/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
| @ -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; | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								src/addons/block/newsitems/components/newsitems/newsitems.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/addons/block/newsitems/components/newsitems/newsitems.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/newsitems/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/newsitems/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Latest announcements" | ||||
| } | ||||
							
								
								
									
										38
									
								
								src/addons/block/newsitems/newsitems.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/newsitems/newsitems.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										47
									
								
								src/addons/block/newsitems/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/newsitems/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/onlineusers/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/onlineusers/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
| @ -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; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/onlineusers/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/onlineusers/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Online users" | ||||
| } | ||||
							
								
								
									
										38
									
								
								src/addons/block/onlineusers/onlineusers.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/onlineusers/onlineusers.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										46
									
								
								src/addons/block/onlineusers/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								src/addons/block/onlineusers/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
| @ -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 {} | ||||
| @ -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; | ||||
|     } | ||||
| } | ||||
| @ -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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/recentactivity/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/recentactivity/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Recent activity" | ||||
| } | ||||
							
								
								
									
										38
									
								
								src/addons/block/recentactivity/recentactivity.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/recentactivity/recentactivity.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										47
									
								
								src/addons/block/recentactivity/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/recentactivity/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/rssclient/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/rssclient/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
| @ -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; | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								src/addons/block/rssclient/components/rssclient/rssclient.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/addons/block/rssclient/components/rssclient/rssclient.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/rssclient/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/rssclient/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Remote RSS feeds" | ||||
| } | ||||
							
								
								
									
										38
									
								
								src/addons/block/rssclient/rssclient.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/rssclient/rssclient.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										49
									
								
								src/addons/block/rssclient/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								src/addons/block/rssclient/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										45
									
								
								src/addons/block/tags/components/components.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/addons/block/tags/components/components.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										117
									
								
								src/addons/block/tags/components/tags/tags.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								src/addons/block/tags/components/tags/tags.scss
									
									
									
									
									
										Normal 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; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								src/addons/block/tags/components/tags/tags.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/addons/block/tags/components/tags/tags.ts
									
									
									
									
									
										Normal 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 {} | ||||
							
								
								
									
										3
									
								
								src/addons/block/tags/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/tags/lang.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|     "pluginname": "Tags" | ||||
| } | ||||
							
								
								
									
										47
									
								
								src/addons/block/tags/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/addons/block/tags/services/block-handler.ts
									
									
									
									
									
										Normal 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) {} | ||||
							
								
								
									
										38
									
								
								src/addons/block/tags/tags.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/tags/tags.module.ts
									
									
									
									
									
										Normal 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 {} | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user