FirehoseCommunity / DEFCON

6 stars 4 forks source link

Additional Details should be shown on the posts#index page #136

Open kenmazaika opened 8 years ago

kenmazaika commented 8 years ago

When we hover over a user's name, a Twitter Bootstrap pop-up should be displayed to the person who is on the page and it should show them the user's github handle.

NKHolton commented 8 years ago

Looking for some direction on this. W3Schools gives a good tutorial for a Bootstrap popover where I can hover over something and it'll show the popover. I signed into Defcon as an admin and have localhost up. I created a post so I could see what's shown to the user. Just to double-check...it appears as though the user's email is displayed after their post, under their avatar? My 1st thought was to make the popover appear on hovering over the avatar but since the avatar already links to the user's profile that didn't make sense to me. So my 2nd thought was to have the popover appear when hovering over the user's email. Right now though my implementation of the popover is making the email look like a link, which seems like you should then click on it and it'd pop open up a new email, however, if I continue with this it'd link to the user's github acct. Just isn't making sense to me and doesn't look right... Any advice welcome. Apologies for long comment. This is the code I have so far in index.html.haml (note I need to switch it to haml)

`

kenmazaika commented 8 years ago

What you have looks close, but it's sort of a mix between haml and HTML, which is what's causing you problems. I'd suggest figuring out how to do it with full HTML first, then converting that to HAML, instead of trying to mix the two.

NKHolton commented 8 years ago

Ok so I tried this:

`%a{"data-content" => "user.github_handle", "data-toggle" => "popover", "data-trigger" => "hover", :href => ""}

But it's still making the email look like a link which I don't want. I guess that's what the W3Schools tutorial shows though..the popover via a link. Found this tutorial as well: http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/bootstrap-popovers.php but it's showing the popover implemented via a button. Maybe I'm onto the wrong thing?

kenmazaika commented 8 years ago

I suggest you get code that would work in a different project using HTML / ERB (maybe jump into nomster). Then once you get that working port it to the DEFCON app. I also suggest using the twitter bootstrap documentation instead of other sources.

NKHolton commented 8 years ago

Sounds good, will keep trying!