Permalink
Browse files

Merge pull request #1290 from c2corg/assoc-out-to-art

Allow to associate article from outing detail view page
  • Loading branch information...
2 parents 9b3a49d + ab034eb commit 9dcb63743ada8adfb06057d0ab4fdb0b56183502 @asaunier asaunier committed on GitHub Jan 4, 2017
Showing with 3 additions and 2 deletions.
  1. +2 −1 c2corg_ui/static/js/addassociation.js
  2. +1 −1 c2corg_ui/templates/outing/view.html
@@ -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')) ||
+ parentType === 'images' ||
(parentType === 'articles' && (doc['type'] === 'w' ||
doc['type'] === 'o' || doc['type'] === 'r' || doc['type'] === 'b')) ||
(parentType === 'routes' && doc['type'] === 'b') ||
@@ -134,7 +134,7 @@ <h3 class="heading informations" ng-click="mainCtrl.animateHeaderIcon($event)" d
<span class="lead">
<div ng-show="userCtrl.auth.isAuthenticated() && userCtrl.hasEditRights('outings', {'users': ${dumps(outing['associations']['users'])}})">
<label translate>Add association</label>
- <app-add-association parent-doctype="outings" parent-id="${outing_id}" dataset="r"></app-add-association>
+ <app-add-association parent-doctype="outings" parent-id="${outing_id}" dataset="rc"></app-add-association>
</div>
<section>
${show_associated_routes(outing)}

0 comments on commit 9dcb637

Please sign in to comment.