philomena/lib/philomena_web/templates/channel/_channel_box.html.slime
2024-06-06 22:28:35 +02:00

39 lines
1.6 KiB
Text

- link_class = "media-box__header media-box__header--channel media-box__header--link"
.media-box
a.media-box__header.media-box__header--channel.media-box__header--link href=~p"/channels/#{@channel}" title=@channel.title
= @channel.title || @channel.short_name
.media-box__header.media-box__header--channel
= if @channel.is_live do
.spacing--right.label.label--success.label--block.label--small: strong LIVE NOW
=> @channel.viewers
=> pluralize "viewer", "viewers", @channel.viewers
- else
.label.label--danger.label--block.label--small: strong OFF AIR
= if @channel.nsfw do
.media-box__overlay
| NSFW
.media-box__content.media-box__content--channel
a href=~p"/channels/#{@channel}"
.image-constrained.media-box__content--channel
img src=channel_image(@channel) alt="#{@channel.title}"
= if @channel.associated_artist_tag do
a href=~p"/tags/#{@channel.associated_artist_tag}" class=link_class
i.fa.icon--padded.small.fa-tags>
= @channel.associated_artist_tag.name
- else
.media-box__header.media-box__header--channel No artist tag
= if can?(@conn, :edit, @channel) do
a href=~p"/channels/#{@channel}/edit" class=link_class
i.fas.icon--padded.small.fa-edit>
' Edit
a href=~p"/channels/#{@channel}" class=link_class data-method="delete" data-confirm="Are you really, really sure?"
i.fas.icon--padded.small.fa-trash>
' Delete
= render PhilomenaWeb.Channel.SubscriptionView, "_subscription.html", conn: @conn, watching: @subscriptions[@channel.id], channel: @channel