diff --git a/Rakefile b/Rakefile index ab71e59f..8e99145c 100644 --- a/Rakefile +++ b/Rakefile @@ -227,66 +227,6 @@ namespace :justask do puts "#{user.screen_name} is no longer banned." end - desc "Gives blogger status to an user." - task :blog, [:screen_name] => :environment do |t, args| - fail "screen name required" if args[:screen_name].nil? - user = User.find_by_screen_name(args[:screen_name]) - fail "user #{args[:screen_name]} not found" if user.nil? - user.blogger = true - user.save! - puts "#{user.screen_name} is now a blogger." - end - - desc "Removes blogger status from an user." - task :unblog, [:screen_name] => :environment do |t, args| - fail "screen name required" if args[:screen_name].nil? - user = User.find_by_screen_name(args[:screen_name]) - fail "user #{args[:screen_name]} not found" if user.nil? - user.blogger = false - user.save! - puts "#{user.screen_name} is no longer a blogger." - end - - desc "Gives supporter status to an user." - task :sup, [:screen_name] => :environment do |t, args| - fail "screen name required" if args[:screen_name].nil? - user = User.find_by_screen_name(args[:screen_name]) - fail "user #{args[:screen_name]} not found" if user.nil? - user.supporter = true - user.save! - puts "#{user.screen_name} is now an supporter." - end - - desc "Removes supporter status from an user." - task :desup, [:screen_name] => :environment do |t, args| - fail "screen name required" if args[:screen_name].nil? - user = User.find_by_screen_name(args[:screen_name]) - fail "user #{args[:screen_name]} not found" if user.nil? - user.supporter = false - user.save! - puts "#{user.screen_name} is no longer an supporter." - end - - desc "Gives contributor status to an user." - task :contrib, [:screen_name] => :environment do |t, args| - fail "screen name required" if args[:screen_name].nil? - user = User.find_by_screen_name(args[:screen_name]) - fail "user #{args[:screen_name]} not found" if user.nil? - user.contributor = true - user.save! - puts "#{user.screen_name} is now a contributor." - end - - desc "Removes contributor status from an user." - task :decontrib, [:screen_name] => :environment do |t, args| - fail "screen name required" if args[:screen_name].nil? - user = User.find_by_screen_name(args[:screen_name]) - fail "user #{args[:screen_name]} not found" if user.nil? - user.contributor = false - user.save! - puts "#{user.screen_name} is no longer a contributor." - end - desc "Lists all users." task lusers: :environment do User.all.each do |u| @@ -489,119 +429,4 @@ namespace :justask do print "\033[0m" end end - - desc "Export data for an user" - task :export, [:email] => :environment do |t, args| - require 'json' - require 'yaml' - return if args[:email].nil? - obj = {} - format = '%t (%c/%C) [%b>%i] %e' - u = User.where("LOWER(email) = ?", args[:email].downcase).first! - export_dirname = "export_#{u.screen_name}_#{Time.now.to_i}" - export_filename = u.screen_name - - %i(id screen_name display_name created_at sign_in_count last_sign_in_at friend_count follower_count asked_count answered_count commented_count smiled_count motivation_header bio website location moderator admin supporter banned blogger).each do |f| - obj[f] = u.send f - end - - total = u.questions.count - progress = ProgressBar.create title: 'Processing questions', format: format, starting_at: 0, total: total - obj[:questions] = [] - u.questions.each do |q| - qobj = {} - %i(id content author_is_anonymous created_at answer_count).each do |f| - qobj[f] = q.send f - end - obj[:questions] << qobj - progress.increment - end - - total = u.answers.count - progress = ProgressBar.create title: 'Processing answers', format: format, starting_at: 0, total: total - obj[:answers] = [] - u.answers.each do |a| - aobj = {} - %i(id content comment_count smile_count created_at).each do |f| - aobj[f] = a.send f - end - aobj[:question] = {} - %i(id content author_is_anonymous created_at answer_count).each do |f| - aobj[:question][f] = a.question.send f - end - aobj[:question][:user] = a.question.user.screen_name unless a.question.author_is_anonymous - aobj[:comments] = [] - a.comments.each do |c| - cobj = {} - %i(id content created_at).each do |f| - cobj[f] = c.send f - end - cobj[:user] = c.user.screen_name - aobj[:comments] << cobj - end - obj[:answers] << aobj - progress.increment - end - - total = u.comments.count - progress = ProgressBar.create title: 'Processing comments', format: format, starting_at: 0, total: total - obj[:comments] = [] - u.comments.each do |c| - cobj = {} - %i(id content created_at).each do |f| - cobj[f] = c.send f - end - cobj[:answer] = {} - %i(id content comment_count smile_count created_at).each do |f| - cobj[:answer][f] = c.answer.send f - end - cobj[:answer][:question] = {} - %i(id content author_is_anonymous created_at answer_count).each do |f| - cobj[:answer][:question][f] = c.answer.question.send f - end - cobj[:answer][:question][:user] = c.answer.question.user.screen_name unless c.answer.question.author_is_anonymous - obj[:comments] << cobj - progress.increment - end - - total = u.smiles.count - progress = ProgressBar.create title: 'Processing smiles', format: format, starting_at: 0, total: total - obj[:smiles] = [] - u.smiles.each do |s| - sobj = {} - %i(id created_at).each do |f| - sobj[f] = s.send f - end - - sobj[:answer] = {} - %i(id content comment_count smile_count created_at).each do |f| - sobj[:answer][f] = s.answer.send f - end - sobj[:answer][:question] = {} - %i(id content author_is_anonymous created_at answer_count).each do |f| - sobj[:answer][:question][f] = s.answer.question.send f - end - sobj[:answer][:question][:user] = s.answer.question.user.screen_name unless s.answer.question.author_is_anonymous - - obj[:smiles] << sobj - progress.increment - end - - `mkdir -p /usr/home/justask/justask/public/export` - `mkdir -p /tmp/rs_export/#{export_dirname}/picture` - if u.profile_picture - %i(large medium small original).each do |s| - x = u.profile_picture.path(s).gsub('"', '\\"') - `cp "#{x}" "/tmp/rs_export/#{export_dirname}/picture/#{s}_#{File.basename x}"` - end - end - File.open "/tmp/rs_export/#{export_dirname}/#{export_filename}.json", 'w' do |f| - f.puts obj.to_json - end - File.open "/tmp/rs_export/#{export_dirname}/#{export_filename}.yml", 'w' do |f| - f.puts obj.to_yaml - end - `tar czvf public/export/#{export_dirname}.tar.gz -C /tmp/rs_export #{export_dirname}` - puts "\033[1mhttps://retrospring.net/export/#{export_dirname}.tar.gz\033[0m" - end end diff --git a/app/assets/javascripts/moderation/ban.coffee b/app/assets/javascripts/moderation/ban.coffee index 0529a8af..fecd10cf 100644 --- a/app/assets/javascripts/moderation/ban.coffee +++ b/app/assets/javascripts/moderation/ban.coffee @@ -1,22 +1,27 @@ load = -> - parent = $ "#ban-control-super" - return unless parent.length > 0 + return unless document.getElementById('ban-control-super') != null + modalEl = $("#modal-ban") + modalEl.modal "hide" + modalForm = modalEl.find("form")[0] + banCheckbox = modalForm.querySelector('[name="ban"][type="checkbox"]') + permabanCheckbox = modalForm.querySelector('[name="permaban"][type="checkbox"]') - parent.find('#_ban').on "change", (event) -> + banCheckbox.addEventListener "change", (event) -> $t = $ this if $t.is(":checked") $("#ban-controls").show() else $("#ban-controls").hide() - parent.find('#_permaban').on "change", (event) -> + permabanCheckbox.addEventListener "change", (event) -> $t = $ this if $t.is(":checked") $("#ban-controls-time").hide() else $("#ban-controls-time").show() - parent.find("#until").datetimepicker - defaultDate: parent.find("#until").val() + untilInput = $ modalForm.elements["until"] + untilInput.datetimepicker + defaultDate: untilInput.val() sideBySide: true icons: time: "fa fa-clock-o" @@ -29,23 +34,21 @@ load = -> clear: "fa fa-trash-o" close: "fa fa-times" - parent.parent()[0].addEventListener "submit", (event) -> + modalForm.addEventListener "submit", (event) -> event.preventDefault(); - $("#modal-ban").modal "hide" - - checktostr = (selector) -> - if $(selector)[0].checked + checktostr = (el) -> + if el.checked "1" else "0" data = { - ban: checktostr "#_ban" - permaban: checktostr "#_permaban" - until: $("#until")[0].value.trim() - reason: $("#reason")[0].value.trim() - user: $("#_user")[0].value + ban: checktostr banCheckbox + permaban: checktostr permabanCheckbox + until: modalForm.elements["until"].value.trim() + reason: modalForm.elements["reason"].value.trim() + user: modalForm.elements["user"].value } $.ajax diff --git a/app/controllers/ajax/moderation_controller.rb b/app/controllers/ajax/moderation_controller.rb index 9ec82abb..dda91f54 100644 --- a/app/controllers/ajax/moderation_controller.rb +++ b/app/controllers/ajax/moderation_controller.rb @@ -164,9 +164,9 @@ class Ajax::ModerationController < ApplicationController target_user = User.find_by_screen_name(params[:user]) @message = I18n.t('messages.moderation.privilege.nope') - return unless %w(blogger supporter moderator admin contributor translator).include? params[:type].downcase + return unless %w(moderator admin).include? params[:type].downcase - if %w(supporter moderator admin).include?(params[:type].downcase) && !current_user.has_role?(:administrator) + unless current_user.has_role?(:administrator) @status = :nopriv @message = I18n.t('messages.moderation.privilege.nopriv') @success = false @@ -176,21 +176,11 @@ class Ajax::ModerationController < ApplicationController @checked = status type = params[:type].downcase target_role = {"admin" => "administrator"}.fetch(type, type).to_sym - case type - when 'blogger' - target_user.blogger = status - when 'contributor' - target_user.contributor = status - when 'translator' - target_user.translator = status - when 'supporter' - target_user.supporter = status - when 'moderator', 'admin' - if status - target_user.add_role target_role - else - target_user.remove_role target_role - end + + if status + target_user.add_role target_role + else + target_user.remove_role target_role end target_user.save! diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 449a5171..1fc494d8 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -17,7 +17,7 @@ class StaticController < ApplicationController end def about - @admins = User.where(admin: true).order(:id) + end def faq diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ea0c4fa1..7e00636b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -89,15 +89,6 @@ module ApplicationHelper ((!current_user.nil?) && ((current_user == user) || current_user.mod?)) ? true : false end - # @deprecated Use {User#profile_picture.url} instead. - def gravatar_url(user) - return user.profile_picture.url :medium - # return '/cage.png' - #return '//www.gravatar.com/avatar' if user.nil? - #return "//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user)}" if user.is_a? String - #"//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user.email)}" - end - def ios_web_app? user_agent = request.env['HTTP_USER_AGENT'] || 'Mozilla/5.0' # normal MobileSafari.app UA: Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B435 Safari/600.1.4 diff --git a/app/models/user.rb b/app/models/user.rb index 033579c6..2e43c3e0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -70,7 +70,6 @@ class User < ApplicationRecord process_in_background :profile_header before_save do - self.display_name = 'WRYYYYYYYY' if display_name == 'Dio Brando' self.website = if website.match %r{\Ahttps?://} website else diff --git a/app/views/answerbox/_comments.haml b/app/views/answerbox/_comments.haml index d51d096d..17eacd2b 100644 --- a/app/views/answerbox/_comments.haml +++ b/app/views/answerbox/_comments.haml @@ -7,7 +7,7 @@ %div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "modal/comment_smiles", comment: comment .media.comments--media .pull-left - %img.img-rounded.answerbox--img{src: gravatar_url(comment.user)} + %img.img-rounded.answerbox--img{src: comment.user.profile_picture.url(:medium)} .media-body.comments--body %h6.media-heading.answerbox--question-user = user_screen_name comment.user diff --git a/app/views/answerbox/_header.haml b/app/views/answerbox/_header.haml index 282116c1..db7b486e 100644 --- a/app/views/answerbox/_header.haml +++ b/app/views/answerbox/_header.haml @@ -2,7 +2,7 @@ .media.question-media - unless a.question.author_is_anonymous %a.pull-left{href: show_user_profile_path(a.question.user.screen_name)} - %img.img-rounded.answerbox--img{src: gravatar_url(a.question.user)} + %img.img-rounded.answerbox--img{src: a.question.user.profile_picture.url(:medium)} .media-body.question-body - if user_signed_in? .pull-right diff --git a/app/views/answerbox/_smiles.haml b/app/views/answerbox/_smiles.haml index 4e3db771..119086a6 100644 --- a/app/views/answerbox/_smiles.haml +++ b/app/views/answerbox/_smiles.haml @@ -7,4 +7,4 @@ - else - a.smiles.all.each do |smile| %a{href: show_user_profile_path(smile.user.screen_name), title: smile.user.screen_name, data: { toggle: :tooltip, placement: :top, smile_id: smile.id }} - %img.img-rounded.answerbox--img-small{src: gravatar_url(smile.user)} \ No newline at end of file + %img.img-rounded.answerbox--img-small{src: smile.user.profile_picture.url(:medium)} \ No newline at end of file diff --git a/app/views/application/_answerbox.haml b/app/views/application/_answerbox.haml index 1c1566b9..43d86916 100644 --- a/app/views/application/_answerbox.haml +++ b/app/views/application/_answerbox.haml @@ -19,7 +19,7 @@ .media .pull-left %a{href: show_user_profile_path(a.user.screen_name)} - %img.img-rounded.answerbox--img{src: gravatar_url(a.user)} + %img.img-rounded.answerbox--img{src: a.user.profile_picture.url(:medium)} .media-body %h6.media-heading.answerbox--answer-user = raw t('views.answerbox.answered', hide: hidespan(t('views.answerbox.hide'), "xs"), user: user_screen_name(a.user)) diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 9fa0ec04..fa42ad80 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -3,7 +3,7 @@ .media - unless i.question.author_is_anonymous %a.pull-left{href: show_user_profile_path(i.question.user.screen_name)} - %img.img-rounded.answerbox--img{src: gravatar_url(i.question.user)} + %img.img-rounded.answerbox--img{src: i.question.user.profile_picture.url(:medium)} .media-body %h6.text-muted.media-heading.answerbox--question-user = raw t('views.inbox.entry.asked', user: user_screen_name(i.question.user, anonymous: i.question.author_is_anonymous), time: time_tooltip(i.question)) diff --git a/app/views/inbox/_sidebar.html.haml b/app/views/inbox/_sidebar.html.haml index c460ad5f..4cda09a0 100644 --- a/app/views/inbox/_sidebar.html.haml +++ b/app/views/inbox/_sidebar.html.haml @@ -8,7 +8,7 @@ %a.btn.btn-block.btn-primary{target: '_blank', href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}"} %i.fa.fa-fw.fa-twitter = raw t('views.inbox.sidebar.share.button', service: "Twitter") - %a.btn.btn-block.btn-primary{target: '_blank', href: "http://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"} + %a.btn.btn-block.btn-primary{target: '_blank', href: "https://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"} %i.fa.fa-fw.fa-tumblr = raw t('views.inbox.sidebar.share.button', service: "Tumblr") .card.inbox--panel diff --git a/app/views/modal/_comment_smiles.haml b/app/views/modal/_comment_smiles.haml index 8eeb73c1..53f5caef 100644 --- a/app/views/modal/_comment_smiles.haml +++ b/app/views/modal/_comment_smiles.haml @@ -14,5 +14,5 @@ - comment.smiles.all.each do |smile| %li.user-list-entry.user-list-entry-smiles %a{href: show_user_profile_path(smile.user.screen_name)} - %img.img-rounded{src: gravatar_url(smile.user), alt: user_screen_name(smile.user, url: false)} + %img.img-rounded{src: smile.user.profile_picture.url(:medium), alt: user_screen_name(smile.user, url: false)} %span= user_screen_name(smile.user, url: false) diff --git a/app/views/modal/_privileges.haml b/app/views/modal/_privileges.haml index 0fb30de0..3fda929e 100644 --- a/app/views/modal/_privileges.haml +++ b/app/views/modal/_privileges.haml @@ -8,11 +8,7 @@ %span{"aria-hidden" => "true"} × %span.sr-only= t 'views.actions.close' %ul.list-group.groups--list - = render 'modal/privileges/item', privilege: 'blogger', description: t('views.modal.privilege.blogger'), user: @user - = render 'modal/privileges/item', privilege: 'contributor', description: t('views.modal.privilege.contributor'), user: @user - = render 'modal/privileges/item', privilege: 'translator', description: t('views.modal.privilege.translator'), user: @user - if current_user.has_role?(:administrator) - = render 'modal/privileges/item', privilege: 'supporter', description: t('views.modal.privilege.supporter'), user: @user = render 'modal/privileges/item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user = render 'modal/privileges/item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user .modal-footer diff --git a/app/views/moderation/_discussion.html.haml b/app/views/moderation/_discussion.html.haml index 2872f42a..6e791284 100644 --- a/app/views/moderation/_discussion.html.haml +++ b/app/views/moderation/_discussion.html.haml @@ -6,7 +6,7 @@ %li{data: { comment_id: comment.id }} .media.comments--media .pull-left - %img.img-rounded.answerbox--img{src: gravatar_url(comment.user)} + %img.img-rounded.answerbox--img{src: comment.user.profile_picture.url(:medium)} .media-body.comments--body %h6.media-heading.answerbox--question-user = user_screen_name comment.user diff --git a/app/views/moderation/_moderationbox.html.haml b/app/views/moderation/_moderationbox.html.haml index 2f74aba7..78daa565 100644 --- a/app/views/moderation/_moderationbox.html.haml +++ b/app/views/moderation/_moderationbox.html.haml @@ -1,7 +1,7 @@ - unless report.nil? or report.target.nil? or report.user.nil? or report.type.nil? .card.moderationbox{data: { id: report.id }} .card-header - %img.img-rounded.answerbox--img{src: gravatar_url(report.user)} + %img.img-rounded.answerbox--img{src: report.user.profile_picture.url(:medium)} = raw t('views.moderation.moderationbox.reported', user: user_screen_name(report.user), content: report.type.sub('Reports::', ''), time: time_tooltip(report)) .card-body %p diff --git a/app/views/settings/_data.haml b/app/views/settings/_data.haml index 35f0c3d1..f0d277d9 100644 --- a/app/views/settings/_data.haml +++ b/app/views/settings/_data.haml @@ -106,42 +106,6 @@ - else %span.label.label-danger %i.fa.fa-fw.fa-close - - %p.data-heading Supporter - %p - - if current_user.supporter? - %span.label.label-success - %i.fa.fa-fw.fa-check - - else - %span.label.label-danger - %i.fa.fa-fw.fa-close - - %p.data-heading Contributor - %p - - if current_user.contributor? - %span.label.label-success - %i.fa.fa-fw.fa-check - - else - %span.label.label-danger - %i.fa.fa-fw.fa-close - - %p.data-heading Blogger - %p - - if current_user.blogger? - %span.label.label-success - %i.fa.fa-fw.fa-check - - else - %span.label.label-danger - %i.fa.fa-fw.fa-close - - %p.data-heading Translator - %p - - if current_user.translator? - %span.label.label-success - %i.fa.fa-fw.fa-check - - else - %span.label.label-danger - %i.fa.fa-fw.fa-close .row .col-md-6.col-sm-6.col-xs-12 %h3 IP diff --git a/app/views/settings/_profile.haml b/app/views/settings/_profile.haml index a6abf43b..9cf1a88c 100644 --- a/app/views/settings/_profile.haml +++ b/app/views/settings/_profile.haml @@ -40,7 +40,7 @@ = f.text_field :motivation_header, label: t('views.settings.profile.motivation'), placeholder: t('views.settings.profile.placeholder.motivation') - = f.text_field :website, label: t('views.settings.profile.website'), placeholder: 'http://example.com' + = f.text_field :website, label: t('views.settings.profile.website'), placeholder: 'https://example.com' = f.text_field :location, label: t('views.settings.profile.location'), placeholder: t('views.settings.profile.placeholder.location') diff --git a/app/views/shared/_links.html.haml b/app/views/shared/_links.html.haml index 17d1d71c..fc06b75c 100644 --- a/app/views/shared/_links.html.haml +++ b/app/views/shared/_links.html.haml @@ -5,7 +5,7 @@ · = link_to t('views.general.about'), about_path · - = link_to "GitHub", 'https://github.com/retrospring/retrospring' + = link_to "GitHub", 'https://github.com/Retrospring/retrospring' · = link_to t('views.general.terms'), terms_path · diff --git a/app/views/shared/_question_header.haml b/app/views/shared/_question_header.haml index 790d89e1..1eadf01d 100644 --- a/app/views/shared/_question_header.haml +++ b/app/views/shared/_question_header.haml @@ -4,7 +4,7 @@ .media.question-media - unless question.author_is_anonymous %a.pull-left{href: unless hidden then show_user_profile_path(question.user.screen_name) end} - %img.img-rounded.answerbox--img{src: gravatar_url(question.user)} + %img.img-rounded.answerbox--img{src: question.user.profile_picture.url(:medium)} .media-body.question-body - if user_signed_in? .pull-right diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml index 8042cdcf..de63f8a1 100644 --- a/app/views/static/about.html.haml +++ b/app/views/static/about.html.haml @@ -29,7 +29,7 @@ .col-md-4 %h3= t 'views.about.opensource.title' %p= t('views.about.opensource.warning', app_title: APP_CONFIG['site_name']) - %p= raw t('views.about.opensource.desc', app_title: APP_CONFIG['site_name'], github: link_to(t('views.about.opensource.github'), "https://github.com/Retrospring/retrospring"), bugtracker: link_to(t('views.about.opensource.bugtracker'), "https://github.com/Retrospring/bugs")) + %p= raw t('views.about.opensource.desc', app_title: APP_CONFIG['site_name'], github: link_to(t('views.about.opensource.github'), "https://github.com/Retrospring/retrospring"), bugtracker: link_to(t('views.about.opensource.bugtracker'), "https://github.com/Retrospring/retrospring/issues")) .col-md-4 %a{href: "https://github.com/Retrospring/retrospring"} .icon-showcase @@ -37,14 +37,6 @@ %h4.heading-about.text-center= t 'views.about.repository.title' %p.text-center %em= t 'views.about.repository.desc' - .col-md-4 - %h3= t 'views.about.contributors.title' - %p= t('views.about.contributors.desc', app_title: APP_CONFIG['site_name']) - %p= raw t('views.about.contributors.howto', fork: link_to(t('views.about.contributors.fork'), "https://github.com/retrospring/retrospring")) - %ul.about--moderator - - User.where(contributor: true).each do |sup| - %a{href: show_user_profile_path(sup.screen_name), title: sup.screen_name, data: { toggle: :tooltip, placement: :top }} - %img.img-rounded.answerbox--img-small{src: sup.profile_picture.url(:medium)} .card .card-body .row @@ -57,9 +49,9 @@ %h2.entry-text#answered-count= Answer.count %h4.entry-subtext= t('views.general.answer').pluralize(Answer.count) .col-md-3.col-sm-6.col-xs-6.statistics - %h2.entry-text#asked-count= Comment.count + %h2.entry-text#comment-count= Comment.count %h4.entry-subtext= t('views.general.comment').pluralize(Comment.count) - %h2.entry-text#answered-count= Smile.count + CommentSmile.count + %h2.entry-text#smile-count= Smile.count + CommentSmile.count %h4.entry-subtext= t('views.general.smile').pluralize(Smile.count) .col-md-3.col-sm-12.col-xs-12.users .entry-text#follower-count= User.count diff --git a/app/views/static/front.html.haml b/app/views/static/front.html.haml index bdfcba2c..27a1e6b9 100644 --- a/app/views/static/front.html.haml +++ b/app/views/static/front.html.haml @@ -88,7 +88,7 @@ We don't like them ourselves, really. = APP_CONFIG['site_name'] just runs with community funding over - %a{href: "http://patreon.com/retrospring"} Patreon + %a{href: "https://patreon.com/retrospring"} Patreon which is way better than displaying annoying stuff. .col-md-4.col-sm-4.col-xs-12 %h3 @@ -103,7 +103,7 @@ .card-body %p Any questions? Ask us on - %a{href: "https://twitter.com/retrospringnet"} Twitter + %a{href: "https://twitter.com/retrospring"} Twitter or visit one of the administrator profiles you can find on the %a{href: about_path} About page! diff --git a/config/locales/en.yml b/config/locales/en.yml index 23636ddb..bf3b2a0d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -438,19 +438,11 @@ en: name: "Group name" members: "members" privilege: - blogger: "The user gets that privilege if they blogged something (nice) about Retrospring." - contributor: "This user has contributed to justask (the software behind Retrospring)." - supporter: "This user monetarily supports the site." moderator: "Someone trustworthy enough to help managing reports." admin: "This user is part of the core team." - translator: "This user helped translating Retrospring into their language." user: follows_you: "Follows you" title: admin: "Admin" moderator: "Moderator" - supporter: "Supporter" - contributor: "Contributor" - blogger: "Blogger" banned: "Banned" - translator: "Translator" diff --git a/db/migrate/20200425194536_remove_unused_profile_flags.rb b/db/migrate/20200425194536_remove_unused_profile_flags.rb new file mode 100644 index 00000000..8ce20806 --- /dev/null +++ b/db/migrate/20200425194536_remove_unused_profile_flags.rb @@ -0,0 +1,10 @@ +class RemoveUnusedProfileFlags < ActiveRecord::Migration[5.2] + def change + remove_column :users, :admin + remove_column :users, :blogger + remove_column :users, :contributor + remove_column :users, :moderator + remove_column :users, :supporter + remove_column :users, :translator + end +end diff --git a/db/schema.rb b/db/schema.rb index 1b8db168..91feb5b1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_04_19_185535) do +ActiveRecord::Schema.define(version: 2020_04_25_194536) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -241,12 +241,10 @@ ActiveRecord::Schema.define(version: 2020_04_19_185535) do t.integer "commented_count", default: 0, null: false t.string "display_name" t.integer "smiled_count", default: 0, null: false - t.boolean "admin", default: false, null: false t.string "motivation_header", default: "", null: false t.string "website", default: "", null: false t.string "location", default: "", null: false t.text "bio", default: "", null: false - t.boolean "moderator", default: false, null: false t.string "profile_picture_file_name" t.string "profile_picture_content_type" t.integer "profile_picture_file_size" @@ -256,14 +254,11 @@ ActiveRecord::Schema.define(version: 2020_04_19_185535) do t.integer "crop_y" t.integer "crop_w" t.integer "crop_h" - t.boolean "supporter", default: false t.boolean "privacy_allow_anonymous_questions", default: true t.boolean "privacy_allow_public_timeline", default: true t.boolean "privacy_allow_stranger_answers", default: true t.boolean "privacy_show_in_search", default: true t.boolean "permanently_banned", default: false - t.boolean "blogger", default: false - t.boolean "contributor", default: false t.string "ban_reason" t.datetime "banned_until" t.integer "comment_smiled_count", default: 0, null: false @@ -277,7 +272,6 @@ ActiveRecord::Schema.define(version: 2020_04_19_185535) do t.integer "crop_h_w" t.integer "crop_h_h" t.string "locale", default: "en" - t.boolean "translator", default: false t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" diff --git a/lib/exporter.rb b/lib/exporter.rb index 1086708f..f84ce038 100644 --- a/lib/exporter.rb +++ b/lib/exporter.rb @@ -34,15 +34,14 @@ class Exporter private def collect_user_info - %i(answered_count asked_count ban_reason banned_until bio blogger comment_smiled_count commented_count - confirmation_sent_at confirmed_at contributor created_at crop_h crop_h_h crop_h_w crop_h_x crop_h_y + %i(answered_count asked_count ban_reason banned_until bio comment_smiled_count commented_count + confirmation_sent_at confirmed_at created_at crop_h crop_h_h crop_h_w crop_h_x crop_h_y crop_w crop_x crop_y current_sign_in_at current_sign_in_ip display_name email follower_count friend_count id last_sign_in_at last_sign_in_ip locale location motivation_header permanently_banned privacy_allow_anonymous_questions privacy_allow_public_timeline privacy_allow_stranger_answers privacy_show_in_search profile_header_content_type profile_header_file_name profile_header_file_size profile_header_updated_at profile_picture_content_type profile_picture_file_name profile_picture_file_size - profile_picture_updated_at screen_name show_foreign_themes sign_in_count smiled_count supporter translator - updated_at website).each do |f| + profile_picture_updated_at screen_name show_foreign_themes sign_in_count smiled_count updated_at website).each do |f| @obj[f] = @user.send f end @@ -229,9 +228,8 @@ class Exporter def user_stub(user) uobj = {} - %i(answered_count asked_count bio blogger comment_smiled_count commented_count contributor created_at - display_name follower_count friend_count id location motivation_header permanently_banned screen_name - smiled_count supporter translator website).each do |f| + %i(answered_count asked_count bio comment_smiled_count commented_count created_at display_name follower_count + friend_count id location motivation_header permanently_banned screen_name smiled_count website).each do |f| uobj[f] = user.send f end diff --git a/public/404.html b/public/404.html index 1614037a..ddae1139 100644 --- a/public/404.html +++ b/public/404.html @@ -48,7 +48,7 @@
-