liftmodules / widgets

A collection of useful widgets for use with Lift
12 stars 18 forks source link

gravatar using id #2

Open MasseGuillaume opened 11 years ago

MasseGuillaume commented 11 years ago

https://github.com/liftmodules/widgets/blob/9ae73ce461ba1762098a76dd2bdc3b43687d995b/src/main/scala/net/liftmodules/widgets/gravatar/Gravatar.scala#L67

please change id="gravatar_image" to class="gravatar" as id must be unique and you can use this widget multiple times in a single page.

d6y commented 11 years ago

Presumably we should do the same for gravatar_wrapper too?

Perhaps an idea would be to have a method on the object to just get the image URL so anyone can use the class to create whatever kind of mark up they like.

MasseGuillaume commented 11 years ago

yes I think this widget should just create something like

private def html(in: String, alt: String, class: Option[String]): NodeSeq = {
    <img src={in} alt={alt} class={class} />
  }
d6y commented 11 years ago

If we want to change the behaviour, we should discuss that on the mailing list.

Adding additional behaviour may be nicer for anyone currently using the widget. This could do with some unit tests/specs too, to make sure we don't break compatibility.

Anyone using Gravatar/Widgets want to take this on? Otherwise, I'll get round to it at some point.