Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2479 from liqd/2016-07-tb-mercator-2016-blog
Browse files Browse the repository at this point in the history
mercator 2016 blog/logbook/journey
  • Loading branch information
John Schmid authored Jul 20, 2016
2 parents a8f4d0c + 64edd4a commit 2d03ed1
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ def reindex_requested_funding(root, registry):
catalogs.reindex_index(proposal, 'mercator_requested_funding')


@log_migration
def add_haslogbookpool_sheet_to_mecator2(root, registry):
"""Add badgeable sheet to proposals versions."""
from adhocracy_mercator.resources.mercator2 import IMercatorProposal
migrate_new_sheet(root, IMercatorProposal, IHasLogbookPool)


def includeme(config):
"""Register evolution utilities and add evolution steps."""
config.add_evolution_step(evolve1_add_ititle_sheet_to_proposals)
Expand All @@ -194,3 +201,4 @@ def includeme(config):
config.add_evolution_step(remove_mercator_workflow_assignment_sheet)
config.add_evolution_step(make_mercator_proposals_badgeable)
config.add_evolution_step(reindex_requested_funding)
config.add_evolution_step(add_haslogbookpool_sheet_to_mecator2)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from adhocracy_core.sheets.rate import ILikeable
from adhocracy_core.sheets.title import ITitle
from adhocracy_core.sheets.image import IImageReference
from adhocracy_core.sheets.logbook import IHasLogbookPool
from adhocracy_core.resources.comment import add_commentsservice
from adhocracy_core.resources.rate import add_ratesservice
from adhocracy_core.resources.badge import add_badge_assignments_service
Expand Down Expand Up @@ -236,6 +237,7 @@ class IMercatorProposal(IProposal):
ICommentable,
ILikeable,
IImageReference,
IHasLogbookPool,
adhocracy_mercator.sheets.mercator2.IMercatorSubResources,
adhocracy_mercator.sheets.mercator2.IUserInfo,
adhocracy_mercator.sheets.mercator2.IOrganizationInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ def test_meta(self, meta):
adhocracy_core.sheets.comment.ICommentable,
adhocracy_core.sheets.rate.ILikeable,
adhocracy_core.sheets.image.IImageReference,
adhocracy_core.sheets.logbook.IHasLogbookPool,
adhocracy_mercator.sheets.mercator2.IMercatorSubResources,
adhocracy_mercator.sheets.mercator2.IUserInfo,
adhocracy_mercator.sheets.mercator2.IOrganizationInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,22 @@ <h1 class="section-jump-cover-header screen-only">{{ data.title }}
</div>
</div>

<div class="mercator-proposal-detail-view">
<div data-ng-if="showBlogTabs()" class="blog-tabs">
<a
class="blog-tab"
data-ng-class="{'is-active': proposalTab !== 'blog'}"
data-ng-href="{{ path | adhResourceUrl }}">{{ "TR__MERCATOR_PROPOSAL_TAB_IDEA" | translate }}</a>
<a
class="blog-tab"
data-ng-class="{'is-active': proposalTab === 'blog'}"
data-ng-href="{{ path | adhResourceUrl:'blog' }}">{{ "TR__MERCATOR_PROPOSAL_TAB_JOURNEY" | translate }}</a>
</div>

<div data-ng-if="showBlogTabs() && proposalTab === 'blog'" class="blog">
<adh-blog data-ng-if="data.logbookPoolPath" data-path="{{ data.logbookPoolPath }}"></adh-blog>
</div>

<div class="mercator-proposal-detail-view" data-ng-if="!showBlogTabs() || proposalTab !== 'blog'">
<adh-show-image
data-css-class="mercator-proposal-detail-view-image"
data-path="{{data.introduction.picture}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import * as SIFinancialPlanning from "../../../../Resources_/adhocracy_mercator/
import * as SIGoal from "../../../../Resources_/adhocracy_mercator/sheets/mercator2/IGoal";
import * as SIImageReference from "../../../../Resources_/adhocracy_core/sheets/image/IImageReference";
import * as SILocation from "../../../../Resources_/adhocracy_mercator/sheets/mercator2/ILocation";
import * as SILogbook from "../../../../Resources_/adhocracy_core/sheets/logbook/IHasLogbookPool";
import * as SIMercatorIntroImageMetadata from "../../../../Resources_/adhocracy_mercator/sheets/mercator/IIntroImageMetadata";
import * as SIMercatorSubResources from "../../../../Resources_/adhocracy_mercator/sheets/mercator2/IMercatorSubResources";
import * as SIMercatorUserInfo from "../../../../Resources_/adhocracy_mercator/sheets/mercator2/IUserInfo";
Expand Down Expand Up @@ -89,6 +90,7 @@ var topicTrString = (topic : string) : string => {


export interface IData {
logbookPoolPath : string;
userInfo : {
firstName : string;
lastName : string;
Expand Down Expand Up @@ -550,6 +552,8 @@ var get = (

creationDate: proposal.data[SIMetaData.nick].item_creation_date,
creator: proposal.data[SIMetaData.nick].creator,
logbookPoolPath: proposal.data[SILogbook.nick].logbook_pool,

userInfo: {
firstName: proposal.data[SIMercatorUserInfo.nick].first_name,
lastName: proposal.data[SIMercatorUserInfo.nick].last_name
Expand Down Expand Up @@ -1026,6 +1030,13 @@ export var detailDirective = (
get($q, adhHttp, adhTopLevelState, adhGetBadges)(scope.path).then((data) => {
scope.data = data;
});

scope.$on("$destroy", adhTopLevelState.bind("processState", scope));
scope.$on("$destroy", adhTopLevelState.bind("view", scope, "proposalTab"));

scope.showBlogTabs = () => {
return scope.data && scope.data.winner.name && scope.processState === "result";
};
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@ export var registerRoutes = (
proposalUrl: resource.path
};
})
.default(RIProposal, "blog", processType, context, {
space: "content",
movingColumns: "is-show-show-hide"
})
.specific(RIProposal, "blog", processType, context, () => (resource : RIProposal) => {
return {
proposalUrl: resource.path
};
})
.default(RIProposal, "moderate", processType, context, {
space: "content",
movingColumns: "is-collapse-show-hide"
Expand Down

0 comments on commit 2d03ed1

Please sign in to comment.