tog22 / eahub

EA Hub
7 stars 1 forks source link

Make users see a message saying they still need to click the verification link #8

Open tog22 opened 9 years ago

tog22 commented 9 years ago

Can you try to make it so those users see a message saying they still need to click the verification link or they won't be able to submit info to the site and their EA Profile won't show to others? This'd show as they browse around the site, and you can use Drupal's messages function which displays green messages like at http://i.imgur.com/S6b2eTQ.png . You'd need to Google to see how to set this - it'd either be in a module or editing one of our custom modules/template.php file (I can explain how to edit those in general if it's easier).

tog22 commented 9 years ago

good enough way might be to create a block only shown to unverif role

cdc482 commented 9 years ago

I put a block in banner on my dev (diffdocroot) site. What do you think? It took about 1 minute thanks to your tutorial. It lacks basic html formatting, but I figured you probably have a css style I should apply instead.

peterhurford commented 9 years ago

@cdc482 @tog22 Is there a PR for this? I can't find @cdc482's dev site.

cdc482 commented 9 years ago

@peterhurford I rewrite the sandbox on occassion. Try checking out diffdocroot.effectivealtruismhub.com. This issue is almost done. I'm just working on the token bit...which is probably really easy. I just need a break to see it clearly.

P.S. Ignore the weird menu format--someone else is playing with that.

tog22 commented 9 years ago

We don't do PRs at the moment, because most of the changes in Drupal are done via the admin interface which only affects the database. The ones which do affect files (e.g. theming changes) could be done once we do #4 .

cdc482 commented 9 years ago

I knew it was something simple! https://www.drupalgardens.com/documentation/tokens

cdc482 commented 9 years ago

Done. Note that it currently displays to ALL users (though I'd modify the block so that only unverified users see the message on the live site) and ONLY on pages with the path user/... Let me know your thoughts, and I'll deploy right after. I'd like to reset the sandbox for other reasons anyway.

tog22 commented 9 years ago

Coordinate with @arichard4 before resetting the sandbox - if you guys can set up separate development environments (either on the server or locally) that'd probably make your lives easier! Feel free to share any passwords with Alex, Chris, I trust him plenty.

tog22 commented 9 years ago

Only showing it on pages with the path user/ was a good idea. It looks almost ready to deploy, but please first make it look exactly like the normal Drupal messages (e.g. the red 'update available' ones you see on http://diffdocroot.effectivealtruismhub.com/admin/structure/block/manage/block/7/configure?destination=user/1 only using the green colour, like you have). I think that just requires removing the grey gradient background. Please also add ' to make your EA Profile appear on the list' to the message.

cdc482 commented 9 years ago

Still not happy with it, but my research on HTML classes and CSS is starting to get declining returns. Ill figure it out eventually, but feel free to share thoughts on id's like "inside" or "main" and classes like "clearcase" and "grid 8"....I have accomplished through trial and error though, so no worries if you also don't have much time to explain these things

tog22 commented 9 years ago

I'd definitely suggest just exactly copying the classes (and the whole HTML) of the normal Drupal messages (e.g. the red 'update available' ones you see on http://diffdocroot.effectivealtruismhub.com/admin/structure/block/manage/block/7/configure?destination=user/1 only using the green colour, like you have). Doesn't that work and do the job in the quickest way possible?

cdc482 commented 9 years ago

While I am generally stupid enough to miss something as simple as this, I did take your advice about copying the html and classes from other error messages.

Turns out that modifications are needed because the other error and status messages show inside the main page content block, and the elements holding the status message also hold other content that appears further down the page. This leads to lots of white space Without any modification. With modification it is possible to make a single green banner status message, but the indenting is different from other status messages. I did eventually get the indenting and spacing (no grey background) right at one point before resetting the environment.

With enough guess and check I'll figure it out again. Anyway like you said learning about various Ids and classes is helpful for my understanding of the site styling anyway

On Saturday, July 18, 2015, tog22 notifications@github.com wrote:

I'd definitely suggest just exactly copying the classes (and the whole HTML) of the normal Drupal messages (e.g. the red 'update available' ones you see on http://diffdocroot.effectivealtruismhub.com/admin/structure/block/manage/block/7/configure?destination=user/1 only using the green colour, like you have). Doesn't that work and do the job in the quickest way possible?

— Reply to this email directly or view it on GitHub https://github.com/tog22/eahub/issues/8#issuecomment-122571846.

tog22 commented 9 years ago

Ah, gotcha! If it's proving tricky then at this stage it may well be worth doing it the official 'Drupal way' after all and editing the 'EA Hub Support' module (or template.php in the theme) to execute something like this on each page:

if ($user->role == 'unverified') { // <- not sure that's the actual way to test for this drupal_set_message("Bla bla bla"); // see https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupal_set_message/7 }

But I'll let you make the final judgement as to which way is quickest.

I receive a lot of email and limit my time spent on it, so may take a while to see or reply to messages; I may be able to reply more quickly to emails with an indication of timeframes (e.g. with 'urgent' in the subject line).

Contact information: http://bit.ly/tagoogleplus

On 18 July 2015 at 13:08, cdc482 notifications@github.com wrote:

While I am generally stupid enough to miss something as simple as this, I did take your advice about copying the html and classes from other error messages.

Turns out that modifications are needed because the other error and status messages show inside the main page content block, and the elements holding the status message also hold other content that appears further down the page. This leads to lots of white space Without any modification. With modification it is possible to make a single green banner status message, but the indenting is different from other status messages. I did eventually get the indenting and spacing (no grey background) right at one point before resetting the environment.

With enough guess and check I'll figure it out again. Anyway like you said learning about various Ids and classes is helpful for my understanding of the site styling anyway

On Saturday, July 18, 2015, tog22 notifications@github.com wrote:

I'd definitely suggest just exactly copying the classes (and the whole HTML) of the normal Drupal messages (e.g. the red 'update available' ones you see on

http://diffdocroot.effectivealtruismhub.com/admin/structure/block/manage/block/7/configure?destination=user/1 only using the green colour, like you have). Doesn't that work and do the job in the quickest way possible?

— Reply to this email directly or view it on GitHub https://github.com/tog22/eahub/issues/8#issuecomment-122571846.

— Reply to this email directly or view it on GitHub https://github.com/tog22/eahub/issues/8#issuecomment-122589897.

cdc482 commented 9 years ago

Personally, it would be good to learn what you just suggested anyway as it is involved in other tasks. I think I will do this research by Monday the latest.

On Sat, Jul 18, 2015 at 4:29 PM, tog22 notifications@github.com wrote:

Ah, gotcha! If it's proving tricky then at this stage it may well be worth doing it the official 'Drupal way' after all and editing the 'EA Hub Support' module (or template.php in the theme) to execute something like this on each page:

if ($user->role == 'unverified') { // <- not sure that's the actual way to test for this drupal_set_message("Bla bla bla"); // see

https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupal_set_message/7 }

But I'll let you make the final judgement as to which way is quickest.

I receive a lot of email and limit my time spent on it, so may take a while to see or reply to messages; I may be able to reply more quickly to emails with an indication of timeframes (e.g. with 'urgent' in the subject line).

Contact information: http://bit.ly/tagoogleplus

On 18 July 2015 at 13:08, cdc482 notifications@github.com wrote:

While I am generally stupid enough to miss something as simple as this, I did take your advice about copying the html and classes from other error messages.

Turns out that modifications are needed because the other error and status messages show inside the main page content block, and the elements holding the status message also hold other content that appears further down the page. This leads to lots of white space Without any modification. With modification it is possible to make a single green banner status message, but the indenting is different from other status messages. I did eventually get the indenting and spacing (no grey background) right at one point before resetting the environment.

With enough guess and check I'll figure it out again. Anyway like you said learning about various Ids and classes is helpful for my understanding of the site styling anyway

On Saturday, July 18, 2015, tog22 notifications@github.com wrote:

I'd definitely suggest just exactly copying the classes (and the whole HTML) of the normal Drupal messages (e.g. the red 'update available' ones you see on

http://diffdocroot.effectivealtruismhub.com/admin/structure/block/manage/block/7/configure?destination=user/1

only using the green colour, like you have). Doesn't that work and do the job in the quickest way possible?

— Reply to this email directly or view it on GitHub https://github.com/tog22/eahub/issues/8#issuecomment-122571846.

— Reply to this email directly or view it on GitHub https://github.com/tog22/eahub/issues/8#issuecomment-122589897.

— Reply to this email directly or view it on GitHub https://github.com/tog22/eahub/issues/8#issuecomment-122594555.

cdc482 commented 9 years ago

So... I got rid of most white space. Please see: http://diffdocroot.effectivealtruismhub.com/user

Should I add a line break between the message and the menu bar?


How this was done: Code (in Banner body):

<div id="content"><div class="container_12 clearfix">
<div id="main" class="grid_12">
<div class="messages status">
<h2 class="element-invisible">Status message</h2>
<ul>Please change or confirm [user:mail] by clicking the e-mailed verification link to make your profile public</ul>
</div></div></div></div>

Install & Enable Token Filter Module: https://www.drupal.org/project/token_filter

Select "replace token" for relevant view(s): http://diffdocroot.effectivealtruismhub.com/admin/config/content/formats/

tog22 commented 9 years ago

Yay! Yes, please add the same amount of space above it as the regular messages have (e.g. the red message on http://diffdocroot.effectivealtruismhub.com/admin/structure/block ). It should look exactly like those. Here are some illustrative images: http://prntscr.com/7zulsl / http://prntscr.com/7zuloj

Unfortunately, it says "Please change or confirm [user:mail] by clicking the e-mailed verification link to make your profile public" to me - it doesn't replace [user:mail]. If you can't get this to work in 10 minutes just skip it and don't provide their email address.

Also, that message is a bit unclear, can you make it clearer? E.g. "Your EA Profile is not yet public. To make it viewable, click the verification link we sent to your email."

cdc482 commented 9 years ago

This should be easy enough. Sadly, although I knew how like a week ago, I've forgotten how to fix the problem of database set up. I'll figure it out eventually. I just don't want to experiment with it until my mind is clear in case I break something.

tog22 commented 8 years ago

Assigned to @haryshwaran in https://app.asana.com/0/49685304522920/48351011270207