Commit 4fe8f4477a7deb7bd74bd26f5fef0150dc3e996d
1 parent
a61cb0f5
Exists in
master
and in
8 other branches
[WIP] Ticket #76: Recent activities block
Showing
6 changed files
with
54 additions
and
2 deletions
Show diff stats
src/app/layout/blocks/recent-activities-plugin-activities/index.ts
0 → 100644
src/app/layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.component.spec.ts
0 → 100644
... | ... | @@ -0,0 +1 @@ |
1 | +// TODO | ... | ... |
src/app/layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.component.ts
0 → 100644
... | ... | @@ -0,0 +1,32 @@ |
1 | +import {Component, Inject, Input} from "ng-forward"; | |
2 | +import {BlockService} from "../../../../lib/ng-noosfero-api/http/block.service"; | |
3 | +import {Arrays} from "./../../../../lib/util/arrays"; | |
4 | + | |
5 | +@Component({ | |
6 | + selector: "noosfero-recent-activities-plugin-activities-block", | |
7 | + templateUrl: 'app/layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.html' | |
8 | +}) | |
9 | +@Inject(BlockService, "$state") | |
10 | +export class RecentActivitiesPluginActivitiesBlockComponent { | |
11 | + | |
12 | + @Input() block: any; | |
13 | + @Input() owner: any; | |
14 | + | |
15 | + profile: any; | |
16 | + activities: any; | |
17 | + | |
18 | + constructor(private blockService: BlockService, private $state: any) { } | |
19 | + | |
20 | + ngOnInit() { | |
21 | + this.profile = this.owner; | |
22 | + this.activities = []; | |
23 | + this.blockService.getApiContent(this.block).then((content: any) => { | |
24 | + let activities: any = []; | |
25 | + for (let i = 0; i < content.activities.length; i++) { | |
26 | + let activity = content.activities[i]; | |
27 | + activities.push({ created_at: activity.created_at, description: 'TODO' }); | |
28 | + } | |
29 | + this.activities = activities.slice(); | |
30 | + }); | |
31 | + } | |
32 | +} | ... | ... |
src/app/layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.html
0 → 100644
... | ... | @@ -0,0 +1,13 @@ |
1 | +<div deckgrid source="ctrl.activities" class="deckgrid"> | |
2 | + <div class="a-card panel media"> | |
3 | + <div class="header media-body"> | |
4 | + <h5 class="title media-heading" ng-bind="card.description"></h5> | |
5 | + | |
6 | + <div class="subheader"> | |
7 | + <span class="time"> | |
8 | + <i class="fa fa-clock-o"></i> <span am-time-ago="card.created_at | dateFormat"></span> | |
9 | + </span> | |
10 | + </div> | |
11 | + </div> | |
12 | + </div> | |
13 | +</div> | ... | ... |
src/app/layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.scss
0 → 100644
src/app/main/main.component.ts
... | ... | @@ -20,6 +20,7 @@ import {StatisticsBlockComponent} from "../layout/blocks/statistics/statistics-b |
20 | 20 | import {PersonTagsPluginInterestsBlockComponent} from "../layout/blocks/person-tags-plugin-interests/person-tags-plugin-interests-block.component"; |
21 | 21 | import {TagsBlockComponent} from "../layout/blocks/tags/tags-block.component"; |
22 | 22 | import {CustomContentComponent} from "../profile/custom-content/custom-content.component"; |
23 | +import {RecentActivitiesPluginActivitiesBlockComponent} from "../layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.component"; | |
23 | 24 | |
24 | 25 | import {MembersBlockComponent} from "../layout/blocks/members/members-block.component"; |
25 | 26 | import {CommunitiesBlockComponent} from "../layout/blocks/communities/communities-block.component"; |
... | ... | @@ -87,7 +88,7 @@ export class EnvironmentContent { |
87 | 88 | * @name main.Main |
88 | 89 | * @requires AuthService, Session, Notification, ArticleBlog, ArticleView, Boxes, Block, LinkListBlock, |
89 | 90 | * MainBlock, RecentDocumentsBlock, Navbar, ProfileImageBlock, MembersBlock, |
90 | - * NoosferoTemplate, DateFormat, RawHTMLBlock, PersonTagsPluginInterestsBlock | |
91 | + * NoosferoTemplate, DateFormat, RawHTMLBlock, PersonTagsPluginInterestsBlock, RecentActivitiesPluginActivitiesBlock, | |
91 | 92 | * @description |
92 | 93 | * The Main controller for the Noosfero Angular Theme application. |
93 | 94 | * |
... | ... | @@ -106,7 +107,7 @@ export class EnvironmentContent { |
106 | 107 | MainBlockComponent, RecentDocumentsBlockComponent, Navbar, SidebarComponent, ProfileImageBlockComponent, |
107 | 108 | MembersBlockComponent, NoosferoTemplate, DateFormat, RawHTMLBlockComponent, StatisticsBlockComponent, |
108 | 109 | LoginBlockComponent, CustomContentComponent, PermissionDirective, SearchFormComponent, SearchComponent, |
109 | - PersonTagsPluginInterestsBlockComponent, TagsBlockComponent, BlockComponent | |
110 | + PersonTagsPluginInterestsBlockComponent, TagsBlockComponent, RecentActivitiesPluginActivitiesBlockComponent, BlockComponent | |
110 | 111 | ].concat(plugins.mainComponents).concat(plugins.hotspots), |
111 | 112 | providers: [AuthService, SessionService, NotificationService, BodyStateClassesService, |
112 | 113 | "ngAnimate", "ngCookies", "ngStorage", "ngTouch", | ... | ... |