diff --git a/src/app/index.scss b/src/app/index.scss index 4e0eefc..81a917e 100644 --- a/src/app/index.scss +++ b/src/app/index.scss @@ -57,14 +57,6 @@ $break-xs-max: ($break-xs-min - 1); padding: 0.2em 0; } -.thumbnail { - height: 200px; - - img.pull-right { - width: 50px; - } -} - h1, h2, h3, h4, h5 { color: #237394; } diff --git a/src/app/layout/blocks/block.scss b/src/app/layout/blocks/block.scss index 1e7422d..7cd6cbb 100644 --- a/src/app/layout/blocks/block.scss +++ b/src/app/layout/blocks/block.scss @@ -13,6 +13,15 @@ .panel-heading { background-color: transparent; border: 0; + padding: 0.5em 1.2em 0 1em; + h3{ + border-bottom: 3px solid #1E96D0; + padding: 1em; + padding-left: 0; + } + } + .panel-body{ + padding-top: 0.5em; } } .block-actions { diff --git a/src/app/layout/blocks/communities/communities-block.component.spec.ts b/src/app/layout/blocks/communities/communities-block.component.spec.ts index bc6eafd..fc51b78 100644 --- a/src/app/layout/blocks/communities/communities-block.component.spec.ts +++ b/src/app/layout/blocks/communities/communities-block.component.spec.ts @@ -1,50 +1,46 @@ import {TestComponentBuilder} from 'ng-forward/cjs/testing/test-component-builder'; -import {Provider, Input, provide, Component} from 'ng-forward'; - +import {Provider} from 'ng-forward'; +import {ComponentTestHelper, createClass} from './../../../../spec/component-test-helper'; +// import {providers} from 'ng-forward/cjs/testing/providers'; import {CommunitiesBlockComponent} from './communities-block.component'; const htmlTemplate: string = ''; -const tcb = new TestComponentBuilder(); - describe("Components", () => { - describe("Communities Block Component", () => { - beforeEach(angular.mock.module("templates")); + describe("Community Block Component", () => { + let serviceMock = { + getByOwner: (owner: any, params: any): any => { + return Promise.resolve({ data: [{ identifier: "community1" }] }); + } + }; - let state = jasmine.createSpyObj("state", ["go"]); - let providers = [ - new Provider('truncateFilter', { useValue: () => { } }), - new Provider('stripTagsFilter', { useValue: () => { } }), - new Provider('$state', { useValue: state }), - new Provider('CommunityService', { - useValue: { - getByOwner: (owner: any, params: any): any => { - return Promise.resolve({ data: [{ identifier: "community1" }] }); - } - } - }), - ]; - @Component({ selector: 'test-container-component', template: htmlTemplate, directives: [CommunitiesBlockComponent], providers: providers }) - class BlockContainerComponent { - block = { type: 'Block', settings: {} }; - owner = { name: 'profile-name' }; - } - - it("get communities", done => { - tcb.createAsync(BlockContainerComponent).then(fixture => { - let block: CommunitiesBlockComponent = fixture.debugElement.componentViewChildren[0].componentInstance; - expect(block.profiles).toEqual([{ identifier: "community1" }]); - done(); + let providers = [new Provider('CommunityService', { useValue: serviceMock })]; + + let helper: ComponentTestHelper; + + beforeEach(angular.mock.module("templates")); + beforeEach((done) => { + let cls = createClass({ + template: htmlTemplate, + directives: [CommunitiesBlockComponent], + providers: providers, + properties: {} }); + helper = new ComponentTestHelper(cls, done); }); - it("render the profile image for each community", done => { - tcb.createAsync(BlockContainerComponent).then(fixture => { - fixture.debugElement.getLocal("$rootScope").$apply(); - expect(fixture.debugElement.queryAll("noosfero-profile-image").length).toEqual(1); - done(); - }); + it("get block with one community", done => { + expect(helper.component.profiles[0].identifier).toEqual("community1"); + done(); + }); + + it("render the profile image for each community", () => { + expect(helper.all("noosfero-profile-image").length).toEqual(1); + }); + + it("render the noosfero communities block", () => { + expect(helper.all(".media-list").length).toEqual(1); }); }); diff --git a/src/app/layout/blocks/communities/communities-block.component.ts b/src/app/layout/blocks/communities/communities-block.component.ts index 0ad4b39..638f6ef 100644 --- a/src/app/layout/blocks/communities/communities-block.component.ts +++ b/src/app/layout/blocks/communities/communities-block.component.ts @@ -16,7 +16,7 @@ export class CommunitiesBlockComponent { constructor(private communityService: CommunityService) { } ngOnInit() { - let limit: number = ((this.block && this.block.settings) ? this.block.settings.limit : null) || 5; + let limit: number = ((this.block && this.block.settings) ? this.block.settings.limit : null) || 4; this.communityService.getByOwner(this.owner, { limit: limit }).then((result: noosfero.RestResult) => { this.profiles = result.data; }); diff --git a/src/app/layout/blocks/communities/communities-block.html b/src/app/layout/blocks/communities/communities-block.html index 4c4f5ee..6f5ed6c 100644 --- a/src/app/layout/blocks/communities/communities-block.html +++ b/src/app/layout/blocks/communities/communities-block.html @@ -1,5 +1,11 @@ - +
    +
  • +
    + +
    +
    +

    {{profile.name}}

    + {{"block.communities.members.count" | translate:{members: profile.members_count}:"messageformat"}} +
    +
  • +
diff --git a/src/app/layout/blocks/communities/communities-block.scss b/src/app/layout/blocks/communities/communities-block.scss index 7b27995..8264247 100644 --- a/src/app/layout/blocks/communities/communities-block.scss +++ b/src/app/layout/blocks/communities/communities-block.scss @@ -1,16 +1,4 @@ -.communities-block { - .profile { - margin: 10px; - img, i.profile-image { - width: 60px; - } - img { - display: inline-block; - vertical-align: top; - } - i.profile-image { - text-align: center; - font-size: 4.5em; - } - } +.media-list .media{ + border-bottom: 1px solid #e0e0e0; + padding-bottom: 0.3em; } diff --git a/src/app/layout/blocks/people/people-block.html b/src/app/layout/blocks/people/people-block.html index 7f72d92..3994a00 100644 --- a/src/app/layout/blocks/people/people-block.html +++ b/src/app/layout/blocks/people/people-block.html @@ -1,5 +1,7 @@
- - - +
+ + + +
diff --git a/src/app/layout/blocks/people/people-block.scss b/src/app/layout/blocks/people/people-block.scss deleted file mode 100644 index c5776e0..0000000 --- a/src/app/layout/blocks/people/people-block.scss +++ /dev/null @@ -1,17 +0,0 @@ -.members-block { - .member { - img, i.profile-image { - width: 60px; - } - img { - display: inline-block; - vertical-align: top; - } - i.profile-image { - text-align: center; - background-color: #889DB1; - color: #F1F1F1; - font-size: 4.5em; - } - } -} diff --git a/src/app/layout/scss/skins/_whbl.scss b/src/app/layout/scss/skins/_whbl.scss index 6112db5..ee92618 100644 --- a/src/app/layout/scss/skins/_whbl.scss +++ b/src/app/layout/scss/skins/_whbl.scss @@ -272,10 +272,7 @@ $whbl-font-color: #16191c; border-bottom-color: $whbl-primary-color; border-top-color: $whbl-primary-color; } - .panel-default > .panel-heading, - .notifications-list .item-footer { - background-color: $whbl-primary-color; - } + .notifications-list .item-footer a:hover { background-color: #2980b9; } diff --git a/src/app/profile/image/profile-image.html b/src/app/profile/image/profile-image.html index aa5d1bb..91edca9 100644 --- a/src/app/profile/image/profile-image.html +++ b/src/app/profile/image/profile-image.html @@ -14,7 +14,7 @@ - - - - +
+ + +
diff --git a/src/app/profile/image/profile-image.scss b/src/app/profile/image/profile-image.scss index b3864e6..1e357b4 100644 --- a/src/app/profile/image/profile-image.scss +++ b/src/app/profile/image/profile-image.scss @@ -1,3 +1,13 @@ +.profile-image-wrap{ + display: inherit; +} +.item-avatar-img{ + width: 60px; + float: left; + margin: 2px 7px 5px 0; + font-size: 4.0em; +} + .hovereffect { width:100%; height:100%; @@ -5,7 +15,7 @@ overflow:hidden; position:relative; text-align:center; - cursor:default; + cursor:default; .container-camera { position: relative; z-index: 2; diff --git a/src/languages/en.json b/src/languages/en.json index fefa50c..8804c91 100644 --- a/src/languages/en.json +++ b/src/languages/en.json @@ -106,6 +106,7 @@ "block.edition.display_user.logged": "Logged", "block.edition.display_user.not_logged": "Not logged", "block.edition.language.label": "Show for:", + "block.communities.members.count": "{members, plural, one{one member} other{# members}}", "activities.event.description": "Event on", "time.at": "at", "date.on": "On", diff --git a/src/languages/pt.json b/src/languages/pt.json index fe64608..2c4a235 100644 --- a/src/languages/pt.json +++ b/src/languages/pt.json @@ -106,6 +106,7 @@ "block.edition.display_user.logged": "Logados", "block.edition.display_user.not_logged": "Não logados", "block.edition.language.label": "Exibir para:", + "block.communities.members.count": "{members, plural, one{um membro} other{# membros}}", "activities.event.description": "Evento em", "time.at": "às", "date.on": "Em", -- libgit2 0.21.2