Skip to content

Commit

Permalink
Merge pull request #982 from ushahidi/2454-embeds
Browse files Browse the repository at this point in the history
adjusting client to embed-changes ushahidi/platform#2457
  • Loading branch information
tuxpiper authored Feb 12, 2018
2 parents bd072df + 2bb7df1 commit d379643
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</div>
<div id="bootstrap-app" class="hidden">

<mode-bar embed-only=false current-user="currentUser"></mode-bar>
<mode-bar current-user="currentUser"></mode-bar>
<ui-view></ui-view>

<!-- TODO: fix and uncomment
Expand Down
5 changes: 4 additions & 1 deletion app/main/posts/detail/post-detail-data.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ function PostDetailDataController(
$scope.$watch('post', function (post) {
activate();
});
/* need to check for embed here to set the correct class
* if coming from map to detail-view in embed, TODO: should go to a service! */
var isEmbed = ($window.self !== $window.top) ? true : false;
isEmbed ? $rootScope.setLayout('layout-d layout-embed') : $rootScope.setLayout('layout-d');

$rootScope.setLayout('layout-d');
$scope.post = $scope.post;
$scope.post_task = {};
$scope.hasPermission = $rootScope.hasPermission;
Expand Down
2 changes: 1 addition & 1 deletion app/main/posts/views/filter-by-survey.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div embed-only="true" class="toolbox hide-when-medium">
<div class="embed-survey-filter" embed-only="true" class="toolbox hide-when-medium">
<button ng-click="openFilters()" class="button-beta button-plain mode-context-trigger" translate="app.filter_by_survey">Filter by survey</button>
</div>
26 changes: 15 additions & 11 deletions app/main/posts/views/post-toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@
</div>
</div>

<filter-by-survey></filter-by-survey>
<div class="button-group hide-until-medium" embed-only="true" ng-hide="filtersActive">
<div ng-if="!editMode()">
<post-share filters="filters" button="true"></post-share>
<button ng-if="editEnabled()" class="button button-alpha" ng-click="setEditMode()" translate>app.edit</button>
</div>
<div embed-only="true" class="hide-until-medium">
<filter-posts filters="filters" on-open="hideOtherActions()" on-close="showOtherActions()"></filter-posts>
<div class="button-group">
<div ng-hide="filtersActive">
<div ng-if="!editMode()">
<post-share filters="filters" button="true"></post-share>
<button ng-if="editEnabled()" class="button button-alpha" ng-click="setEditMode()" translate>app.edit</button>
</div>

<div ng-if="editMode()">
<button ng-if="hasPermission" class="button" ng-click="cancel()" translate>app.cancel</button>
<button ng-if="hasPermission && !isSaving()" ng-click="savePost()" class=" button button-alpha" translate>app.save</button>
<loading-dots button-class="'button-alpha'" disabled=true label="'app.saving'" ng-if="isSaving()"></loading-dots>
<div ng-if="editMode()">
<button ng-if="hasPermission" class="button" ng-click="cancel()" translate>app.cancel</button>
<button ng-if="hasPermission && !isSaving()" ng-click="savePost()" class=" button button-alpha" translate>app.save</button>
</div>
</div>
</div>
<loading-dots button-class="'button-alpha'" disabled=true label="'app.saving'" ng-if="isSaving()"></loading-dots>
</div>

<!-- toolbar -->
Expand All @@ -39,4 +43,4 @@
..
</span>
</div>
</div>
</div>
8 changes: 8 additions & 0 deletions app/main/posts/views/post-view-data.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<!-- Below code is used to get the header to embeds -->
<div class="mode-context init" embed-only="true" ng-controller="navigation as nav" dropdown>
<header class="mode-context-header" ng-class="{ 'has-logo' : nav.site.image_header }">
<h1 class="mode-context-title"><a href="/" ng-bind="nav.site.name"></a></h1>
<img ng-if="nav.site.image_header" ng-src="{{ nav.site.image_header }}" class="deployment-logo" />
</header>
</div>
<main role="main">

<div class="flex-container">
<layout-class layout="d"></layout-class>
<post-toolbar selected-post="selectedPost.post" filters="filters"></post-toolbar>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"nvd3": "^1.8.4",
"socket.io-client": "2.0.3",
"underscore": "^1.7.0",
"ushahidi-platform-pattern-library": "v3.7.2-rc.24"
"ushahidi-platform-pattern-library": "3.7.2-rc.31"
},
"engines": {
"node": ">=4.0"
Expand Down

0 comments on commit d379643

Please sign in to comment.