From 8bb36c5bc3dfa41ec4789790ecdffcfe65e8c4a2 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Sat, 5 Jan 2013 17:56:12 +0000 Subject: [PATCH] added notification images git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@67107 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/view/templates/DayWrapper.java | 8 ++- .../templates/SingleNotificationView.java | 52 ++++++++++++++++-- .../templates/images/NotificationImages.java | 30 ++++++++++ .../view/templates/images/comment_edit.png | Bin 0 -> 3511 bytes .../view/templates/images/connection_new.png | Bin 0 -> 754 bytes .../client/view/templates/images/job_nok.png | Bin 0 -> 820 bytes .../client/view/templates/images/job_ok.png | Bin 0 -> 839 bytes .../client/view/templates/images/mail.png | Bin 0 -> 502 bytes .../templates/images/notification-generic.png | Bin 0 -> 653 bytes .../view/templates/images/share_blue.png | Bin 0 -> 1542 bytes .../view/templates/images/star_blue.png | Bin 0 -> 1582 bytes .../view/templates/images/user-photo.png | Bin 0 -> 1499 bytes .../server/NotificationsServiceImpl.java | 25 ++++++++- src/main/webapp/Notifications.css | 32 +++++++++-- 14 files changed, 133 insertions(+), 14 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/comment_edit.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/connection_new.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/job_nok.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/job_ok.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/mail.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/notification-generic.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/share_blue.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/star_blue.png create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/user-photo.png diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/DayWrapper.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/DayWrapper.java index 45132ac..0be6b08 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/DayWrapper.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/DayWrapper.java @@ -22,7 +22,13 @@ public class DayWrapper extends Composite { public DayWrapper(Date day) { initWidget(uiBinder.createAndBindUi(this)); - dayLabel.setHTML(DateTimeFormat.getFormat("MMMM dd, h:mm a").format(day)); + + String notificationDate = DateTimeFormat.getFormat("yyyy MMMM dd").format(day); + String today = DateTimeFormat.getFormat("yyyy MMMM dd").format(new Date()); + if (notificationDate.equals(today)) + dayLabel.setHTML("Today"); + else + dayLabel.setHTML(DateTimeFormat.getFormat("EE, dd MMMM").format(day)); } } diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java index 67fe669..fe3098b 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java @@ -1,10 +1,16 @@ package org.gcube.portlets.user.notifications.client.view.templates; +import java.util.Date; + +import com.google.gwt.user.datepicker.client.CalendarUtil; import org.gcube.portal.databook.client.GCubeSocialNetworking; import org.gcube.portal.databook.shared.Notification; +import org.gcube.portal.databook.shared.NotificationType; +import org.gcube.portlets.user.notifications.client.view.templates.images.NotificationImages; import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; +import com.google.gwt.resources.client.ImageResource; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; @@ -19,10 +25,13 @@ public class SingleNotificationView extends Composite { .create(NotificationsDayUiBinder.class); interface NotificationsDayUiBinder extends - UiBinder { + UiBinder { } + + NotificationImages images = GWT.create(NotificationImages.class); + private Notification myNotification; - + @UiField Image notificationImage; @UiField HTMLPanel mainPanel; @@ -33,14 +42,47 @@ public class SingleNotificationView extends Composite { initWidget(uiBinder.createAndBindUi(this)); myNotification = toShow; String notificationToShow = toShow.getDescription(); - + notificationText.setHTML( ""+ toShow.getSenderFullName()+" " + notificationToShow); - - timeArea.setHTML(DateTimeFormat.getFormat("MMMM dd, h:mm a").format(toShow.getTime())); + timeArea.setHTML(DateTimeFormat.getFormat("h:mm a").format(toShow.getTime())); + + notificationImage.setResource(getImageType(toShow.getType())); } + private ImageResource getImageType(NotificationType type) { + switch (type) { + case LIKE: + return images.like(); + case COMMENT: + return images.comment(); + case MESSAGE: + return images.message(); + case WP_FOLDER_ADDEDUSER: + return images.share(); + case WP_FOLDER_REMOVEDUSER: + return images.share(); + case WP_FOLDER_SHARE: + return images.share(); + case WP_ITEM_NEW: + return images.share(); + case WP_ITEM_DELETE: + return images.share(); + case WP_ITEM_UPDATED: + return images.share(); + case OWN_COMMENT: + return images.comment(); + case REQUEST_CONNECTION: + return images.connectionRequest(); + case JOB_COMPLETED_NOK: + return images.jobNOK(); + case JOB_COMPLETED_OK: + return images.jobOK(); + default: + return images.generic(); + } + } } diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java new file mode 100644 index 0000000..5ec2524 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java @@ -0,0 +1,30 @@ +package org.gcube.portlets.user.notifications.client.view.templates.images; + +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.ImageResource; + +public interface NotificationImages extends ClientBundle { + @Source("comment_edit.png") + ImageResource comment(); + + @Source("star_blue.png") + ImageResource like(); + + @Source("mail.png") + ImageResource message(); + + @Source("share_blue.png") + ImageResource share(); + + @Source("connection_new.png") + ImageResource connectionRequest(); + + @Source("job_ok.png") + ImageResource jobOK(); + + @Source("job_nok.png") + ImageResource jobNOK(); + + @Source("notification-generic.png") + ImageResource generic(); +} diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/comment_edit.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/comment_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..d31e68afd46127033e13d31fe84317a56e66c564 GIT binary patch literal 3511 zcmV;o4M_5dP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?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TPrxZHUyjO0)wDMge?rkG@@vz(NIaJZze@^=HB=2X)%+Qw5S9B z#XWF-=i~B+e~s&$%HGRP^$zxyvUjsn+~72TUsX5I3N-&!=Q-24r}JV@x+it5)^UXb1xhIt016SI?d~?rIzz@Kd2%F2@8c|QSzzq#`xy-c zTI=|S@0QTXA5+HzkM+qIvtMUfI<~Z&zkMiI!RJ)HrrPO8Ibv>p0srF|c$y&Hg+k+; zPg8Rf`lezR@a(v7>b~N+0Cjxx0F(k7I>vK3GMf{$v}`7ypCpWg$O$JJP9jNQ#K*#bPLIN4YkSmK@A`xj6NKo zV|tWLu?T{I$?034!R@45+R&a5T0;;7IB|HDZ(v@9pzdRIbrrj9CPXs+y?_hyen;0~&$EDnBj) kAF8HPfCYyC;@kg=pAjiTH!4x8Z~y=R07*qoM6N<$g3I(u8~^|S literal 0 HcmV?d00001 diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/job_nok.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/job_nok.png new file mode 100644 index 0000000000000000000000000000000000000000..eb70d41aa1049ab37738e95aa63f6c18bc73f805 GIT binary patch literal 820 zcmV-41Izr0P)U+xMf0xrMU@)=2lu+n_6wUmznu5J(NME2M&CEd>p>Z`G9G#etDS&0HK1p(&}Z4 zoYU3GQzcuES6w_%=B)ebUD&*{*thw_5^Gq?4GxE2^mk7yuys|rTDznCpqgD6UFzq% z0(K)5ben67-TD>X}*U$<8(xgD+Tk~2XZN{C@XAow{f*Qad>Trm( zOJcgUEAHqSnh+g-jS#NcbaA<#?h4rT5SS@}QS^<=(fXL{a^HllbB-lh;1IehmWbuwO0rO<1ER`+TeK)Hl2bfPLFHl$^;Mcx(k% z87JU^pgTFE^Kb`WCJzqBj4@xZxmZiBbxUb47)AXT&*k&iTW(Lb`QlYHmQ`4iD7OFD z$OJ)q!uR0n$eg|5hixNLFh57CoS7)|kkm{;4G5}3C5H0vx#ru(7f>#Nae^!s(`}m>`640*$Z?g@~eF zk#U6pK<%CldsRZScY6nqDulThCrEKQ*`L-PIS6y*SW*>SK;oR>wV@3>O?j_=X7-*- zH=64I_@HLT%910256>Wkl?wtU2sj70__Z|70VW7Oo66AHkwEF4hNf?S`5;?G1?RAI zB|R@kP1`7A1eE_KBk0$)fnie_Qb9BQiX8gS%AerriYoc-_r{#Hg$|?CCm9Q$q? ysZ_t8i7}<8p{em3fVQa~@IM5DLCaL}zxWBr;Ao_cVt;1<0000|Ja9#+>>B(^lK`@)=2dZW=X0RU2t;HT3E z_6Ih352sR@gqkN6a&UzS3eFjrU`VI4uVqc>0$gqXaq#mqCoWzG069l+=i1=;a0Cs-Ue70$?w+AXS6oWa7%9Z8}QOf*&|8XTcGM?qh1zn4Mwg!uVA}T0) zyT?zS`uXCe+?wIgK&;f`oppNE&4dxW=$q{hT}iZb2X9Qu%PK#Sm#ucyY6WnR|23;R z^!Lx@C{-#Jq z_Ai&L)eaGsl?Wq{@~KPC<13O8%NYp(+P-gT(R8U~)s~O;$rf&x=8FaH+j(o+ckdg4;&8y~c`ZChFYb;$!RQH?SR%5y=$_}e-;#YUc7 zfWNcjO8gxk*xmU7B20B`F!^{Uk$z<|6Iqr)mYFb_iRn@DeC8Dy5xVI%inQtvtel!c zZ)U={{j4W`&|a$eH5;j%2(xa&NCtY=HE~ZpI(&_{rX$8*1AYJAj>TdE0Mr~os6WI* z{h{js;HhoCnWe03IEdZ4OL&~C#F5Oj6#nD)KjQ#y&h>yFpsK1$ohyGI{{c0wfm76V Riw6Jz002ovPDHLkV1oCsmYM(n literal 0 HcmV?d00001 diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/mail.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/mail.png new file mode 100644 index 0000000000000000000000000000000000000000..e5eab71301c53eb1d5bdc792ef717c071779d2ef GIT binary patch literal 502 zcmV&HRO@Gi!!f=F3nVsmYtvW=$hdI!Gvei5i%Pk$ z1Xwp7cWwmi9si*IEhMYb!lKy$TnF|~LaL1(+nXiwYaT$V0f3SYK_SQCX^-}=F%P!_ zTR literal 0 HcmV?d00001 diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/notification-generic.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/notification-generic.png new file mode 100644 index 0000000000000000000000000000000000000000..654713d2e8c61dc11338509686a5a0fe61844f06 GIT binary patch literal 653 zcmV;80&@L{P)0v@6g~IO%ZD*3wM~)IB8Y{85EMnb>B3buZru16TnPSw zf{PRiU5ZdBxN{*c+^SH7RD`-wq=G@De$*zhwRxE|eSI%^A2TlAN0Xx9h07gg=AJp{ z%q4_zrd%$cBO?4y2qDzk+S+H|_r18|`p!e zkJ6cRHauf65oiFU?*@>Ti^=gEhzLxiDWb~>EoKNIz|7#NiYVXJn%Mm1;Mwaf_`U{n z(sm3$(aVB41R;jq^Kj(2=yqD@xjh(#93H)_;m59(0K~H9q?8*V3MDXOYkLomU%Ur| zfx!20er5&$;QJmr2R7b*_<8SZQ>_?-42VJlnHfj61M|Sb*~w{)jOB4?2T(x($LXQd zIY1WHLv5Qk5&(`2<0uIlo1eCE!7E^V+(0Uog6n$db}g8#7Jl!webVliV-F(dV+LcR zBbb^vg)F+T+uu;g=W#lhLnfO+aWtdt!~I+B?}rPC2bN`Ra2UxP#K6yAy}`%s6il;? ze6WkVx99b>E0>CmMx$*EF^Dpe6@3>QDeTJzu1+f4oS%mfLKBe!fCK=8lQ#gQl)~KQ zisT1xq(QmHIBj-!SEVi_mbN-21r z4yS6A<>udnyxd$9yhDP@O!A$_G(!a!>U$8lB`7Z>kWt5tXC(WqvYmzRtG nP=Rzht(KOS_Ds`MC(r%>ulewYb#aS-00000NkvXXu0mjfbJr*W literal 0 HcmV?d00001 diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/share_blue.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/share_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..bf1fe18f63852a3b62a111e866bdf6666224b21e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?$?=wI}+4+w9i%$AV?1(LXkE+^Lg(^xNr>0^0{0Z8m`; z50>-ak?u{1?p(RP^Wr|4<4fzz^FnTL?U@}avGT-}Ez>lny6srTYNRlykN3%hi?290 zyBv7T+4<0Gik@gdWXMOiUF&8iT17b2oqzb&_qp7jjI(Y#qY~;SnM%uuZ@u{EceI6C z$FI+tt+VnMr~bO>x@@XT`ND>k-OzAK%nv7lnfK%1WO#$20LTI9|8#I=cSV8&JvY>FVdQ I&MBb@0K)1{2LJ#7 literal 0 HcmV?d00001 diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/star_blue.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/star_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..55e41c3e46ea3d8c309bcdbea480e36c64551d1b GIT binary patch literal 1582 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%s|1+P|wiV z#N6CmN5ROz&_Lh7NZ-&%*U;R`*vQJjKmiJrfVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8EkR}&8R-I5=oVMzl_XZ^<`pZ$OmImpPAEg{v+u2}(t{7puX=A(aKG z`a!A1`K3k4z=%sz23b{L-^Aq1JP;qO z-q+X4Gq1QLF)umQ)5TT^Xo6m5W{Q=mp{aqXskwoPo4JLdp{tRjiMfH3skw=Pp_7TJ zv#A?QuSMv>2~2MaLa!lCy`ZF!TL84#CABECEH%ZgC_h&L>}9J=oNh65#c3W? zZwgMgn7QH9s}FRHJ}6?5A{r(HOg$hbJlO&{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%k|2Q_413-^$jg8EkR}&8R-I5=oVMzl_XZ^<`pZ$OmImpPAEg{v+u2}(t{7puX=A(aKG z`a!A1`K3k4z=%sz23b{L-^Aq1JP;qO z-q+X4Gq1QLF)umQ)5TT^Xo6m5W{Q=wlZl0;xr>vDo4J9Zp{tRjiMfH3skw=Pp_7TJ zv#A?QuSMv>2~2MaLa#GUy`ZF!TL84#CABECEH%ZgC_h&L>}9J=+-|YNX&zK> z3U0SJ;?%1Tbc{YIVv!;mCIn19ASOK70y*%6pPC0u?M1+3z5S-1H3I{azo(01NX4xs zlYR4r93_tbH{Se)DagyAOCoobxausaq^ip=I=@9FU+QL`9QQVTWBdWjKjv_aW&O3B5o zs^4bWu6cThR+m?c&>er)q^)UOM+A zE$#iSwX|iqgv}$VbBfcJZ#OV6?b*%v>vOw;*EiW8%NY&3PFfrgx9sCS$8s_AdDM(~ zdpQgLiYc9~ZSm4|X*#e}L*Po=$2kQD#dpkWaho)u|0>UwTRjbCv;Hz4kB?^wUzwo) zk`I5~yE_~un&%sY$iJM?p!aXrg1N`yf68ACSbv-Cwb=&^?Sf=8@9ED4KTBLXtLODB zeM_J7h08gcrYydwv4lNe?O5R2cL`Ci4=*m6y8p_9iAGadUFRjL-Em#JuRWwju8VW! z>t6yJ_WiqK!1MRi-`k#dPWuEd(ufS|6+NEex!|b`ug~%8S-E-1$;liVB3uir_WoNJ zP_fy2>w~#pC$v1M`F;7D-_56hwGd{GowhGLhyL> toReturn = new HashMap>(); try { for (Notification notification : store.getAllNotificationByUser(getASLSession().getUsername(), 20)) { - if (! toReturn.containsKey(notification.getTime())) { + Date dateWithoutTime = removeTimePart(notification.getTime()); + if (! toReturn.containsKey(dateWithoutTime)) { ArrayList nots = new ArrayList(); nots.add(notification); - toReturn.put(notification.getTime(), nots); + toReturn.put(dateWithoutTime, nots); } else { - toReturn.get(notification.getTime()).add(notification); + toReturn.get(dateWithoutTime).add(notification); } } } catch (Exception e) { @@ -127,4 +129,21 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No } return toReturn; } + /** + * we want notification split per day + * @param date + * @return the date passad as param with time part set to 00:00:00.0 + */ + private Date removeTimePart(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + + // Set time fields to zero + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + + return cal.getTime(); + } } diff --git a/src/main/webapp/Notifications.css b/src/main/webapp/Notifications.css index 9476af5..8194dbe 100644 --- a/src/main/webapp/Notifications.css +++ b/src/main/webapp/Notifications.css @@ -3,6 +3,21 @@ table { border-spacing: 0; } +a.link,a.link:active,a.link:visited { + font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, + sans-serif; + font-size: 12px; + cursor: pointer; + cursor: hand; + text-decoration: none; + color: #3B5998; +} + +a.link:hover { + opacity: 0.8; + text-decoration: underline; +} + .day-wrapper { width: 100%; border-bottom-color: #DADADA; @@ -12,15 +27,20 @@ table { } .day-label { - color: #333; - font-size: 12px; + color: #444444; font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; - line-height: 14px; + font-size: 14px; + font-weight: bold; + line-height: 13px; + padding-bottom: 5px; + padding-top: 5px; } .single-notification-table { width: 100%; + padding: 5px; + border-top: 1px solid #E9E9E9; } .no-notification-message { @@ -40,7 +60,8 @@ table { color: #999; font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; - font-size: 11px; + font-size: 12px; + padding-left: 10px; white-space: nowrap; } @@ -49,9 +70,10 @@ table { color: #333; font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; - font-size: 11px; + font-size: 12px; border-color: #999; border-width: 1px; letter-spacing: normal; white-space: nowrap; + padding-left: 10px; } \ No newline at end of file