#236 Adding Contact Info widget, for Issue #162.
Closed by sayanchowdhury. Opened by devyani7.
devyani7/fedora-hubs feature/fas_info  into  develop

Download 236.patch

Noting down the discussion that we had on IRC with @puiterwijk and @skrzepto :

User A cannot query User B's fas-info, not available in fas2. Since in fas2, one would need to have
a valid username and password. fas3 should accept Ipsilon-issued tokens.
So, to not keep the privacy-sensitive info in multiple places, we can query fas3 soon for the same.

This PR is for flock purpose and will update it once fas3 is up.
Updated Image : http://img.susepaste.org/33617981

I'm not sure this section is true anymore, was there a reason to add it?

@pingou an old commit from local develop, an overlook. rectifying :)

2 new commits added

  • Merge branch 'feature/fas_info' of ssh://pagure.io/forks/devyani7/fedora-hubs into feature/fas_info
  • Adding the Contact info widget as requested in Issue #162

1 new commit added

  • Resolving conflicts

why was this modified? just curious.

1 new commit added

  • Changing contact widget's position as shown in the mockup.

@skrzepto the latest screenshot : http://img.susepaste.org/81373805
thanks :)

Could we get the grey background to match the mock?

Other than the grey background ^ this looks good to me. Note that the history will probably need to be cleaned up (http://i.imgur.com/1NUYayU.png) since we try to keep linear history, i.e. no merges/merge commits, on this.

rebased

rebased

Does this not need an @argument decorator for username? e.g.

@argument(name="username",
      default=None,
      validator=validators.username,
      help="A FAS username.")

Shouldn't the username be extracting from the hub itself?

Just a summary of the discussion in #fedora-hubs:

  • data should get the username from the hub, not from the arguments passed to the widget.

  • From there, it would be best to handle user and not user hubs separately in data similar to how the membership widget does.

  • The data would be passed to the template which will present the user data you have now for users and whatever data is appropriate for a team (mailing list, irc channel?)

rebased

rebased

do we really want to call the widget fas_info?

Can we drop the : in Current-Time, also remove the period to colon and maybe remove the space in UTC and -4. Here's an example of what I was thinking

Current-Time  20:15(UTC-4)

Also, not fan of the gray box inside a white box :( I'd say we should just drop the style section in fas_info.html

also as mentioned in IRC

we need to modify the key timezone to be just UTC-4 and also add a new key named current_time: datetime.datetime.utcnow()

We may want to have the current time update in realtime in JS.

add a new key named current_time: datetime.datetime.utcnow()

Well, I think the idea was that this would include the time it is for that user, so if you are UTC-4, it would show the time it is in UTC-4, not in UTC itself.

We may want to have the current time update in realtime in JS.

+1 on that :)

Well, I think the idea was that this would include the time it is for that user, so if you are UTC-4,
it would show the time it is in UTC-4, not in UTC itself.

+1 we may not need the current_time in the dict if we could pass the timezone info to a js lib which will handle the time for us.

rebased

rebased

rebased

@devyani7 is this ready for another round of review?

fas3 won't provide this :/ we need to get the time from UTC-4 or UTC+6 etc...

+1. Maybe contact

Why not use True/False for usergroup?

Why do you need to get the hub again (using the name of the hub you have)? You should be able to use the hub from L19

You don't need these parens

The variable names should be consistent in this file. Some use snake_case others are full words with no underscore or camelcase, others a letters in front of words. (What does ghub mean? I had to think before realizing it was group hub). I realize this is pretty minor but it makes a difference in readability.

If you change usergroup to a bool like above you can just do {% if usergroup %}

@atelic +1

Like skrzepto mentioned, we will need to get the UTC offset from FAS3. Then we can pass that to something like

    function calcTime(offset) {
  // create Date object for current location
  var d = new Date();
  // convert to msec
  // add local time zone offset
  // get UTC time in msec
  var utc = d.getTime() + (d.getTimezoneOffset() * 60000);
  // create new Date object using supplied offset
  var nd = new Date(utc + (3600000 * offset));
  // return time as a string
  return nd.toLocaleString();
};
setInterval(function(), {
  $('#time').html(calcTime("{{timezone}}"))
}, 1000 * 60)

Don't forget to remove the console.logs

@devyani7 pass finished! :penguin:

2 new commits added

  • Adding Contact widget after renaming
  • Removing fas_info files

1 new commit added

  • Adding contact widget for group pages

These variables (d, utc, and nd) should be declared with var otherwise they'll be declared in the global scope rather than the function scope.

Pasting from the previous review

The variable names should be consistent in this file. Some use snake_case others are full words with no underscore or camelcase, others a letters in front of words. (What does ghub mean? I had to think before realizing it was group hub). I realize this is pretty minor but it makes a difference in readability.

account_age implies a range of time but the value is a single date. maybe change this to creation_date?

dont hardcode the offset here

This has been merged via #255

Pull-Request has been closed by sayanchowdhury

Metadata