jenkins-bot has submitted this change and it was merged.
Change subject: Stylistic changes to profile page
......................................................................
Stylistic changes to profile page
* Separate into 3 sections, use icons rather than headings to identify
them
* fix wording of photo upload caption
* clean up dead css
Change-Id: I2fdc4a9013c847e4a843fc583d8d80699aa804c3
---
M MobileFrontend.i18n.php
M includes/specials/SpecialUserProfile.php
M less/specials/userprofile.less
A stylesheets/specials/images/profile/activity.png
A stylesheets/specials/images/profile/registration.png
A stylesheets/specials/images/profile/user.png
M stylesheets/specials/userprofile.css
7 files changed, 107 insertions(+), 42 deletions(-)
Approvals:
JGonera: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index 3ba67b1..e563677 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -309,12 +309,13 @@
'mobile-frontend-profile-uploads' => '{{PLURAL:$1|1 upload|$1
uploads|0=No uploads}} in last month',
'mobile-frontend-profile-edits-limit' => 'Over {{PLURAL:$1|$1 edit|$1
edits}} in last month',
'mobile-frontend-profile-uploads-limit' => 'Over {{PLURAL:$1|$1
upload|$1 uploads}} in last month',
- 'mobile-frontend-profile-upload-caption' => '$1 was the last upload by
{{GENDER:$2|$2}} and was uploaded {{PLURAL:$3|$3 day ago|$3 days ago}}.',
+ 'mobile-frontend-profile-last-upload-caption' => 'Last upload by
{{GENDER:$1|$1}}, {{PLURAL:$2|yesterday|$2 days ago|0=today}}.',
'mobile-frontend-profile-heading-recent' => 'Recent',
- 'mobile-frontend-profile-registered' => 'Member for {{PLURAL:$1|$1
day|$1 days}} with {{PLURAL:$2|$2 edit|$2 edits}}.',
+ 'mobile-frontend-profile-registration' => '$1 has been a member for
{{PLURAL:$2|$2 day|$2 days}} and has made {{PLURAL:$3|$3 edit|$3 edits}}.',
'mobile-frontend-profile-usertalk' => 'View talk page.',
'mobile-frontend-profile-noargs' => 'Please provide a username to view
a profile.',
'mobile-frontend-profile-yours' => 'Visit your profile page.',
+ 'mobile-frontend-profile-userpage-link' => 'Visit user page.',
'mobile-frontend-profile-user-desc-1' => '{{GENDER:$1|This user}} is a
new editor.',
'mobile-frontend-profile-user-desc-2' => '{{GENDER:$1|This user}} is a
somewhat experienced editor.',
'mobile-frontend-profile-user-desc-3' => '{{GENDER:$1|This user}} is a
prolific editor.',
@@ -792,10 +793,10 @@
See also:
* {{msg-mw|Mobile-frontend-profile-edits}}',
'mobile-frontend-profile-uploads-limit' => 'Upload count when expressed
to be over a certain number.',
- 'mobile-frontend-profile-upload-caption' => '$1 is the filename, $2 is
the username and $3 is the amount of days ago the image was uploaded.',
+ 'mobile-frontend-profile-last-upload-caption' => '$1 is the username
and $2 is the amount of days ago the image was uploaded.',
'mobile-frontend-profile-heading-recent' => 'Heading for recent section
profile.
{{Identical|Recent}}',
- 'mobile-frontend-profile-registered' => 'Summary saying how many days
the user has been a member ($1) and how many total edits they have made ($2).',
+ 'mobile-frontend-profile-registration' => 'Summary saying how many days
the user ($1) has been a member ($2) and how many total edits they have made
($3).',
'mobile-frontend-profile-usertalk' => 'Link label to user talk page.',
'mobile-frontend-profile-noargs' => 'Message shown when no user profile
URL is specified.
@@ -806,6 +807,7 @@
Used if the user is logged in.
Preceded by {{msg-mw|Mobile-frontend-profile-noargs}}.',
+ 'mobile-frontend-profile-userpage-link' => 'Label for a link to user
page that shows on Special:UserProfile.',
'mobile-frontend-profile-user-desc-1' => 'Summary describing that this
user is new.',
'mobile-frontend-profile-user-desc-2' => 'Summary describing that the
user is somewhat experienced.',
'mobile-frontend-profile-user-desc-3' => 'Summary describing the type
of experience the user has.',
diff --git a/includes/specials/SpecialUserProfile.php
b/includes/specials/SpecialUserProfile.php
index ffa9406..17f8ce8 100644
--- a/includes/specials/SpecialUserProfile.php
+++ b/includes/specials/SpecialUserProfile.php
@@ -115,11 +115,11 @@
$ts = new MWTimestamp( wfTimestamp( TS_UNIX,
$row->img_timestamp ) );
$daysAgo = $this->getDaysAgo( $ts );
- $img = Html::openElement( 'div', array( 'class' =>
'thumb' ) ) .
+ $img = Html::openElement( 'div', array( 'class' =>
'last-upload section-end' ) ) .
Html::openElement( 'a', array( 'href' =>
$title->getLocalUrl() ) ) .
$file->transform( array( 'width' => 320,
'height' => 320 ) )->toHtml() .
- Html::openElement( 'div', array( 'class' =>
'thumbcaption' ) ) .
- $this->msg(
'mobile-frontend-profile-upload-caption', $title->getText(), $user, $daysAgo
)->parse() .
+ Html::openElement( 'div', array( 'class' =>
'thumbcaption secondary-statement' ) ) .
+ $this->msg(
'mobile-frontend-profile-last-upload-caption', $user, $daysAgo )->parse() .
Html::closeElement( 'div' ) .
Html::closeElement( 'a' ) .
Html::closeElement( 'div' );
@@ -144,9 +144,11 @@
$role = $this->msg(
'mobile-frontend-profile-user-desc-3', $user );
}
- return Html::element( 'p', array( 'class' => 'statement' ),
- $this->msg( 'mobile-frontend-profile-registered',
$daysAgo, $editCount )->parse() ) .
- Html::element( 'p', array( 'class' =>
'secondary-statement' ), $role );
+ return Html::openElement( 'div', array( 'class' => 'section
section-registered' ) ) .
+ Html::element( 'p', array( 'class' => 'statement' ),
+ $this->msg( 'mobile-frontend-profile-registration',
$user->getName(), $daysAgo, $editCount )->parse() ) .
+ Html::element( 'p', array( 'class' =>
'secondary-statement section-end' ), $role ) .
+ Html::closeElement( 'div' );
}
protected function getRecentActivityHtml( User $user ) {
@@ -163,18 +165,20 @@
$msgEdits = $count > self::LIMIT ? $this->msg(
'mobile-frontend-profile-edits-limit', self::LIMIT ) :
$this->msg( 'mobile-frontend-profile-edits',
$count );
$statsRecent = array(
- Html::element( 'a', array( 'href' => $urlContributions
), $msgEdits ),
- Html::element( 'a', array( 'href' => $urlUploads ),
$msgUploads ),
+ Html::element( 'a',
+ array( 'href' => $urlContributions, 'class' =>
'statement' ),
+ $msgEdits ),
+ Html::element( 'a',
+ array( 'href' => $urlUploads, 'class' =>
'statement' ),
+ $msgUploads ),
);
$lastUploadHtml = $this->getLastUpload( $user );
if ( $lastUploadHtml ) {
$statsRecent[] = $lastUploadHtml;
}
- $html = Html::element( 'h2', array(), $this->msg(
'mobile-frontend-profile-heading-recent' ) ) .
- $this->getListHtml( 'ul', array( 'class' =>
'statements' ), $statsRecent );
+ $html = $this->getListHtml( 'ul', array( 'class' => 'section
section-activity' ), $statsRecent );
wfProfileOut( __METHOD__ );
-
return $html;
}
@@ -228,7 +232,11 @@
if ( $user ) {
$this->setUserProfileUIElements( $user );
$html = Html::openElement( 'div', array(
'class' => 'profile' ) ) .
- $this->getUserSummary( $user ) .
$this->getRecentActivityHtml( $user ) . '</div>';
+ $this->getUserSummary( $user ) .
$this->getRecentActivityHtml( $user ) .
+ Linker::link( $user->getUserPage(),
+ $this->msg(
'mobile-frontend-profile-userpage-link' ),
+ array( 'class' => 'user-page
section-end' ) ) .
+ Html::closeElement( 'div' );
} else {
$html = $this->getHtmlNoArg();
}
diff --git a/less/specials/userprofile.less b/less/specials/userprofile.less
index c509b66..dc4e43a 100644
--- a/less/specials/userprofile.less
+++ b/less/specials/userprofile.less
@@ -1,25 +1,50 @@
+@import "../mixins.less";
.profile {
- .statements li,
+ // FIXME: reconsider top margin for all pages?
+ margin-top: 1.5em;
+
+ .last-upload {
+ margin-top: 0.6em;
+ }
+
.statement {
- font-family: Georgia;
- font-size: 1.95em;
+ font-size: 1.4em;
+ line-height: 1.25;
margin-bottom: 0;
}
+
.secondary-statement {
- font-family: Arial;
+ font-size: 1.1em;
+ color: #ccc;
font-style: italic;
- font-size: 21px;
- color: #919191;
+ line-height: 1.1;
+ margin-top: .2em;
+ }
+
+ .section-end {
+ margin-bottom: 2em;
}
}
-.content h2 {
- font-family: Arial;
- font-size: 1.47em;
- text-transform: uppercase;
- color: rgb(145, 145, 145);
+.section,
+.user-page {
+ background-repeat: no-repeat;
+ .background-size( 18px, 19px );
+ padding-left: 30px;
+ background-position: left 4px;
}
-ul {
- list-style: none;
+.section-registered {
+ background-image: url(images/profile/registration.png);
+}
+
+.section-activity {
+ background-image: url(images/profile/activity.png);
+}
+
+.user-page {
+ padding-top: 6px;
+ line-height: 19px;
+ display: inline-block;
+ background-image: url(images/profile/user.png);
}
diff --git a/stylesheets/specials/images/profile/activity.png
b/stylesheets/specials/images/profile/activity.png
new file mode 100644
index 0000000..6c057e8
--- /dev/null
+++ b/stylesheets/specials/images/profile/activity.png
Binary files differ
diff --git a/stylesheets/specials/images/profile/registration.png
b/stylesheets/specials/images/profile/registration.png
new file mode 100644
index 0000000..ca4548b
--- /dev/null
+++ b/stylesheets/specials/images/profile/registration.png
Binary files differ
diff --git a/stylesheets/specials/images/profile/user.png
b/stylesheets/specials/images/profile/user.png
new file mode 100644
index 0000000..e72c110
--- /dev/null
+++ b/stylesheets/specials/images/profile/user.png
Binary files differ
diff --git a/stylesheets/specials/userprofile.css
b/stylesheets/specials/userprofile.css
index 7dbbae9..e71f002 100644
--- a/stylesheets/specials/userprofile.css
+++ b/stylesheets/specials/userprofile.css
@@ -1,21 +1,51 @@
-.profile .statements li,
+/**
+ * DO NOT EDIT THIS FILE
+ * This is an automatically generated css file.
+ * It was generated by LESS (http://lesscss.org).
+ * Please edit the corresponding less file instead.
+ * See README.mediawiki for details on installing.
+ */
+.profile {
+ margin-top: 1.5em;
+}
+.profile .last-upload {
+ margin-top: 0.6em;
+}
.profile .statement {
- font-family: Georgia;
- font-size: 1.95em;
+ font-size: 1.4em;
+ line-height: 1.25;
margin-bottom: 0;
}
.profile .secondary-statement {
- font-family: Arial;
+ font-size: 1.1em;
+ color: #ccc;
font-style: italic;
- font-size: 21px;
- color: #919191;
+ line-height: 1.1;
+ margin-top: .2em;
}
-.content h2 {
- font-family: Arial;
- font-size: 1.47em;
- text-transform: uppercase;
- color: #919191;
+.profile .section-end {
+ margin-bottom: 2em;
}
-ul {
- list-style: none;
+.section,
+.user-page {
+ background-repeat: no-repeat;
+ /* use -webkit prefix for older android browsers eg. nexus 1 */
+
+ -o-background-size: 18px 19px;
+ -webkit-background-size: 18px 19px;
+ background-size: 18px 19px;
+ padding-left: 30px;
+ background-position: left 4px;
+}
+.section-registered {
+ background-image: url(images/profile/registration.png);
+}
+.section-activity {
+ background-image: url(images/profile/activity.png);
+}
+.user-page {
+ padding-top: 6px;
+ line-height: 19px;
+ display: inline-block;
+ background-image: url(images/profile/user.png);
}
--
To view, visit https://gerrit.wikimedia.org/r/86757
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2fdc4a9013c847e4a843fc583d8d80699aa804c3
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits