Last modified: 2012-04-05 19:43:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36302, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34302 - Add CSS classes to email fields in user preferences
Add CSS classes to email fields in user preferences
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User preferences (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: 1.20.0 release
Assigned To: Nobody - You can work on this!
: easy, patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-09 18:17 UTC by paxed
Modified: 2012-04-05 19:43 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
adds new css classes based on email verification (2.15 KB, patch)
2012-03-05 13:53 UTC, Nischay Nahata
Details
Edited as per direction given in above comment (2.90 KB, patch)
2012-03-05 15:55 UTC, Nischay Nahata
Details

Description paxed 2012-02-09 18:17:23 UTC
It's not possible to style the email in Special:Preferences differently depending on whether it's verified or not.

Currently it shows <table id="mw-htmlform-email">, would be nice to have eg. <table id="mw-htmlform-email" class="email-verified">
Comment 1 Antoine "hashar" Musso (WMF) 2012-03-05 11:51:36 UTC
I have added a basic placeholder to test this bug with r113016

Please note the bug is being fixed by nischayn22.
Comment 2 Nischay Nahata 2012-03-05 13:53:41 UTC
Created attachment 10174 [details]
adds new css classes based on email verification

The css design has been given a simple redish look and can be modified as desired
Comment 3 Antoine "hashar" Musso (WMF) 2012-03-05 14:30:39 UTC
Great! Firstly, you have to add the css to the mediawiki.special.preferences module:

Index: resources/Resources.php
===================================================================
--- resources/Resources.php	(revision 113031)
+++ resources/Resources.php	(working copy)
@@ -786,6 +786,7 @@
 	),
 	'mediawiki.special.preferences' => array(
 		'scripts' => 'resources/mediawiki.special/mediawiki.special.preferences.js',
+		'styles'  => 'resources/mediawiki.special/mediawiki.special.preferences.css',
 	),
 	'mediawiki.special.recentchanges' => array(
 		'scripts' => 'resources/mediawiki.special/mediawiki.special.recentchanges.js',


You probably forgot resources/Resources.php when making the patch.


I don't think we should change the text color, you probably want to keep it black.  Have a look at resources/mediawiki.special/mediawiki.special.changeemail.css which apply to a similar case, you can even reuse the colors from there.

I don't think you should change the background color of the label but only the input. The CSS should be something like:

.mw-email-notverified .mw-input 

That will leave the label as is.


Then the PHP variable holding the css class is using the term "verify" whereas the rest of the code talk about "authentication".  Please rephrase $emailverificationclass to $emailAuthClass (we use camel case).


Finally the class names are:
- mw-email-verified
- mw-email-notverified
- mw-noemailprefs

As above, please considerate using the "authentication" term. Maybe use:
- mw-email-authenticated
- mw-email-not-authenticated
- mw-email-none
Comment 4 Nischay Nahata 2012-03-05 15:55:06 UTC
Created attachment 10175 [details]
Edited as per direction given in above comment

I hope this one serves the purpose!
Comment 5 paxed 2012-03-05 16:16:06 UTC
If HTML5 is allowed, this could be solved more generally by using the HTML5 data attributes.
Comment 6 Sumana Harihareswara 2012-03-07 02:13:32 UTC
Antoine, could you review this patch, please?  Thanks.
Comment 7 Antoine "hashar" Musso (WMF) 2012-03-07 09:55:58 UTC
rephrasing summary
Comment 8 Antoine "hashar" Musso (WMF) 2012-03-07 09:58:00 UTC
You had a minor issue in the patch, one string was missing quotes.

Anyway, I have made some trivial additions, amended existing tests and sent that as r113221

Please  note this is not going to be deployed yet on Wikimedia website.


Thanks for the patch, you will have to find a new bug to fix now :-]]]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links