Mark private and featured asciicasts
This commit is contained in:
parent
d9a754685a
commit
6f0d55b22a
@ -105,3 +105,13 @@
|
||||
font-size: 12px
|
||||
margin-bottom: 5px
|
||||
padding: 6px
|
||||
|
||||
.special-label
|
||||
font-size: 12px
|
||||
background-color: rgb(255, 239, 198)
|
||||
color: rgb(161, 136, 43)
|
||||
margin-left: 6px
|
||||
padding: 2px 5px
|
||||
border-radius: 4px
|
||||
vertical-align: middle
|
||||
cursor: help
|
||||
|
@ -126,6 +126,14 @@ class AsciicastPagePresenter
|
||||
routes.oembed_url(url: routes.asciicast_url(asciicast), format: format)
|
||||
end
|
||||
|
||||
def show_private_label?
|
||||
asciicast.private?
|
||||
end
|
||||
|
||||
def show_featured_label?
|
||||
asciicast.featured?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def author
|
||||
|
1
app/views/asciicasts/_featured_label.html.erb
Normal file
1
app/views/asciicasts/_featured_label.html.erb
Normal file
@ -0,0 +1 @@
|
||||
<span class="special-label" title="This is a *featured* asciicast - it's listed on the homepage too.">featured</span>
|
@ -10,6 +10,10 @@
|
||||
.info.clearfix
|
||||
h2
|
||||
= link_to asciicast.title, asciicast
|
||||
- if asciicast.private?
|
||||
= render 'asciicasts/private_label'
|
||||
- if asciicast.featured?
|
||||
= render 'asciicasts/featured_label'
|
||||
span.duration = asciicast.formatted_duration
|
||||
span.author-avatar = asciicast.author_img_link
|
||||
small by #{asciicast.author_link} #{time_ago_tag asciicast.created_at}
|
||||
|
1
app/views/asciicasts/_private_label.html.erb
Normal file
1
app/views/asciicasts/_private_label.html.erb
Normal file
@ -0,0 +1 @@
|
||||
<span class="special-label" title="Private asciicasts are not listed on the site and are hidden from search engines. However they're visible to anyone you give the URL.">private</span>
|
@ -14,7 +14,12 @@
|
||||
.row
|
||||
.col-md-8.col-xs-8
|
||||
span.author-avatar = page.author_img_link
|
||||
h2 = page.asciicast_title
|
||||
h2
|
||||
= page.asciicast_title
|
||||
- if page.show_private_label?
|
||||
= render 'private_label'
|
||||
- if page.show_featured_label?
|
||||
= render 'featured_label'
|
||||
small by #{page.author_link} #{time_ago_tag page.asciicast_created_at}
|
||||
|
||||
.col-md-4.col-xs-4.text-right
|
||||
|
Loading…
Reference in New Issue
Block a user