Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/newsletter #158

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions resources/translation/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"contributors_title": null,
"education_description": "قم بتطوير خبراتك المعرفية و تنمية مهاراتك من اجل مستقبل أفضل",
"education_title": "تعليم",
"email_hint": null,
"employment_description": "ابحث عن فرص شغل او تكوين مهني، التق بمهنيين بنفس اهتماماتك",
"employment_title": "شغل",
"follow_us": null,
Expand All @@ -23,11 +24,14 @@
"language_title": "لغات",
"media-and-communication_description": "تّعرف على قصص ملهمة، و تجارب مثيرة غيرت حياة الناس",
"media-and-communication_title": "إعلام و مواصلات",
"newsletter_description": null,
"newsletter_title": null,
"refugee_tech_info": "نقوم بتوحيد جهود المجتمع، من اجل مساعدة القادمين الجدد. نقوم بذلك من خلال توظيف تكنولجيات وخدم معدة لذلك ",
"setelin_description": "تم إنشاء 'ستل إن' خلال هكاتون نظمته 'ريفوجي تك ' مع مصلحة الهجرة و 'ستكهولم تك '. خلال الهكاتون، تم توحيد جهود المبادرات التي تساعد اللاجئين في السويد من خلال إنشاء هذا التطبيق.\nقامت 'ريفوجي تك ' بعد ذلك بالسهر على إتمام التطبيق.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "قل لي من تعاشر، أقول لك من أنت. تعرف على أناس جدد و ابدأ صداقات جديدة",
"social_title": "تواصل اجتماعي",
"subscribe_label": null,
"visit_us": null
}
6 changes: 5 additions & 1 deletion resources/translation/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"contributors_title": "contributors",
"education_description": "Get smarter, develop new skills and continue growing",
"education_title": "education",
"email_hint": "Sign up with [email protected]",
"employment_description": "Start networking, get an internship, a job or start new business",
"employment_title": "employment",
"follow_us": "follow us",
Expand All @@ -23,11 +24,14 @@
"language_title": "language",
"media-and-communication_description": "Get inspired and learn from other people’s lives and experiences.",
"media-and-communication_title": "media & communication",
"newsletter_description": "lorem ipsum in collaboration with this and that date",
"newsletter_title": "newsletter",
"refugee_tech_info": "We build bridges between parts of the society to enable newcomers potential relying on efficiently designed and developed solutions",
"setelin_description": "Setelin was created as a result of a hackathon that was organised by Refugee Tech, together with Migrationsverket and STHLM TECH. The hackathon joined forces of Swedish tech initiatives who deal with social topics.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "Friends make us who we are, find new friends and meet new folks.",
"social_title": "Social",
"social_title": "social",
"subscribe_label": "subscribe",
"visit_us": "visit us"
}
8 changes: 6 additions & 2 deletions resources/translation/fa.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"about_us": "درباره ما",
"add_your_app": null,
"add_your_app": "اپليكشن خود را اضافه كنيد",
"categories": "دسته بندی ها",
"choose_language": "انتخاب زبان",
"contact": null,
"contributors_description": null,
"contributors_title": null,
"education_description": "باهوش تر شوید و مهارت هایتان را بیافزایید",
"education_title": "تحصیلات",
"email_hint": null,
"employment_description": "با دیگران ارتباط برقرار کنید،تا کارآموزی ويا شغل ثابت بگیرید",
"employment_title": "استخدام",
"follow_us": null,
Expand All @@ -23,11 +24,14 @@
"language_title": "زبان",
"media-and-communication_description": "از زندگی وتجربیات دیگران الهام بگیرید",
"media-and-communication_title": "رسانه و ارتباطات",
"refugee_tech_info": "نهج حصلت على أي أفكار التطبيق المباشر لهم RT إذا المطور يريد تحميل التطبيق .",
"newsletter_description": null,
"newsletter_title": null,
"refugee_tech_info": "ما پلى هستيم بين بخش هاى مختلف جامعه تا به وسيله ى تكنولوژى و راه حل هاى سازمان يافته، توانايى هاى مهاجران را شكوفا كنيم.",
"setelin_description": "ستلین در یک هکتن با مدیریت رفیوجی تک و همکاری اداره ی مهاجرت و استکهلم تک شکل گرفت. این محفل پروژه هایی که هدف کمک کردن به مسائل اجتماعی دارند را دور هم جمع کرد.\nرفیوجی تک مسؤلیت توسعه وتکمیل کردن پلتفرم ستلین را ، با یاری داوطلبان و همکاران دیگر، به عهده گرفت.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "دوستان جدید بیابید و با مردمان جدید آشنا شوید",
"social_title": "اجتماعي",
"subscribe_label": null,
"visit_us": null
}
4 changes: 4 additions & 0 deletions resources/translation/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"contributors_title": "volontärer",
"education_description": "Bli mer skicklig, utveckla nya kompetenser och fortsätt växa",
"education_title": "utbildning",
"email_hint": null,
"employment_description": "Börja nätverka, få ett internship, ett jobb eller starta eget företag",
"employment_title": "jobb",
"follow_us": "följ oss",
Expand All @@ -23,11 +24,14 @@
"language_title": "språk",
"media-and-communication_description": "Bli inspirerad och ta lärdom från andra människors liv och erfarenheter",
"media-and-communication_title": "media & kommunikation",
"newsletter_description": null,
"newsletter_title": "nyhetsbrev",
"refugee_tech_info": "Vi möjligör samarbete mellan alla delar av samhället med målet att tillvarata potentialen hos nyanlända genom effektivt designade och utvecklade lösningar",
"setelin_description": "Setelin är resultatet från ett hackathon organiserat av Refugee Tech tillsammans med Migrationsverket och STHLM TECH.\nRefugee Tech tog på sig att vidareutveckla plattformen tillsammans med voluntärer.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "Vänner gör oss till dem vi är, hitta nya vänner och skapa nya bekantskaper",
"social_title": "socialt",
"subscribe_label": null,
"visit_us": "besök oss"
}
3 changes: 3 additions & 0 deletions scss/newsletter.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.newsletter-content {
margin: 0px 0px 0px 15px;
}
30 changes: 27 additions & 3 deletions www/js/configuration/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $translateProvider.translations("ar", {
"contributors_title": null,
"education_description": "قم بتطوير خبراتك المعرفية و تنمية مهاراتك من اجل مستقبل أفضل",
"education_title": "تعليم",
"email_hint": null,
"employment_description": "ابحث عن فرص شغل او تكوين مهني، التق بمهنيين بنفس اهتماماتك",
"employment_title": "شغل",
"follow_us": null,
Expand All @@ -24,12 +25,17 @@ $translateProvider.translations("ar", {
"language_title": "لغات",
"media-and-communication_description": "تّعرف على قصص ملهمة، و تجارب مثيرة غيرت حياة الناس",
"media-and-communication_title": "إعلام و مواصلات",
"newsletter_description": null,
"newsletter_title": null,
"newsletter_registration_info": " تم تسجيل البريد الاكتروني ",
"newsletter_registration_exist": "ﻫﺬﺍ ﺍﻟﺒﺮﻳﺪ ﺍﻹﻟﻜﺘﺮﻭﻧﻰ ﻣﺴﺠﻞ",
"refugee_tech_info": "نقوم بتوحيد جهود المجتمع، من اجل مساعدة القادمين الجدد. نقوم بذلك من خلال توظيف تكنولجيات وخدم معدة لذلك ",
"setelin_description": "تم إنشاء 'ستل إن' خلال هكاتون نظمته 'ريفوجي تك ' مع مصلحة الهجرة و 'ستكهولم تك '. خلال الهكاتون، تم توحيد جهود المبادرات التي تساعد اللاجئين في السويد من خلال إنشاء هذا التطبيق.\nقامت 'ريفوجي تك ' بعد ذلك بالسهر على إتمام التطبيق.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "قل لي من تعاشر، أقول لك من أنت. تعرف على أناس جدد و ابدأ صداقات جديدة",
"social_title": "تواصل اجتماعي",
"subscribe_label": null,
"visit_us": null
});

Expand All @@ -43,6 +49,7 @@ $translateProvider.translations("en", {
"contributors_title": "contributors",
"education_description": "Get smarter, develop new skills and continue growing",
"education_title": "education",
"email_hint": "Sign up with [email protected]",
"employment_description": "Start networking, get an internship, a job or start new business",
"employment_title": "employment",
"follow_us": "follow us",
Expand All @@ -58,25 +65,31 @@ $translateProvider.translations("en", {
"language_title": "language",
"media-and-communication_description": "Get inspired and learn from other people’s lives and experiences.",
"media-and-communication_title": "media & communication",
"newsletter_description": "lorem ipsum in collaboration with this and that date",
"newsletter_title": "newsletter",
"newsletter_registration_info": "Registration done",
"newsletter_registration_exist": "This email is already registered",
"refugee_tech_info": "We build bridges between parts of the society to enable newcomers potential relying on efficiently designed and developed solutions",
"setelin_description": "Setelin was created as a result of a hackathon that was organised by Refugee Tech, together with Migrationsverket and STHLM TECH. The hackathon joined forces of Swedish tech initiatives who deal with social topics.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "Friends make us who we are, find new friends and meet new folks.",
"social_title": "Social",
"social_title": "social",
"subscribe_label": "subscribe",
"visit_us": "visit us"
});

$translateProvider.translations("fa", {
"about_us": "درباره ما",
"add_your_app": null,
"add_your_app": "اپليكشن خود را اضافه كنيد",
"categories": "دسته بندی ها",
"choose_language": "انتخاب زبان",
"contact": null,
"contributors_description": null,
"contributors_title": null,
"education_description": "باهوش تر شوید و مهارت هایتان را بیافزایید",
"education_title": "تحصیلات",
"email_hint": null,
"employment_description": "با دیگران ارتباط برقرار کنید،تا کارآموزی ويا شغل ثابت بگیرید",
"employment_title": "استخدام",
"follow_us": null,
Expand All @@ -92,12 +105,17 @@ $translateProvider.translations("fa", {
"language_title": "زبان",
"media-and-communication_description": "از زندگی وتجربیات دیگران الهام بگیرید",
"media-and-communication_title": "رسانه و ارتباطات",
"refugee_tech_info": "نهج حصلت على أي أفكار التطبيق المباشر لهم RT إذا المطور يريد تحميل التطبيق .",
"newsletter_description": null,
"newsletter_title": null,
"newsletter_registration_info": null,
"newsletter_registration_exist": null,
"refugee_tech_info": "ما پلى هستيم بين بخش هاى مختلف جامعه تا به وسيله ى تكنولوژى و راه حل هاى سازمان يافته، توانايى هاى مهاجران را شكوفا كنيم.",
"setelin_description": "ستلین در یک هکتن با مدیریت رفیوجی تک و همکاری اداره ی مهاجرت و استکهلم تک شکل گرفت. این محفل پروژه هایی که هدف کمک کردن به مسائل اجتماعی دارند را دور هم جمع کرد.\nرفیوجی تک مسؤلیت توسعه وتکمیل کردن پلتفرم ستلین را ، با یاری داوطلبان و همکاران دیگر، به عهده گرفت.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "دوستان جدید بیابید و با مردمان جدید آشنا شوید",
"social_title": "اجتماعي",
"subscribe_label": null,
"visit_us": null
});

Expand All @@ -111,6 +129,7 @@ $translateProvider.translations("sv", {
"contributors_title": "volontärer",
"education_description": "Bli mer skicklig, utveckla nya kompetenser och fortsätt växa",
"education_title": "utbildning",
"email_hint": null,
"employment_description": "Börja nätverka, få ett internship, ett jobb eller starta eget företag",
"employment_title": "jobb",
"follow_us": "följ oss",
Expand All @@ -126,12 +145,17 @@ $translateProvider.translations("sv", {
"language_title": "språk",
"media-and-communication_description": "Bli inspirerad och ta lärdom från andra människors liv och erfarenheter",
"media-and-communication_title": "media & kommunikation",
"newsletter_description": null,
"newsletter_title": "nyhetsbrev",
"newsletter_registration_info": null,
"newsletter_registration_exist": null,
"refugee_tech_info": "Vi möjligör samarbete mellan alla delar av samhället med målet att tillvarata potentialen hos nyanlända genom effektivt designade och utvecklade lösningar",
"setelin_description": "Setelin är resultatet från ett hackathon organiserat av Refugee Tech tillsammans med Migrationsverket och STHLM TECH.\nRefugee Tech tog på sig att vidareutveckla plattformen tillsammans med voluntärer.",
"setelin_footer": null,
"setelin_header": null,
"social_description": "Vänner gör oss till dem vi är, hitta nya vänner och skapa nya bekantskaper",
"social_title": "socialt",
"subscribe_label": null,
"visit_us": "besök oss"
});
}]);
73 changes: 67 additions & 6 deletions www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,73 @@ angular.module('starter.controllers', [])
$scope.closeapp()
}

$ionicModal.fromTemplateUrl('templates/newsletter.html', {
scope: $scope
}).then(function(modal) {
$scope.newsletterModal = modal
})

// Triggered in the about modal to close it
$scope.closeNewsletter = function() {
$scope.newsletterModal.hide()
}

// Open the about aboutModal
$scope.showNewsletter = function() {
$scope.newsletterModal.show()
}

// Call email registration
$scope.newsletterEmail = null;
// by default hide info message
$scope.showInfo = "ng-hide"
$scope.messageInfo = "newsletter_registration_info"

$scope.registerEmail = function(email) {

API.registerEmail(email).$promise.then(function(res) {
//console.log(res);
if(res.status === "exists"){
$scope.messageInfo = "newsletter_registration_exist"
} else if(res.status === "success") {
$scope.messageInfo = "newsletter_registration_info"
}

$scope.hideForm = "ng-hide"
$scope.showInfo = "ng-show"
})

}


// Email validation
/*$scope.validEmail = function(email){
console.log("newsletterEmail="+email)
var valid = angular.element($scope.binding('mailForm.input.$valid'))
var text = angular.element($scope.binding('newsletterEmail'))
var input = angular.element(email)

it('should init to model', function(){
expect(email).toContain('[email protected]')
expect(valid.getText()).toContain('true')
})

it('should be invalid if empty', function(){
input.clear()
input.sendKeys('')
expect(text.getText()).toEqual('text=')
expect(valid.getText()).toContain('false')
})

it('should be invalid if not email', function(){
input.clear()
input.sendKeys('xxx')
expect(valid.getText()).toContain('false')
})

}*/


$ionicModal.fromTemplateUrl('templates/about.html', {
scope: $scope
}).then(function(modal) {
Expand All @@ -169,12 +236,6 @@ angular.module('starter.controllers', [])
$scope.aboutModal.show()
}

// Perform the about action when the user submits the app form
$scope.doapp = function() {
$scope.closeapp()
}


/* Begin Favorite functions */

$scope.toggleFavorites = function() {
Expand Down
14 changes: 14 additions & 0 deletions www/js/controllers.js.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff a/www/js/controllers.js b/www/js/controllers.js (rejected hunks)
@@ -169,6 +169,12 @@
$scope.newsletterModal.show()
}

+ $scope.newsletterEmail = null;
+ $scope.registerEmail = function(email) {
+ console.log(email);
+ API.registerEmail(email)
+ }
+
$ionicModal.fromTemplateUrl('templates/about.html', {
scope: $scope
}).then(function(modal) {
9 changes: 8 additions & 1 deletion www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,20 @@
downv.get({id: projectId})
}

//for newsletter
var newsletter = $resource('https://refugeetech-projecthub-cms.meteorapp.com/api/v02/newsletter/:email', {email: '@email'})
Copy link
Member

Choose a reason for hiding this comment

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

Will need to implement and try this out with the backend before merging.

var registerEmail = function (mail) {
return newsletter.get({email: mail})
}

return {
favoriteStore: favoriteStore,
categories: getCategories,
projects: getProjects,
projectById: getProjectById,
upVote: upVote,
downVote: downVote
downVote: downVote,
registerEmail: registerEmail
}

}
Expand Down
Loading