From b25a6219d627198972f1bf5ccc4254d7c7ba02c0 Mon Sep 17 00:00:00 2001 From: dcsan Date: Sat, 27 Sep 2014 23:05:36 -0700 Subject: [PATCH 1/5] localise to japanese add simple form qualification --- client/t9n/japanese.coffee | 43 +++++++++++++ package.js | 10 ++- versions.json | 124 +++++++++++++++++++++++-------------- 3 files changed, 126 insertions(+), 51 deletions(-) create mode 100644 client/t9n/japanese.coffee diff --git a/client/t9n/japanese.coffee b/client/t9n/japanese.coffee new file mode 100644 index 00000000..7b68eb64 --- /dev/null +++ b/client/t9n/japanese.coffee @@ -0,0 +1,43 @@ +ja = + signIn: "ログイン" + signin: "ログイン" + signOut: "ログアウト" + signUp: "登録" + OR: "OR" + forgotPassword: "パスワード忘れた?" + emailAddress: "メールアドレス" + emailResetLink: "メールリセット" + dontHaveAnAccount: "まだ登録していない?" + resetYourPassword: "パスワードリセット" + updateYourPassword: "パスワード更新" + password: "パスワード" + usernameOrEmail: "ユーザー名前かメールアドレス" + email: "メールアドレス" + ifYouAlreadyHaveAnAccount: "既に登録している方" + signUpWithYourEmailAddress: "メールアドレスで登録する" + username: "ユーザー名" + optional: "随意" + signupCode: "登録コード" + clickAgree: "登録をクリックすると、規約に同意する" + privacyPolicy: "プライバシー規約" + terms: "利用契約" + sign: "サイン" + configure: "設定" + with: "と" + createAccount: "新規登録" + and: "と" + "Match failed": "Match failed" + "User not found": "ユーザーが見つからない" + + error: + minChar: "7文字が必要" + pwOneLetter: "アルファベット文字が必要" + pwOneDigit: "パスワードに数字が必要" + usernameRequired: "ユーザー名が必要" + emailRequired: "めーるアドレスが必要" + signupCodeRequired: "登録コードが必要." + signupCodeIncorrect: "登録コードの誤りがあるようです" + signInRequired: "ログインが必要" + usernameIsEmail: "ユーザー名ではメアドレスは使えない" + +T9n.map "ja", ja diff --git a/package.js b/package.js index 1a32f028..5faf7814 100644 --- a/package.js +++ b/package.js @@ -1,12 +1,15 @@ Package.describe({ summary: "Make signin and signout their own pages with routes.", version: '0.9.0', - git: 'https://github.com/Differential/accounts-entry' + git: 'https://github.com/dcsan/accounts-entry', + name: "dcsan:accounts-entry" }); Package.onUse(function(api) { api.versionsFrom("METEOR@0.9.0"); + console.log('- onUse: accounts-entry ') + // CLIENT api.use([ 'deps', @@ -17,7 +20,7 @@ Package.onUse(function(api) { 'handlebars', 'session', 'coffeescript', - 'simple-form', + 'joshowens:simple-form', 'less', 'sha'] , 'client'); @@ -55,7 +58,8 @@ Package.onUse(function(api) { 'client/t9n/portuguese.coffee', 'client/t9n/slovene.coffee', 'client/t9n/russian.coffee', - 'client/t9n/arabic.coffee' + 'client/t9n/arabic.coffee', + 'client/t9n/japanese.coffee' ], 'client'); // SERVER diff --git a/versions.json b/versions.json index ce24090b..1b666038 100644 --- a/versions.json +++ b/versions.json @@ -2,18 +2,18 @@ "dependencies": [ [ "accounts-base", - "1.0.0" + "1.1.1" ], [ "accounts-password", - "1.0.0" + "1.0.2" ], [ - "accounts-t9n", - "0.0.0" + "application-configuration", + "1.0.2" ], [ - "application-configuration", + "base64", "1.0.0" ], [ @@ -22,14 +22,14 @@ ], [ "blaze", - "1.0.2" + "2.0.1" ], [ - "blaze-layout", - "0.0.0" + "blaze-tools", + "1.0.0" ], [ - "blaze-tools", + "boilerplate-generator", "1.0.0" ], [ @@ -38,27 +38,31 @@ ], [ "check", - "1.0.0" + "1.0.1" ], [ "coffeescript", - "1.0.2" + "1.0.3" + ], + [ + "ddp", + "1.0.9" ], [ "deps", - "1.0.0" + "1.0.4" ], [ "ejson", - "1.0.0" + "1.0.3" ], [ "email", - "1.0.2" + "1.0.3" ], [ "follower-livedata", - "1.0.0" + "1.0.1" ], [ "geojson-utils", @@ -70,19 +74,35 @@ ], [ "html-tools", - "1.0.0" + "1.0.1" ], [ "htmljs", - "1.0.0" + "1.0.1" ], [ "id-map", "1.0.0" ], [ - "iron-router", - "0.0.0" + "iron:core", + "0.3.4" + ], + [ + "iron:dynamic-template", + "0.4.1" + ], + [ + "iron:layout", + "0.4.1" + ], + [ + "iron:router", + "0.9.3" + ], + [ + "joshowens:simple-form", + "0.1.8" ], [ "jquery", @@ -94,11 +114,7 @@ ], [ "less", - "1.0.4" - ], - [ - "livedata", - "1.0.4" + "1.0.9" ], [ "localstorage", @@ -106,23 +122,31 @@ ], [ "logging", - "1.0.2" + "1.0.3" ], [ "meteor", - "1.0.2" + "1.1.1" ], [ "minifiers", - "1.0.2" + "1.1.0" ], [ "minimongo", - "1.0.1" + "1.0.3" ], [ - "mongo-livedata", - "1.0.2" + "mongo", + "1.0.6" + ], + [ + "mrt:accounts-t9n", + "0.0.13" + ], + [ + "mrt:underscore-string-latest", + "2.3.3" ], [ "npm-bcrypt", @@ -130,7 +154,7 @@ ], [ "observe-sequence", - "1.0.1" + "1.0.2" ], [ "ordered-dict", @@ -142,7 +166,11 @@ ], [ "reactive-dict", - "1.0.0" + "1.0.3" + ], + [ + "reactive-var", + "1.0.2" ], [ "retry", @@ -150,31 +178,27 @@ ], [ "routepolicy", - "1.0.0" + "1.0.1" ], [ "service-configuration", - "1.0.0" + "1.0.1" ], [ "session", - "1.0.0" + "1.0.2" ], [ "sha", "1.0.0" ], - [ - "simple-form", - "0.0.0" - ], [ "spacebars", - "1.0.0" + "1.0.2" ], [ "spacebars-compiler", - "1.0.1" + "1.0.2" ], [ "srp", @@ -182,26 +206,30 @@ ], [ "templating", - "1.0.4" + "1.0.7" + ], + [ + "tracker", + "1.0.2" ], [ "ui", - "1.0.0" + "1.0.3" ], [ "underscore", "1.0.0" ], [ - "underscore-string-latest", - "0.0.0" + "webapp", + "1.1.2" ], [ - "webapp", - "1.0.2" + "webapp-hashing", + "1.0.0" ] ], "pluginDependencies": [], - "toolVersion": "meteor-tool@1.0.12", + "toolVersion": "meteor-tool@1.0.32", "format": "1.0" } \ No newline at end of file From b20faf54dfc86a3f1575f8d0473f802abbbf527d Mon Sep 17 00:00:00 2001 From: dcsan Date: Sat, 27 Sep 2014 23:09:24 -0700 Subject: [PATCH 2/5] revert to joshowens: namespace --- package.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package.js b/package.js index 5faf7814..d3df0ccf 100644 --- a/package.js +++ b/package.js @@ -1,14 +1,17 @@ Package.describe({ summary: "Make signin and signout their own pages with routes.", version: '0.9.0', - git: 'https://github.com/dcsan/accounts-entry', - name: "dcsan:accounts-entry" + git: 'https://github.com/Differential/accounts-entry', + name: "joshowens:accounts-entry" + + // git: 'https://github.com/dcsan/accounts-entry', + // name: "dcsan:accounts-entry" }); Package.onUse(function(api) { api.versionsFrom("METEOR@0.9.0"); - console.log('- onUse: accounts-entry ') + // console.log('- onUse: accounts-entry ') // CLIENT api.use([ From 90efc4cd96a20fca2180bdba690ed8d929717142 Mon Sep 17 00:00:00 2001 From: dcsan Date: Sat, 27 Sep 2014 23:44:59 -0700 Subject: [PATCH 3/5] add logo --- client/entry.coffee | 1 + package.js | 10 +++++----- versions.json | 8 -------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/client/entry.coffee b/client/entry.coffee index 8da0e5f3..d5788abb 100644 --- a/client/entry.coffee +++ b/client/entry.coffee @@ -1,5 +1,6 @@ AccountsEntry = settings: + logo: "/images/ux/logo/logo.png" wrapLinks: true homeRoute: '/home' dashboardRoute: '/dashboard' diff --git a/package.js b/package.js index d3df0ccf..c5dd2623 100644 --- a/package.js +++ b/package.js @@ -1,11 +1,11 @@ Package.describe({ summary: "Make signin and signout their own pages with routes.", version: '0.9.0', - git: 'https://github.com/Differential/accounts-entry', - name: "joshowens:accounts-entry" + // git: 'https://github.com/Differential/accounts-entry', + // name: "joshowens:accounts-entry" - // git: 'https://github.com/dcsan/accounts-entry', - // name: "dcsan:accounts-entry" + git: 'https://github.com/dcsan/accounts-entry', + name: "dcsan:accounts-entry" }); Package.onUse(function(api) { @@ -23,7 +23,7 @@ Package.onUse(function(api) { 'handlebars', 'session', 'coffeescript', - 'joshowens:simple-form', + // 'joshowens:simple-form', 'less', 'sha'] , 'client'); diff --git a/versions.json b/versions.json index 1b666038..924e6cae 100644 --- a/versions.json +++ b/versions.json @@ -100,10 +100,6 @@ "iron:router", "0.9.3" ], - [ - "joshowens:simple-form", - "0.1.8" - ], [ "jquery", "1.0.0" @@ -144,10 +140,6 @@ "mrt:accounts-t9n", "0.0.13" ], - [ - "mrt:underscore-string-latest", - "2.3.3" - ], [ "npm-bcrypt", "0.7.7" From b39d88eaef4aee3036b3117a55aeffe17332cdf8 Mon Sep 17 00:00:00 2001 From: dcsan Date: Sun, 28 Sep 2014 00:25:21 -0700 Subject: [PATCH 4/5] make router client side only --- client/entry.coffee | 1 + client/t9n/japanese.coffee | 2 +- shared/router.coffee | 177 +++++++++++++++++++------------------ 3 files changed, 93 insertions(+), 87 deletions(-) diff --git a/client/entry.coffee b/client/entry.coffee index d5788abb..022f7870 100644 --- a/client/entry.coffee +++ b/client/entry.coffee @@ -10,6 +10,7 @@ AccountsEntry = entrySignUp: '/sign-up' extraSignUpFields: [] showOtherLoginServices: true + language: "en" isStringEmail: (email) -> emailPattern = /^([\w.-]+)@([\w.-]+)\.([a-zA-Z.]{2,6})$/i diff --git a/client/t9n/japanese.coffee b/client/t9n/japanese.coffee index 7b68eb64..982f9505 100644 --- a/client/t9n/japanese.coffee +++ b/client/t9n/japanese.coffee @@ -23,7 +23,7 @@ ja = terms: "利用契約" sign: "サイン" configure: "設定" - with: "と" + with: ":" createAccount: "新規登録" and: "と" "Match failed": "Match failed" diff --git a/shared/router.coffee b/shared/router.coffee index e4db4d3f..93769275 100644 --- a/shared/router.coffee +++ b/shared/router.coffee @@ -1,86 +1,91 @@ -Router.map -> - - @route "entrySignIn", - path: "/sign-in" - onBeforeAction: -> - Session.set('entryError', undefined) - Session.set('buttonText', 'in') - onRun: -> - if Meteor.userId() - Router.go AccountsEntry.settings.dashboardRoute - - if AccountsEntry.settings.signInTemplate - @template = AccountsEntry.settings.signInTemplate - - # If the user has a custom template, and not using the helper, then - # maintain the package Javascript so that OpenGraph tags and share - # buttons still work. - pkgRendered= Template.entrySignIn.rendered - userRendered = Template[@template].rendered - - if userRendered - Template[@template].rendered = -> - pkgRendered.call(@) - userRendered.call(@) - else - Template[@template].rendered = pkgRendered - - Template[@template].events(AccountsEntry.entrySignInEvents) - Template[@template].helpers(AccountsEntry.entrySignInHelpers) - - - @route "entrySignUp", - path: "/sign-up" - onBeforeAction: -> - Session.set('entryError', undefined) - Session.set('buttonText', 'up') - onRun: -> - if AccountsEntry.settings.signUpTemplate - @template = AccountsEntry.settings.signUpTemplate - - # If the user has a custom template, and not using the helper, then - # maintain the package Javascript so that OpenGraph tags and share - # buttons still work. - pkgRendered= Template.entrySignUp.rendered - userRendered = Template[@template].rendered - - if userRendered - Template[@template].rendered = -> - pkgRendered.call(@) - userRendered.call(@) - else - Template[@template].rendered = pkgRendered - - Template[@template].events(AccountsEntry.entrySignUpEvents) - Template[@template].helpers(AccountsEntry.entrySignUpHelpers) - - - @route "entryForgotPassword", - path: "/forgot-password" - onBeforeAction: -> - Session.set('entryError', undefined) - - @route 'entrySignOut', - path: '/sign-out' - onBeforeAction: (pause)-> - Session.set('entryError', undefined) - if AccountsEntry.settings.homeRoute - Meteor.logout () -> - Router.go AccountsEntry.settings.homeRoute - pause() - - @route 'entryResetPassword', - path: 'reset-password/:resetToken' - onBeforeAction: -> - Session.set('entryError', undefined) - Session.set('resetToken', @params.resetToken) - -# Get all the accounts-entry routes one time -exclusions = []; -_.each Router.routes, (route)-> - exclusions.push route.name -# Change the fromWhere session variable when you leave a path -Router.onStop -> - # If the route is an entry route, no need to save it - if (!_.contains(exclusions, Router.current().route.name)) - Session.set('fromWhere', Router.current().path) +if Meteor.isClient # don't break server routes with @current + + # Get all the accounts-entry routes one time + exclusions = []; + _.each Router.routes, (route)-> + exclusions.push route.name + # Change the fromWhere session variable when you leave a path + + Router.onStop -> + # If the route is an entry route, no need to save it + if (!_.contains(exclusions, Router.current().route.name)) + Session.set('fromWhere', Router.current().path) + + Router.map -> + + @route "entrySignIn", + path: "/sign-in" + onBeforeAction: -> + Session.set('entryError', undefined) + Session.set('buttonText', 'in') + onRun: -> + if Meteor.userId() + Router.go AccountsEntry.settings.dashboardRoute + + if AccountsEntry.settings.signInTemplate + @template = AccountsEntry.settings.signInTemplate + + # If the user has a custom template, and not using the helper, then + # maintain the package Javascript so that OpenGraph tags and share + # buttons still work. + pkgRendered= Template.entrySignIn.rendered + userRendered = Template[@template].rendered + + if userRendered + Template[@template].rendered = -> + pkgRendered.call(@) + userRendered.call(@) + else + Template[@template].rendered = pkgRendered + + Template[@template].events(AccountsEntry.entrySignInEvents) + Template[@template].helpers(AccountsEntry.entrySignInHelpers) + + + @route "entrySignUp", + path: "/sign-up" + onBeforeAction: -> + Session.set('entryError', undefined) + Session.set('buttonText', 'up') + onRun: -> + if AccountsEntry.settings.signUpTemplate + @template = AccountsEntry.settings.signUpTemplate + + # If the user has a custom template, and not using the helper, then + # maintain the package Javascript so that OpenGraph tags and share + # buttons still work. + pkgRendered= Template.entrySignUp.rendered + userRendered = Template[@template].rendered + + if userRendered + Template[@template].rendered = -> + pkgRendered.call(@) + userRendered.call(@) + else + Template[@template].rendered = pkgRendered + + Template[@template].events(AccountsEntry.entrySignUpEvents) + Template[@template].helpers(AccountsEntry.entrySignUpHelpers) + + + @route "entryForgotPassword", + path: "/forgot-password" + onBeforeAction: -> + Session.set('entryError', undefined) + + @route 'entrySignOut', + path: '/sign-out' + onBeforeAction: (pause)-> + Session.set('entryError', undefined) + if AccountsEntry.settings.homeRoute + Meteor.logout () -> + Router.go AccountsEntry.settings.homeRoute + pause() + + @route 'entryResetPassword', + path: 'reset-password/:resetToken' + onBeforeAction: -> + Session.set('entryError', undefined) + Session.set('resetToken', @params.resetToken) + + From 98c29bccfa2fb076c73f6272a1f019f84f75bbd3 Mon Sep 17 00:00:00 2001 From: dcsan Date: Mon, 29 Sep 2014 16:36:51 -0700 Subject: [PATCH 5/5] refactor merge config settings --- client/entry.coffee | 15 +++++++++++++++ package.js | 2 ++ server/entry.coffee | 13 +++++++++---- versions.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 4 deletions(-) diff --git a/client/entry.coffee b/client/entry.coffee index 022f7870..d4287680 100644 --- a/client/entry.coffee +++ b/client/entry.coffee @@ -1,3 +1,18 @@ +Meteor.startup -> + + ##FIXME - clashes with app config + ## also we have config in client and server files + + # Accounts.ui.config + # passwordSignupFields: 'EMAIL_ONLY' + + AccountsEntry.config + homeRoute: '/' + dashboardRoute: '/dashboard' + language: 'en' + showSignupCode: false + + AccountsEntry = settings: logo: "/images/ux/logo/logo.png" diff --git a/package.js b/package.js index c5dd2623..c869a73a 100644 --- a/package.js +++ b/package.js @@ -79,6 +79,8 @@ Package.onUse(function(api) { // CLIENT and SERVER api.imply('accounts-base', ['client', 'server']); + api.imply('accounts-twitter', ['client', 'server']); + api.imply('accounts-facebook', ['client', 'server']); api.imply('accounts-password', ['client', 'server']); api.export('AccountsEntry', ['client', 'server']); api.use(['iron:router', 'mrt:accounts-t9n'], ['client', 'server']); diff --git a/server/entry.coffee b/server/entry.coffee index fd467daf..9a0cfae1 100644 --- a/server/entry.coffee +++ b/server/entry.coffee @@ -1,15 +1,19 @@ Meteor.startup -> - Accounts.urls.resetPassword = (token) -> - Meteor.absoluteUrl('reset-password/' + token) - AccountsEntry = settings: {} - config: (appConfig) -> @settings = _.extend(@settings, appConfig) @AccountsEntry = AccountsEntry + # if Meteor.isServer + # AccountsEntry.config + # signupCode: null + + Accounts.urls.resetPassword = (token) -> + Meteor.absoluteUrl('reset-password/' + token) + + Meteor.methods entryValidateSignupCode: (signupCode) -> check signupCode, Match.OneOf(String, null, undefined) @@ -29,5 +33,6 @@ Meteor.startup -> email: user.email password: user.password profile: _.extend(profile, user.profile) + if (user.email && Accounts._options.sendVerificationEmail) Accounts.sendVerificationEmail(userId, user.email) diff --git a/versions.json b/versions.json index 924e6cae..ded5d174 100644 --- a/versions.json +++ b/versions.json @@ -4,10 +4,22 @@ "accounts-base", "1.1.1" ], + [ + "accounts-facebook", + "1.0.1" + ], + [ + "accounts-oauth", + "1.1.1" + ], [ "accounts-password", "1.0.2" ], + [ + "accounts-twitter", + "1.0.1" + ], [ "application-configuration", "1.0.2" @@ -60,6 +72,10 @@ "email", "1.0.3" ], + [ + "facebook", + "1.1.0" + ], [ "follower-livedata", "1.0.1" @@ -80,6 +96,10 @@ "htmljs", "1.0.1" ], + [ + "http", + "1.0.6" + ], [ "id-map", "1.0.0" @@ -144,6 +164,18 @@ "npm-bcrypt", "0.7.7" ], + [ + "oauth", + "1.1.0" + ], + [ + "oauth1", + "1.1.0" + ], + [ + "oauth2", + "1.1.0" + ], [ "observe-sequence", "1.0.2" @@ -164,6 +196,10 @@ "reactive-var", "1.0.2" ], + [ + "reload", + "1.1.0" + ], [ "retry", "1.0.0" @@ -204,6 +240,10 @@ "tracker", "1.0.2" ], + [ + "twitter", + "1.1.0" + ], [ "ui", "1.0.3" @@ -212,6 +252,10 @@ "underscore", "1.0.0" ], + [ + "url", + "1.0.0" + ], [ "webapp", "1.1.2"