diff --git a/src/adhocracy_mercator/adhocracy_mercator/evolution/__init__.py b/src/adhocracy_mercator/adhocracy_mercator/evolution/__init__.py index eda039ab4..b200ef8f1 100644 --- a/src/adhocracy_mercator/adhocracy_mercator/evolution/__init__.py +++ b/src/adhocracy_mercator/adhocracy_mercator/evolution/__init__.py @@ -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) @@ -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) diff --git a/src/adhocracy_mercator/adhocracy_mercator/resources/mercator2.py b/src/adhocracy_mercator/adhocracy_mercator/resources/mercator2.py index 3eb5179e3..764c52397 100644 --- a/src/adhocracy_mercator/adhocracy_mercator/resources/mercator2.py +++ b/src/adhocracy_mercator/adhocracy_mercator/resources/mercator2.py @@ -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 @@ -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, diff --git a/src/adhocracy_mercator/adhocracy_mercator/resources/test_mercator2.py b/src/adhocracy_mercator/adhocracy_mercator/resources/test_mercator2.py index 8042c7067..31b74fee4 100644 --- a/src/adhocracy_mercator/adhocracy_mercator/resources/test_mercator2.py +++ b/src/adhocracy_mercator/adhocracy_mercator/resources/test_mercator2.py @@ -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, diff --git a/src/mercator/mercator/static/js/Packages/Mercator/2016/Proposal/Detail.html b/src/mercator/mercator/static/js/Packages/Mercator/2016/Proposal/Detail.html index f9877cbbb..94e3499ed 100644 --- a/src/mercator/mercator/static/js/Packages/Mercator/2016/Proposal/Detail.html +++ b/src/mercator/mercator/static/js/Packages/Mercator/2016/Proposal/Detail.html @@ -47,7 +47,22 @@

{{ data.title }} -
+ + +
+ +
+ +
{ export interface IData { + logbookPoolPath : string; userInfo : { firstName : string; lastName : string; @@ -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 @@ -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"; + }; } }; }; diff --git a/src/mercator/mercator/static/js/Packages/Mercator/2016/Workbench/Workbench.ts b/src/mercator/mercator/static/js/Packages/Mercator/2016/Workbench/Workbench.ts index b9bdf6c92..16a65e418 100644 --- a/src/mercator/mercator/static/js/Packages/Mercator/2016/Workbench/Workbench.ts +++ b/src/mercator/mercator/static/js/Packages/Mercator/2016/Workbench/Workbench.ts @@ -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"