diff --git a/src/app/article/content-viewer/navbar-actions.html b/src/app/article/content-viewer/navbar-actions.html index 6b8d64d..fac7f40 100644 --- a/src/app/article/content-viewer/navbar-actions.html +++ b/src/app/article/content-viewer/navbar-actions.html @@ -10,7 +10,7 @@ {{"navbar.content_viewer_actions.new_post" | translate}} -
  • +
  • {{"navbar.content_viewer_actions.new_discussion" | translate}} diff --git a/src/app/profile/navbar-actions.html b/src/app/profile/navbar-actions.html new file mode 100644 index 0000000..f4a02f9 --- /dev/null +++ b/src/app/profile/navbar-actions.html @@ -0,0 +1,18 @@ + + diff --git a/src/app/profile/profile-actions.component.ts b/src/app/profile/profile-actions.component.ts new file mode 100644 index 0000000..410035f --- /dev/null +++ b/src/app/profile/profile-actions.component.ts @@ -0,0 +1,21 @@ +import {Component, Inject, provide} from "ng-forward"; +import {ProfileService} from "../../lib/ng-noosfero-api/http/profile.service"; + +@Component({ + selector: "profile-actions", + templateUrl: "app/article/content-viewer/navbar-actions.html", + providers: [ + provide('profileService', { useClass: ProfileService }) + ] +}) +@Inject(ProfileService) +export class ProfileActionsComponent { + profile: noosfero.Profile; + parentId: number; + + constructor(profileService: ProfileService) { + profileService.getCurrentProfile().then((profile: noosfero.Profile) => { + this.profile = profile; + }); + } +} diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts index 313025b..ffabfb0 100644 --- a/src/app/profile/profile.component.ts +++ b/src/app/profile/profile.component.ts @@ -9,7 +9,7 @@ import {ActivitiesComponent} from "./activities/activities.component"; import {ProfileService} from "../../lib/ng-noosfero-api/http/profile.service"; import {NotificationService} from "../shared/services/notification.service"; import {MyProfileComponent} from "./myprofile.component"; - +import {ProfileActionsComponent} from "./profile-actions.component"; /** * @ngdoc controller @@ -37,13 +37,25 @@ import {MyProfileComponent} from "./myprofile.component"; templateUrl: "app/profile/info/profile-info.html", controller: ProfileInfoComponent, controllerAs: "vm" + }, + "actions@main": { + templateUrl: "app/profile/navbar-actions.html", + controller: ProfileActionsComponent, + controllerAs: "vm" } } }, { name: 'main.profile.settings', url: "^/myprofile/:profile", - component: MyProfileComponent + component: MyProfileComponent, + views: { + "actions@main": { + templateUrl: "app/profile/navbar-actions.html", + controller: ProfileActionsComponent, + controllerAs: "vm" + } + } }, { name: 'main.cms', diff --git a/src/languages/en.json b/src/languages/en.json index 76e2a10..3534478 100644 --- a/src/languages/en.json +++ b/src/languages/en.json @@ -25,8 +25,11 @@ "auth.form.password": "Password", "auth.form.login_button": "Login", "navbar.content_viewer_actions.new_item": "New Item", + "navbar.profile_actions.new_item": "New Item", "navbar.content_viewer_actions.new_post": "New Post", + "//TODO": "Create a way to load plugin translatios - Move plugins translations to the plugins translations files", "navbar.content_viewer_actions.new_discussion": "New Discussion", + "navbar.profile_actions.new_discussion": "New Discussion", "notification.error.default.message": "Something went wrong!", "notification.error.default.title": "Oops...", "notification.profile.not_found": "Page not found", -- libgit2 0.21.2