From ca85658975dd6c85fbe5cc725698fe3a34d1234e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 15 Jun 2018 18:00:23 +0200 Subject: Add autofollow option to invites (#7805) * Add autofollow option to invites * Trigger CodeClimate rebuild --- app/views/auth/registrations/new.html.haml | 5 +++++ app/views/authorize_follows/_card.html.haml | 14 ++++++++++++-- app/views/invites/_form.html.haml | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/auth/registrations/new.html.haml b/app/views/auth/registrations/new.html.haml index 2d4c0f5ac..0fac8e10d 100644 --- a/app/views/auth/registrations/new.html.haml +++ b/app/views/auth/registrations/new.html.haml @@ -7,6 +7,11 @@ = simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| = render 'shared/error_messages', object: resource + - if @invite.present? && @invite.autofollow? + .fields-group{ style: 'margin-bottom: 30px' } + %p.hint{ style: 'text-align: center' }= t('invites.invited_by') + = render 'authorize_follows/card', account: @invite.user.account + = f.simple_fields_for :account do |ff| .input-with-append = ff.input :username, autofocus: true, placeholder: t('simple_form.labels.defaults.username'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off' } diff --git a/app/views/authorize_follows/_card.html.haml b/app/views/authorize_follows/_card.html.haml index 9abcfd37e..edc03131f 100644 --- a/app/views/authorize_follows/_card.html.haml +++ b/app/views/authorize_follows/_card.html.haml @@ -1,4 +1,5 @@ .account-card + .account-card__header{ style: "background-image: url(#{account.header.url(:original)})" } .detailed-status__display-name %div = image_tag account.avatar.url(:original), alt: '', width: 48, height: 48, class: 'avatar' @@ -9,5 +10,14 @@ %strong.emojify= display_name(account, custom_emojify: true) %span @#{account.acct} - - if account.note? - .account__header__content.emojify= Formatter.instance.simplified_format(account) + .counter + %span.counter-number= number_to_human account.statuses_count, strip_insignificant_zeros: true + %span.counter-label= t('accounts.posts') + + .counter + %span.counter-number= number_to_human account.following_count, strip_insignificant_zeros: true + %span.counter-label= t('accounts.following') + + .counter + %span.counter-number= number_to_human account.followers_count, strip_insignificant_zeros: true + %span.counter-label= t('accounts.followers') diff --git a/app/views/invites/_form.html.haml b/app/views/invites/_form.html.haml index 3f0871f47..42a107bb2 100644 --- a/app/views/invites/_form.html.haml +++ b/app/views/invites/_form.html.haml @@ -5,5 +5,8 @@ = f.input :max_uses, wrapper: :with_label, collection: [1, 5, 10, 25, 50, 100], label_method: lambda { |num| I18n.t('invites.max_uses', count: num) }, prompt: I18n.t('invites.max_uses_prompt') = f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].map(&:to_i), label_method: lambda { |i| I18n.t("invites.expires_in.#{i}") }, prompt: I18n.t('invites.expires_in_prompt') + .fields-group + = f.input :autofollow, wrapper: :with_label + .actions = f.button :button, t('invites.generate'), type: :submit -- cgit