upload limits: add time remaining until next upload to profiles (fix #3262).

This commit is contained in:
evazion
2017-08-10 23:52:47 -05:00
parent bf3101da48
commit 1ef363dd68
3 changed files with 8 additions and 3 deletions

View File

@@ -63,11 +63,12 @@ class UserPresenter
end
end
def upload_limit
def upload_limit(template)
if user.can_upload_free?
return "none"
end
slots_tooltip = "Next free slot: #{template.time_ago_in_words(user.next_free_upload_slot)}"
limit_tooltip = <<-EOS.strip_heredoc
Base: #{user.base_upload_limit}
Del. Rate: #{"%.2f" % user.adjusted_deletion_confidence}
@@ -75,7 +76,7 @@ class UserPresenter
Upload Limit: #{user.base_upload_limit} * #{"%.2f" % user.upload_limit_multiplier} = #{user.max_upload_limit}
EOS
%{#{user.used_upload_slots} / <abbr title="#{limit_tooltip}">#{user.upload_limit}</abbr>}.html_safe
%{<abbr title="#{slots_tooltip}">#{user.used_upload_slots}</abbr> / <abbr title="#{limit_tooltip}">#{user.max_upload_limit}</abbr>}.html_safe
end
def uploads