check AppConfig.mail.enable? before displaying some view content
closes #7190
This commit is contained in:
parent
c7a0b053fa
commit
00ed1c9b39
6 changed files with 74 additions and 69 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
* Use string-direction gem for rtl detection [#7181](https://github.com/diaspora/diaspora/pull/7181)
|
* Use string-direction gem for rtl detection [#7181](https://github.com/diaspora/diaspora/pull/7181)
|
||||||
* Reduce i18n.load side effects [#7184](https://github.com/diaspora/diaspora/pull/7184)
|
* Reduce i18n.load side effects [#7184](https://github.com/diaspora/diaspora/pull/7184)
|
||||||
* Force jasmine fails on syntax errors [#7185](https://github.com/diaspora/diaspora/pull/7185)
|
* Force jasmine fails on syntax errors [#7185](https://github.com/diaspora/diaspora/pull/7185)
|
||||||
|
* Don't display mail-related view content if it is disabled in the pod's config [#7190](https://github.com/diaspora/diaspora/pull/7190)
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Fix fetching comments after fetching likes [#7167](https://github.com/diaspora/diaspora/pull/7167)
|
* Fix fetching comments after fetching likes [#7167](https://github.com/diaspora/diaspora/pull/7167)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ module SessionsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_password_reset_link?
|
def display_password_reset_link?
|
||||||
devise_mapping.recoverable? && controller_name != "passwords"
|
AppConfig.mail.enable? && devise_mapping.recoverable? && controller_name != "passwords"
|
||||||
end
|
end
|
||||||
|
|
||||||
def flash_class(name)
|
def flash_class(name)
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
- if controller_name != 'sessions'
|
- if controller_name != 'sessions'
|
||||||
= link_to t('.sign_in'), new_session_path(resource_name)
|
= link_to t('.sign_in'), new_session_path(resource_name)
|
||||||
%br/
|
%br/
|
||||||
- if AppConfig.settings.enable_registrations? && devise_mapping.registerable? && controller_name != 'registrations'
|
- if display_registration_link?
|
||||||
= link_to t('.sign_up'), new_registration_path(resource_name)
|
= link_to t('.sign_up'), new_registration_path(resource_name)
|
||||||
%br/
|
%br/
|
||||||
- else
|
- else
|
||||||
%b= t('.sign_up_closed')
|
%b= t('.sign_up_closed')
|
||||||
%br/
|
%br/
|
||||||
- if devise_mapping.recoverable? && controller_name != 'passwords'
|
- if display_password_reset_link?
|
||||||
= link_to t('.forgot_your_password'), new_password_path(resource_name)
|
= link_to t('.forgot_your_password'), new_password_path(resource_name)
|
||||||
%br/
|
%br/
|
||||||
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,33 @@
|
||||||
#paste_link
|
#paste_link
|
||||||
= t('.paste_link')
|
= t(".paste_link")
|
||||||
%span#codes_left
|
%span#codes_left
|
||||||
= "(" + t(".codes_left", count: @invite_code.count) + ")" unless AppConfig.settings.enable_registrations?
|
= "(" + t(".codes_left", count: @invite_code.count) + ")" unless AppConfig.settings.enable_registrations?
|
||||||
.form-horizontal
|
.form-horizontal
|
||||||
.control-group
|
.control-group
|
||||||
= invite_link(@invite_code)
|
= invite_link(@invite_code)
|
||||||
|
|
||||||
#email_invitation
|
- if AppConfig.mail.enable?
|
||||||
= form_tag new_user_invitation_path, class: 'form-horizontal' do
|
#email_invitation
|
||||||
|
= form_tag new_user_invitation_path, class: "form-horizontal" do
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
%label.col-sm-2.control-label{ for: 'email_inviter_emails' }
|
%label.col-sm-2.control-label{for: "email_inviter_emails"}
|
||||||
= t('email')
|
= t("email")
|
||||||
.col-sm-10
|
.col-sm-10
|
||||||
= text_field_tag 'email_inviter[emails]', @invalid_emails, title: t('.comma_separated_plz'),
|
= text_field_tag "email_inviter[emails]", @invalid_emails, title: t(".comma_separated_plz"),
|
||||||
placeholder: 'foo@bar.com, max@foo.com...', class: "form-control"
|
placeholder: "foo@bar.com, max@foo.com...", class: "form-control"
|
||||||
#already_sent
|
#already_sent
|
||||||
= t("invitations.create.note_already_sent", emails: @valid_emails) unless @valid_emails.empty?
|
= t("invitations.create.note_already_sent", emails: @valid_emails) unless @valid_emails.empty?
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
%label.col-sm-2.control-label{ for: 'email_inviter_locale' }
|
%label.col-sm-2.control-label{for: "email_inviter_locale"}
|
||||||
= t('.language')
|
= t(".language")
|
||||||
.col-sm-10
|
.col-sm-10
|
||||||
= select_tag 'email_inviter[locale]', options_from_collection_for_select(available_language_options,
|
= select_tag "email_inviter[locale]", options_from_collection_for_select(available_language_options,
|
||||||
"second", "first", selected: current_user.language), class: "form-control"
|
"second", "first", selected: current_user.language), class: "form-control"
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
.pull-right.col-md-12
|
.pull-right.col-md-12
|
||||||
= submit_tag t('.send_an_invitation'), class: 'btn btn-primary pull-right',
|
= submit_tag t(".send_an_invitation"), class: "btn btn-primary pull-right",
|
||||||
data: {disable_with: t('.sending_invitation')}
|
data: {disable_with: t(".sending_invitation")}
|
||||||
.clearfix
|
.clearfix
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
= t(".share_this")
|
= t(".share_this")
|
||||||
= invite_link(current_user.invitation_code)
|
= invite_link(current_user.invitation_code)
|
||||||
.invitations-link.btn.btn-link#invitations-button{"data-toggle" => "modal"}
|
|
||||||
|
- if AppConfig.mail.enable?
|
||||||
|
.invitations-link.btn.btn-link#invitations-button{"data-toggle" => "modal"}
|
||||||
= t(".by_email")
|
= t(".by_email")
|
||||||
|
|
||||||
- content_for :after_content do
|
- content_for :after_content do
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@
|
||||||
|
|
||||||
= render partial: "post_default"
|
= render partial: "post_default"
|
||||||
|
|
||||||
|
- if AppConfig.mail.enable?
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%h3
|
%h3
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue