TZM / tzm-blade

ZMGC Application empowers members with on-line tools, by providing a free infrastructure to easily exchange, analyse and disseminate information in a scalable, non-blocking manner using only Open Source software build by the community for the community. It is about building lasting and deep solidarity versus cheap and fast Facebook or Twitter campaigns
www.zmgc.net
GNU General Public License v3.0
4 stars 8 forks source link

i18n localization and onclick state behavior added to user list #53

Closed ofShard closed 10 years ago

ofShard commented 10 years ago

41

Also lazy loading.

nkhine commented 10 years ago

couple of issues commit with this:

ofShard commented 10 years ago

Regarding the user-list.js error, I see it. I'll make a pull request later.

  1. Please clarify. In my tests, all users are displayed without any problems.
  2. Are you referring to new user registration? Or the "Add New User" button?
  3. This is intentional, not a bug. local is not a valid provider until the user has first successfully set their password. This also provides a very easy way to see if an account is finished setting up.
  4. Agreed. The error message should be displayed rather than discarded.
nkhine commented 10 years ago

here is my db:

> db.users.find().pretty()
{
    "tokenExpires" : 1392300815979,
    "tokenString" : "O1fXh4VQ8_UqXVAByvQ-eZE2r9PSi4VmD5gAqwopT4rGXj9tfx2FEKtPK3EGH_Uy",
    "email" : "norman@khine.net",
    "_id" : ObjectId("52fb818fabf72e39a64c6eeb"),
    "provider" : [
        "google"
    ],
    "lockUntil" : 0,
    "loginAttempts" : 0,
    "groups" : "member",
    "surname" : "Khine",
    "name" : "Norman",
    "active" : true,
    "password" : "$2a$10$1tZMS/nHdPn6mrFgjkLy3.kEKVdwYSbJG3sK6cBteBatYkUr283yS",
    "__v" : 0
}
{
    "tokenExpires" : 1392300865079,
    "tokenString" : "O4usJngV7Ehi-LlVAAn_Q97pE4MisEMvRDuv7yCmvJu2ayPfsdjWK5RLnjli1DU7",
    "awaitConfirm" : true,
    "email" : "norman.khine@gmail.com",
    "_id" : ObjectId("52fb81c0abf72e39a64c6eec"),
    "provider" : [ ],
    "lockUntil" : 0,
    "loginAttempts" : 0,
    "groups" : "admin",
    "surname" : "Khine",
    "name" : "Norman",
    "active" : false,
    "password" : "$2a$10$YvKXqXRT.Q/Yt.yvHx49keA3KY1KJRGhusXdD9E9XRv/i9Kn9.Zge",
    "__v" : 0
}
{
    "tokenExpires" : 1392301140974,
    "tokenString" : "J4PhEICyIC-RWYHQbDeYa5i_zy1rXAz73XNyOQ7Ezc1LT8Es6RdLKIVz02W_hKLK",
    "awaitConfirm" : true,
    "email" : "norman@x11.us",
    "_id" : ObjectId("52fb82d4abf72e39a64c6eee"),
    "provider" : [ ],
    "lockUntil" : 0,
    "loginAttempts" : 0,
    "groups" : "guest",
    "surname" : "Khine",
    "name" : "Norman",
    "active" : false,
    "password" : "$2a$10$OiIbYr4tRPHcTl9EyScSm.IDK9hfdENVl/Oa50YUjC6mx.MbKSulu",
    "__v" : 0
}
>

there are 3 users but on the interface there are no users:

screen shot 2014-02-12 at 20 22 14

also, i can access http://localhost:3000/user/list without being authenticated and on heroku i get an application error: http://www.zmgc.net/user/list

  1. Yes I am referring to the "Add New User" button - the required functionality was that when an Admin user adds a new user via the user admin interface an email is sent for the user to verify their email and then they can set their password.

Currently, I can add a new user, but then how do I login? The only way to do it is by checking the 'don't have password or forgot password' in the login form!

  1. OK agreed, but then we need for 2. to send an email when an admin user adds a new user.
nkhine commented 10 years ago

tailing the heroku logs i get this and then visiting http://www.zmgc.net/user/list:

☺  heroku logs -t 
2014-02-12T20:21:02.942346+00:00 app[web.1]:   at /app/node_modules/blade/lib/blade.js:100:3
2014-02-12T20:21:03.121518+00:00 app[web.1]: req.session._csrf is deprecated, use req.csrfToken() instead
2014-02-12T20:21:05.212108+00:00 app[web.1]: [Function]
2014-02-12T20:21:05.212771+00:00 app[web.1]: list undefined
2014-02-12T20:21:05.300331+00:00 app[web.1]: module.js:340
2014-02-12T20:21:05.323878+00:00 app[web.1]:     throw err;
2014-02-12T20:21:05.299494+00:00 app[web.1]:
2014-02-12T20:21:05.325691+00:00 app[web.1]:     ^
2014-02-12T20:21:05.579265+00:00 app[web.1]: Error: Cannot find module './listHelper'
2014-02-12T20:21:05.731242+00:00 app[web.1]: worker 16 died
2014-02-12T20:21:05.696834+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path=/user/list host=www.zmgc.net request_id=f4741728-85c9-4cf0-a1dd-ddb802323e6d fwd="94.196.125.53" dyno=web.1 connect=9ms service=2625ms status=503 bytes=0
2014-02-12T20:21:02.947500+00:00 heroku[router]: at=info method=GET path=/css/main-da0a081e36c95feacdda29bec366a11e.css host=zmgc.net request_id=2a26dad9-b71d-4843-b267-9e4b6e31a24a fwd="66.249.73.191" dyno=web.1 connect=1ms service=58ms status=500 bytes=21
2014-02-12T20:21:15.867674+00:00 heroku[router]: at=info method=GET path=/css/main-3d22d82a8c1619e2fbbdeb155cc2437b.css host=zmgc.net request_id=29f76fd9-1899-4443-bfac-2c66ffd6f45d fwd="66.249.73.191" dyno=web.1 connect=3ms service=8ms status=200 bytes=3645
2014-02-12T20:21:22.831905+00:00 app[web.1]: Getting chapter cards...
2014-02-12T20:21:22.993628+00:00 app[web.1]: nothing to to update
2014-02-12T20:21:42.853979+00:00 app[web.1]: Getting chapter cards...
2014-02-12T20:21:42.983734+00:00 app[web.1]: nothing to to update
ofShard commented 10 years ago

Concerning the authentication thing, please check your very own commit: https://github.com/TZM/tzm-blade/commit/9301799153d635e9489a060dfb45daf8ae008c38#diff-2 I will reverse your commit if you'd like.

I didn't make "Add New User" send an email automatically in case you make a typo. You can send the email manually by any of the other mail-sending features of the User List. If you prefer, I will make it send the email on "Add New User" immediately.

As for the zmgc.net error, it seems to be physically missing a file that should exist. The file in question is /app/controllers/listHelper.js and it does exist in the tzm-blade repo so there's no commit errors I'm aware of. Try re-installing the zmgc.net heroku app.

nkhine commented 10 years ago
  1. we need to then ensure we have an admin user when we first run the application.
  2. it would mean that there will be two actions required by the admin user a) add the user b) click to send an email - i prefer to send the email as soon as the record has been added to the database.
  3. ok i will check
nkhine commented 10 years ago

ok 3. is fixed, you had ./listHelper and it should be ./listhelper 96aeec854e17b15d0d24ce004d2452a3671e09fe

can you update this to coffeescript as you initially added it as .js and move it to utils directory