diff --git a/bugnote_view_inc.php b/bugnote_view_inc.php
index 087f76e155..ccfdd3df13 100644
--- a/bugnote_view_inc.php
+++ b/bugnote_view_inc.php
@@ -155,7 +155,7 @@
?>
-
+
diff --git a/core/classes/TimelineEvent.class.php b/core/classes/TimelineEvent.class.php
index 84f1a05f08..f2b48f7ef4 100644
--- a/core/classes/TimelineEvent.class.php
+++ b/core/classes/TimelineEvent.class.php
@@ -77,7 +77,7 @@ public function html_start( $p_action_icon = 'fa-check' ) {
$t_html = ' ';
if( !empty( $t_avatar ) ) {
- $t_html .= ' ';
+ $t_html .= prepare_avatar( $t_avatar, 'profile-activity', 40 );
} else {
$t_html .= ' ';
}
diff --git a/core/layout_api.php b/core/layout_api.php
index 1df8516c15..44c1757604 100644
--- a/core/layout_api.php
+++ b/core/layout_api.php
@@ -480,7 +480,7 @@ function layout_navbar_user_menu( $p_show_avatar = true ) {
echo ' ';
echo '';
if( $p_show_avatar ) {
- layout_navbar_user_avatar( 'nav-user-photo' );
+ layout_navbar_user_avatar();
echo '';
echo $t_username;
echo '';
@@ -700,7 +700,7 @@ function layout_navbar_subproject_option_list( $p_parent_id, $p_project_id = nul
* @param string $p_img_class css class to use with the img tag
* @return null
*/
-function layout_navbar_user_avatar( $p_img_class = '' ) {
+function layout_navbar_user_avatar( $p_img_class = 'nav' ) {
$t_default_avatar = ' ';
if( OFF === config_get( 'show_avatar' ) ) {
@@ -715,12 +715,9 @@ function layout_navbar_user_avatar( $p_img_class = '' ) {
}
if( access_has_project_level( config_get( 'show_avatar_threshold' ), null, $p_user_id ) ) {
- $t_avatar = Avatar::get( $p_user_id, 32 );
+ $t_avatar = Avatar::get( $p_user_id, 40 );
if( false !== $t_avatar ) {
- $t_image = htmlspecialchars( $t_avatar->image );
- $t_text = htmlspecialchars( $t_avatar->text );
-
- echo '';
+ echo prepare_raw_avatar( $t_avatar, $p_img_class, 40 );
return;
}
}
diff --git a/core/prepare_api.php b/core/prepare_api.php
index d0995f1334..463378ad53 100644
--- a/core/prepare_api.php
+++ b/core/prepare_api.php
@@ -104,3 +104,51 @@ function prepare_version_string( $p_project_id, $p_version_id ) {
return $t_version_text;
}
+
+/**
+ * Prepares avatar for raw outputting (only avatar image).
+ *
+ * @param Avatar $p_avatar An instance of class Avatar.
+ * @param string $p_class_prefix CSS class prefix to add to the avatar's surrounding div and to the img.
+ * The CSS classes to implement will be named [$p_class_prefix]-avatar_container-[$p_size] and
+ * [$p_class_prefix]-avatar-[$p_size].
+ * @param integer $p_size Image maximum size.
+ * @return the HTML string of the avatar.
+ */
+function prepare_raw_avatar( $p_avatar, $p_class_prefix, $p_size) {
+ if( $p_avatar === null ) {
+ return '';
+ }
+
+ $t_image = htmlspecialchars( $p_avatar->image );
+ $t_text = htmlspecialchars( $p_avatar->text );
+
+ $t_avatar_class = $p_class_prefix . '-avatar' . '-' . $p_size;
+ return '';
+}
+
+/**
+ * Prepares avatar for outputting.
+ *
+ * @param Avatar $p_avatar An instance of class Avatar.
+ * @param string $p_class_prefix CSS class prefix to add to the avatar's surrounding div and to the img.
+ * The CSS classes to implement will be named [$p_class_prefix]-avatar-container-[$p_size] and
+ * [$p_class_prefix]-avatar-[$p_size].
+ * @param integer $p_size Image maximum size.
+ * @return the HTML string of the avatar.
+ */
+function prepare_avatar( $p_avatar, $p_class_prefix, $p_size ) {
+ if( $p_avatar === null ) {
+ return '';
+ }
+
+ $t_link = htmlspecialchars( $p_avatar->link );
+
+ $t_container_class = $p_class_prefix . '-avatar-container' . '-' . $p_size;
+ return '';
+}
+
diff --git a/core/print_api.php b/core/print_api.php
index 20f216fabf..a7e05d9482 100644
--- a/core/print_api.php
+++ b/core/print_api.php
@@ -182,24 +182,15 @@ function print_successful_redirect( $p_redirect_to ) {
/**
* Print avatar image for the given user ID
*
- * @param integer $p_user_id A user identifier.
- * @param integer $p_size Image pixel size.
+ * @param integer $p_user_id A user identifier.
+ * @param string $p_class_prefix CSS classs prefix.
+ * @param integer $p_size Image pixel size.
* @return void
*/
-function print_avatar( $p_user_id, $p_size = 80 ) {
+function print_avatar( $p_user_id, $p_class_prefix, $p_size = 80 ) {
$t_avatar = Avatar::get( $p_user_id, $p_size );
- if( $t_avatar === null ) {
- return;
- }
-
- $t_image = htmlspecialchars( $t_avatar->image );
- $t_link = htmlspecialchars( $t_avatar->link );
- $t_text = htmlspecialchars( $t_avatar->text );
- echo '' .
- '';
+ echo prepare_avatar( $t_avatar, $p_class_prefix, $p_size );
}
/**
diff --git a/css/ace-mantis.css b/css/ace-mantis.css
index 9cae486464..9b31d70e78 100644
--- a/css/ace-mantis.css
+++ b/css/ace-mantis.css
@@ -214,25 +214,49 @@ pre {
position: relative;
}
-.ace-nav .nav-user-photo {
- border-radius: 4px !important;
+.ace-nav .nav-avatar-container-40 {
+ width: 48px;
+ height: 40px;
+ float: left;
+}
+
+.ace-nav .nav-avatar-40 {
+ margin: -4px 8px 0 0;
+ border-radius: 100%;
+ border: 2px solid #FFF;
+ max-width: 40px;
+ max-height: 40px;
+ border-radius: 4px !important;
}
-.profile-activity img {
+.profile-activity-avatar-40 {
border-radius: 15% !important;
margin-bottom: 6px !important;
}
+.profile-activity-avatar-container-40 {
+ width: 48px;
+ line-height: 40px;
+ float: left;
+ text-align: center;
+}
+
.table-responsive {
margin-bottom: 0 !important;
}
-.avatar
-{
+.bugnote-avatar-80 {
border: 2px solid #c9d6e5;
border-radius: 15%;
box-shadow: none;
margin:0;
max-width: 80px;
+ max-height: 80px;
+}
+
+.bugnote-avatar-container-80 {
+ line-height: 80px;
+ width: 84px;
+ text-align: center;
}
.input-sm {
|