Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Allow to associate article from outing detail view page #1290

Merged
merged 1 commit into from Jan 4, 2017

Conversation

dkocich
Copy link
Contributor

@dkocich dkocich commented Jan 1, 2017

Related to #1284
It is now able to associate articles (and routes) from outing detail view page

@@ -88,7 +88,8 @@ app.AddAssociationController.prototype.associate = function(doc) {
// if the parent doc is a route and the child doc is a waypoint OR
// if the parent doc is an outing, inverse the IDs.
if ((parentType === 'routes' && doc['type'] === 'w') ||
parentType === 'outings' || parentType === 'images' ||
(parentType === 'outings' && (doc['type'] === 'r' || doc['type'] === 'u')) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure to understand this change. Isn't article type missing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outings were swapped to be child in all added associations on the outing view page (but in the case of articles we should keep them as children in its association to outings and there is no need to include them here - for outings only route/user should be swapped). https://github.com/c2corg/v6_common/blob/master/c2corg_common/associations.py#L7-L8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks for the explanations.

To be honest I think this part is getting a bit confusing and not easy to understand. I don't know if we could do something to make it more explicit?

@asaunier asaunier merged commit 9dcb637 into master Jan 4, 2017
@asaunier asaunier deleted the assoc-out-to-art branch January 4, 2017 15:46
@asaunier
Copy link
Member

asaunier commented Jan 4, 2017

I have merged the PR because we would like to update the demo soon :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants