@import ru.yandex.tours.model.Image @import ru.yandex.tours.model.image.ImageFormats @import ru.yandex.tours.db.tables.LinkType @import views.Utils @(comparison: HotelComparison, link: Option[LinkWithInfo], linkAuthor: Option[User], inCluster: Boolean)(implicit req: RequestHeader) @import comparison.similarity @import comparison.distance @import comparison.hotel1 @import comparison.hotel2 @h1 = @{comparison.rawHotel1} @h2 = @{comparison.rawHotel2} @p1 = @{comparison.partner1} @p2 = @{comparison.partner2} @cl(similarity: Double) = @{ if(similarity <= 0.3) { "label-danger" } else if(similarity >= 0.7) { "label-success" } else { "label-default" } } @img(image: Image) = { } @main(s"$p1 vs. $p2") {

Похожесть

@similarity.formatted("%.3f")

Расстояние

@if(distance > 1d) { @distance.formatted("%.2f") км. } else { @((distance * 1000d).floor.toInt) м. }
@if(link.isEmpty) { Не слинкованы } @if(link.nonEmpty && link.get.isManual) { @if(link.get.`type` == LinkType.MERGE) { Склеены вручную } @if(link.get.`type` == LinkType.UNMERGE) { Расклеены вручную } } @if(link.nonEmpty && !link.get.isManual) { @if(link.get.`type` == LinkType.MERGE) { Склеены автоматически } @if(link.get.`type` == LinkType.UNMERGE) { Расклеены автоматически } }
@for(author <- linkAuthor) {
by @util.ya_login(author.login)
} @if(inCluster) {
В одном кластере
}

@views.Utils.hotelName(hotel1.hotel) @p1

@views.html.hotels.partner.general_info(hotel1.hotel, "") @util.block("") {
Рядом
@Speller.hotels(comparison.nearHotels.size)
Удален
@Messages(hotel1.isDeleted.toString)
Новый
@Messages(hotel1.isNew.toString)
Создан
@Utils.dateTimeFormat.print(hotel1.created)
Обновлен
@Utils.dateTimeFormat.print(hotel1.updated)
Кластер
@common.cluster_link(hotel1.id, hotel1.id.toString)
}

@views.Utils.hotelName(hotel2.hotel) @p2

@views.html.hotels.partner.general_info(hotel2.hotel, "") @util.block("") {
Рядом
@Speller.hotels(comparison.nearHotels.size)
Удален
@Messages(hotel2.isDeleted.toString)
Новый
@Messages(hotel2.isNew.toString)
Создан
@Utils.dateTimeFormat.print(hotel2.created)
Обновлен
@Utils.dateTimeFormat.print(hotel2.updated)
Кластер
@common.cluster_link(hotel2.id, hotel2.id.toString)
}
@util.block("Карта") { @views.html.util.map(Iterable(h1.getPoint, h2.getPoint), "width:100%;height:400px;margin-bottom:10px;", disableZoom = true) }

Одинаковые

@if(comparison.commonImages.isEmpty) { Нет общих фотографий } @for(cluster <- comparison.commonImages) {
@for(image <- cluster) { @img(image) }
}

Фотографии 1

@if(comparison.uniqueImages1.isEmpty) { Нет фотографий } @for(image <- comparison.uniqueImages1) { @img(image) }

Фотографии 2

@if(comparison.uniqueImages2.isEmpty) { Нет фотографий } @for(image <- comparison.uniqueImages2) { @img(image) }
}