diff --git a/app/main/posts/views/post-export.directive.js b/app/main/posts/views/share/post-export.directive.js
similarity index 95%
rename from app/main/posts/views/post-export.directive.js
rename to app/main/posts/views/share/post-export.directive.js
index b5d8d69eb2..3d7c142bcd 100644
--- a/app/main/posts/views/post-export.directive.js
+++ b/app/main/posts/views/share/post-export.directive.js
@@ -4,12 +4,11 @@ PostExportDirective.$inject = [];
function PostExportDirective() {
return {
restrict: 'E',
- replace: true,
scope: {
filters: '='
},
controller: PostExportController,
- templateUrl: 'templates/main/posts/views/post-export.html'
+ templateUrl: 'templates/main/posts/views/share/post-export.html'
};
}
diff --git a/app/main/posts/views/share/post-export.html b/app/main/posts/views/share/post-export.html
new file mode 100644
index 0000000000..4fe43816d0
--- /dev/null
+++ b/app/main/posts/views/share/post-export.html
@@ -0,0 +1 @@
+
Export to CSV
diff --git a/app/main/posts/views/share/post-share.directive.js b/app/main/posts/views/share/post-share.directive.js
new file mode 100644
index 0000000000..21046234e0
--- /dev/null
+++ b/app/main/posts/views/share/post-share.directive.js
@@ -0,0 +1,52 @@
+module.exports = PostShareDirective;
+
+PostShareDirective.$inject = [];
+function PostShareDirective() {
+ return {
+ restrict: 'E',
+ replace: true,
+ scope: {
+ filters: '=',
+ button: '=?',
+ postId: '=?'
+ },
+ controller: PostShareController,
+ templateUrl: 'templates/main/posts/views/share/post-share.html'
+ };
+}
+
+PostShareController.$inject = [
+ '$scope',
+ '$window',
+ 'ModalService'
+];
+function PostShareController(
+ $scope,
+ $window,
+ ModalService
+) {
+ $scope.loading = false;
+ $scope.openShareMenu = openShareMenu;
+ $scope.isButton = isButton;
+ $scope.isAdd = isAdd;
+
+ activate();
+
+ function activate() {
+ }
+
+ function isButton() {
+ return $scope.button;
+ }
+
+ function isAdd() {
+ if ($window.location.href.indexOf('post') > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ function openShareMenu() {
+ ModalService.openTemplate('
', 'app.share', 'share', $scope, true, true);
+ }
+}
diff --git a/app/main/posts/views/share/post-share.html b/app/main/posts/views/share/post-share.html
new file mode 100644
index 0000000000..3dbeaca170
--- /dev/null
+++ b/app/main/posts/views/share/post-share.html
@@ -0,0 +1,13 @@
+
+
+
+
+ Share {{isButton()}}
+
+
diff --git a/app/main/posts/views/share/share-menu.directive.js b/app/main/posts/views/share/share-menu.directive.js
new file mode 100644
index 0000000000..5621dffc7b
--- /dev/null
+++ b/app/main/posts/views/share/share-menu.directive.js
@@ -0,0 +1,48 @@
+module.exports = ShareMenuDirective;
+
+ShareMenuDirective.$inject = [];
+function ShareMenuDirective() {
+ return {
+ restrict: 'E',
+ replace: true,
+ controller: ShareMenuController,
+ templateUrl: 'templates/main/posts/views/share/share-menu.html'
+ };
+}
+
+ShareMenuController.$inject = [
+ '$scope',
+ '$routeParams',
+ 'Util',
+ '$window'
+];
+function ShareMenuController(
+ $scope,
+ $routeParams,
+ Util,
+ $window
+) {
+ $scope.loading = false;
+ $scope.shareUrl = Util.currentUrl();
+ $scope.isExportable = isExportable;
+
+ activate();
+
+ function activate() {
+ // If we are in a post action menu
+ // Then we have to change the url to ensure that when
+ // selected from either the map or timeline view for
+ // an individual post that the URL is correct
+ if ($scope.postId) {
+ $scope.shareUrl = $window.location.origin + '/posts/' + $scope.postId;
+ }
+ $scope.shareUrlEncoded = encodeURIComponent($scope.shareUrl);
+ }
+ // Check if current view is exportable based on URI
+ function isExportable() {
+ if ($window.location.href.indexOf('post') > 0) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/app/main/posts/views/share/share-menu.html b/app/main/posts/views/share/share-menu.html
new file mode 100644
index 0000000000..c541e13f4d
--- /dev/null
+++ b/app/main/posts/views/share/share-menu.html
@@ -0,0 +1,78 @@
+
diff --git a/app/settings/data-import/data-import.html b/app/settings/data-import/data-import.html
index c5640c43ce..bbb25057f7 100644
--- a/app/settings/data-import/data-import.html
+++ b/app/settings/data-import/data-import.html
@@ -45,7 +45,7 @@
-
+
diff --git a/app/settings/data-import/import-complete.html b/app/settings/data-import/import-complete.html
index f0637231c8..d689a2f7e8 100644
--- a/app/settings/data-import/import-complete.html
+++ b/app/settings/data-import/import-complete.html
@@ -4,10 +4,8 @@
The data from your CSV spreadsheet, {{filename}}, was successfully imported into your {{form_name}} survey.
-
+
See imported posts
+
Import another CSV file
+
diff --git a/app/settings/settings.module.js b/app/settings/settings.module.js
index 6f982eed42..a504fce194 100644
--- a/app/settings/settings.module.js
+++ b/app/settings/settings.module.js
@@ -7,6 +7,7 @@ angular.module('ushahidi.settings', [])
.directive('surveyTaskCreate', require('./surveys/task-create.directive.js'))
.directive('surveyAttributeCreate', require('./surveys/attribute-create.directive.js'))
.directive('surveyAttributeEditor', require('./surveys/attribute-editor.directive.js'))
+.service('SurveyNotify', require('./surveys/survey.notify.service.js'))
.directive('settingsList', require('./settings-list.directive.js'))
.directive('settingsMap', require('./site/map.directive.js'))
diff --git a/app/settings/site/settings-editor.html b/app/settings/site/settings-editor.html
index e6c50ab885..8e817dde54 100644
--- a/app/settings/site/settings-editor.html
+++ b/app/settings/site/settings-editor.html
@@ -65,7 +65,7 @@
app.general
-
+
diff --git a/app/settings/surveys/survey-editor.directive.js b/app/settings/surveys/survey-editor.directive.js
index 6da1361616..770d2f6c5d 100644
--- a/app/settings/surveys/survey-editor.directive.js
+++ b/app/settings/surveys/survey-editor.directive.js
@@ -24,6 +24,7 @@ SurveyEditorController.$inject = [
'RoleEndpoint',
'_',
'Notify',
+ 'SurveyNotify',
'ModalService',
'Features'
];
@@ -39,6 +40,7 @@ function SurveyEditorController(
RoleEndpoint,
_,
Notify,
+ SurveyNotify,
ModalService,
Features
) {
@@ -522,7 +524,7 @@ function SurveyEditorController(
});
});
- Notify.notify('notify.form.edit_form_success', { name: $scope.survey.name });
+ SurveyNotify.success('notify.form.edit_form_success', { name: $scope.survey.name }, { formId: $scope.survey.id});
}, handleResponseErrors);
}
diff --git a/app/settings/surveys/survey-success.html b/app/settings/surveys/survey-success.html
new file mode 100644
index 0000000000..968e70e621
--- /dev/null
+++ b/app/settings/surveys/survey-success.html
@@ -0,0 +1,8 @@
+
+ {{successText}}
+
+
+
Add to survey
+
diff --git a/app/settings/surveys/survey.notify.service.js b/app/settings/surveys/survey.notify.service.js
new file mode 100644
index 0000000000..88307b9e67
--- /dev/null
+++ b/app/settings/surveys/survey.notify.service.js
@@ -0,0 +1,31 @@
+module.exports = SurveyNotify;
+
+var scope;
+
+SurveyNotify.$inject = ['_', '$q', '$rootScope', '$translate', 'SliderService', 'ModalService'];
+function SurveyNotify(_, $q, $rootScope, $translate, SliderService, ModalService) {
+ return {
+ success: success
+ };
+
+ function success(successText, translateValues, values) {
+ var scope = getScope();
+
+ function showSlider(successText) {
+ values.successText = successText;
+ scope = _.extend(scope, values);
+
+ SliderService.openUrl('templates/settings/surveys/survey-success.html', 'thumb-up', 'confirmation', scope, false, false);
+ }
+
+ $translate(successText, translateValues).then(showSlider, showSlider);
+ }
+
+ function getScope() {
+ if (scope) {
+ scope.$destroy();
+ }
+ scope = $rootScope.$new();
+ return scope;
+ }
+}
diff --git a/codeship-services.yml b/codeship-services.yml
index 4ca3775a7a..0b29067ec0 100644
--- a/codeship-services.yml
+++ b/codeship-services.yml
@@ -18,6 +18,8 @@ deploy:
image: deploy
dockerfile_path: docker/deploy.Dockerfile
encrypted_env_file: deployment.env.encrypted
+ volumes:
+ - ./tmp/out/last_build:/vols/last_build
test:
build:
image: test
diff --git a/codeship-steps.yml b/codeship-steps.yml
index f8086e303d..48480ba538 100644
--- a/codeship-steps.yml
+++ b/codeship-steps.yml
@@ -1,20 +1,22 @@
- name: "Test"
service: test
command: gulp test
+
+- name: "Build client"
+ service: build
+ command: build
+ tag: '^(v[0-9]\.[0-9]+.[0-9]+(-[a-zA-Z0-9\.]+)?)|(develop)|(production)$'
+
- type: parallel
steps:
- - name: "Bundle"
- type: serial
+ - name: "Release bundle"
+ service: release
+ command: release
tag: '^v[0-9]\.[0-9]+.[0-9]+(-[a-zA-Z0-9\.]+)?$'
- steps:
- - service: build
- command: build
- - service: release
- command: release
- - name: "Deploy"
+ - name: "Deploy staging"
service: deploy
tag: develop
- command: "ansible-playbook -vv -i hosts/rackspace_staging platform-client-update.yml -e=\"PLATFORM_CLIENT_VERSION=$CI_COMMIT_ID\""
+ command: ansible-playbook -vv -i hosts/rackspace_staging platform-client-update-rsync.yml -e PLATFORM_CLIENT_DEPLOY_SRC="/vols/last_build"
- name: "Deploy Production"
service: deploy
tag: production
diff --git a/docker/build.run.sh b/docker/build.run.sh
index f003b2e327..2e1937b68b 100644
--- a/docker/build.run.sh
+++ b/docker/build.run.sh
@@ -20,15 +20,15 @@ check_vols_out() {
# Sync from source code to the build directory, exclude any folders and file
# that are result of the build process
-function sync {
+sync() {
check_vols_src
- {
+ _sync_excludes() {
echo "- .git"
echo "- .bin"
echo "- node_modules"
echo "- tmp"
- } > /tmp/rsync_exclude
- rsync -ar --exclude-from=/tmp/rsync_exclude --delete-during /vols/src/ ./
+ }
+ rsync -ar --exclude-from=<(_sync_excludes) --delete-during /vols/src/ ./
}
# Build the client
@@ -36,13 +36,23 @@ build() {
npm install
gulp transifex-download
gulp build
- cp ./server/rewrite.htaccess ./server/www/
+}
+
+# export the build files to a shared folder
+export_build() {
+ # copy the raw build as a deployable
+ check_vols_out
+ if [ ! -d /vols/out/last_build ]; then
+ mkdir /vols/out/last_build
+ fi
+ rsync -ar --delete-during ./server/www/ /vols/out/last_build/
}
# Bundle the build into a tarball
bundle() {
check_vols_out
local version=${GITHUB_VERSION:-${CI_BRANCH:-v0.0.0}}
+ cp ./server/rewrite.htaccess ./server/www/
gulp release --version-suffix=${version} --dest-dir=/vols/out
}
@@ -54,6 +64,7 @@ case "$1" in
*)
sync
build
+ export_build
bundle
;;
esac
diff --git a/docker/deploy.run.sh b/docker/deploy.run.sh
index 18dfc6cf22..c8cdb21a12 100755
--- a/docker/deploy.run.sh
+++ b/docker/deploy.run.sh
@@ -17,7 +17,7 @@ fi
cat >> /opt/ansible.cfg << EOM
[ssh_connection]
-ssh_args=
+control_path=/dev/shm/ansible-ssh-%%h-%%p-%%r
EOM
# ==> Get latest deployment code from github
diff --git a/package.json b/package.json
index e976233139..27e5e10998 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ushahidi-platform-client",
- "version": "3.6.0",
+ "version": "3.6.1",
"description": "Ushahidi Platform Official Web Client",
"main": "gulpfile.js",
"repository": {
@@ -44,7 +44,7 @@
"gulp-plumber": "^1.0.1",
"gulp-rename": "~1.2.0",
"gulp-sass": "~2.3.1",
- "gulp-sourcemaps": "^1.4.0",
+ "gulp-sourcemaps": "^1.8.0",
"gulp-tar": "^1.3.2",
"gulp-uglify": "^1.0.2",
"gulp-util": "^3.0.6",
@@ -94,7 +94,6 @@
"checklist-model": "~0.10.0",
"d3": "^3.5.17",
"leaflet": "~0.7.3",
- "leaflet-draw": "~0.3.0",
"leaflet.locatecontrol": "^0.52.0",
"leaflet.markercluster": "0.5.0",
"moment": "^2.13.0",
@@ -104,9 +103,9 @@
"nvd3": "^1.8.4",
"selection-model": "jtrussell/angular-selection-model.git",
"underscore": "^1.7.0",
- "ushahidi-platform-pattern-library": "^3.6.0"
+ "ushahidi-platform-pattern-library": "3.6.1"
},
"engines": {
- "node": ">=0.10"
+ "node": ">=4.0"
}
}
diff --git a/server/www/index.html b/server/www/index.html
index a0f941349c..0f3c4d3903 100644
--- a/server/www/index.html
+++ b/server/www/index.html
@@ -41,7 +41,7 @@
-
+
@@ -137,5 +137,17 @@
}));
}
+
+
+
+