feat: add approval rating to stories

This commit is contained in:
Neetpone 2024-04-13 18:32:56 -04:00
parent 9bc91be23f
commit 3ed7bf9d38
4 changed files with 12 additions and 14 deletions

View file

@ -530,12 +530,7 @@ a.submit2.cancel:active {
display: inline-block; display: inline-block;
margin: 0 0 0 5px; margin: 0 0 0 5px;
} }
.fic-cell .popular {
display: block;
float: left;
overflow: hidden;
padding: 5px 10px;
}
.fic-cell .description { .fic-cell .description {
overflow: hidden; overflow: hidden;
border: solid #adc 1px; border: solid #adc 1px;
@ -3293,7 +3288,7 @@ body.story,
.fic-cell header, .fic-cell header,
.fic-cell .details, .fic-cell .details,
.user .name { .user .name {
overflow: auto; overflow: hidden;
} }
.fic-cell .description a, .fic-cell .description a,
.fic-data .u { .fic-data .u {

View file

@ -22,7 +22,7 @@ class ImagesController < ApplicationController
if File.exist? path if File.exist? path
content_type = Marcel::MimeType.for Pathname.new(path) content_type = Marcel::MimeType.for Pathname.new(path)
else else
content_type, body = fetch_image uri content_type, body = fetch_image parsed
File.binwrite path, body File.binwrite path, body
end end

View file

@ -119,7 +119,7 @@ div.search-adv
b Sort By b Sort By
br br
=> select_tag :sf, options_for_select({'Query Relevance' => 'rel', 'Title' => 'title', 'Author' => 'author', \ => select_tag :sf, options_for_select({'Query Relevance' => 'rel', 'Title' => 'title', 'Author' => 'author', \
'Publish Date' => 'date_published', 'Updated Date' => 'date_updated', 'Word Count' => 'num_words'}, @search_params[:sf]) 'Publish Date' => 'date_published', 'Updated Date' => 'date_updated', 'Word Count' => 'num_words', 'FiMFiction Rating' => 'rating'}, @search_params[:sf])
= select_tag :sd, options_for_select({'High to Low' => 'desc', 'Low to High' => 'asc'}, @search_params[:sd]) = select_tag :sd, options_for_select({'High to Low' => 'desc', 'Low to High' => 'asc'}, @search_params[:sd])
- if show_button - if show_button
.buttons .buttons

View file

@ -13,11 +13,14 @@ section.fic-cell
br br
span.popular span.popular
span.stats span.stats
- if story.short_description - if story.rating
p.description= story.short_description span.likes
- else | Rating: #{story.rating}%
div.description - if story.short_description
== story.description_html p.description= story.short_description
- else
div.description
== story.description_html
footer footer
.rating .rating
= rating_display(story.rating) = rating_display(story.rating)