Skip to content

Commit 09a425c

Browse files
committed
Merge branch 'release/0.7.12.0'
2 parents dc7c5ff + 1e8a96d commit 09a425c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+821
-309
lines changed

Changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 0.7.12.0
2+
3+
## Refactor
4+
* Harmonize markdown titles sizes [#8029](https://github.com/diaspora/diaspora/pull/8029)
5+
6+
## Bug fixes
7+
* Improve handling of mixed case hostnames while fetching OpenGraph data [#8021](https://github.com/diaspora/diaspora/pull/8021)
8+
* Fix "remember me" with two factor authentication enabled [#8031](https://github.com/diaspora/diaspora/pull/8031)
9+
10+
## Features
11+
* Add line mentioning diaspora\* on the splash page [#7966](https://github.com/diaspora/diaspora/pull/7966)
12+
* Improve communication about signing up on closed pods [#7896](https://github.com/diaspora/diaspora/pull/7896)
13+
114
# 0.7.11.0
215

316
## Refactor

app/assets/stylesheets/home.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
padding: 15px;
4343
}
4444

45+
.part-of-diaspora {
46+
font-style: italic;
47+
48+
a {
49+
color: $white;
50+
}
51+
}
52+
4553
.login-form {
4654
fieldset { background: none; }
4755

app/assets/stylesheets/markdown-content.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,30 @@
1616
}
1717
}
1818

19+
h1 {
20+
font-size: 2.7rem;
21+
}
22+
23+
h2 {
24+
font-size: 2.3rem;
25+
}
26+
27+
h3 {
28+
font-size: 2rem;
29+
}
30+
31+
h4 {
32+
font-size: 1.8rem;
33+
}
34+
35+
h5 {
36+
font-size: 1.6rem;
37+
}
38+
39+
h6 {
40+
font-size: 1.4rem;
41+
}
42+
1943
.img-responsive {
2044
display: inline;
2145
}

app/assets/stylesheets/registration.scss

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.page-registrations.action-new,
2-
.page-registrations.action-create {
1+
.page-registrations {
32
.ball {
43
background: image-url('branding/ball.png') no-repeat;
54
background-size: contain;
@@ -12,19 +11,24 @@
1211
height: 633px;
1312
}
1413

14+
@media (max-width: $screen-xs-max) {
15+
.v-center {
16+
height: auto;
17+
}
18+
}
19+
1520
.content {
1621
display: table-cell;
1722
vertical-align: middle;
1823

19-
h2 {
24+
h1 {
2025
font-size: 35px;
21-
margin: 12px;
22-
text-align: center;
26+
margin: 12px 0;
2327
}
2428
}
2529

2630
form {
27-
max-width: 400px;
31+
max-width: 500px;
2832
}
2933

3034
.captcha-img {
@@ -34,16 +38,13 @@
3438
width: 120px;
3539
}
3640

37-
.captcha-input {
41+
.form-control.captcha-input {
3842
border-bottom: 1px solid $input-border;
3943
border-bottom-left-radius: 5px;
4044
border-bottom-right-radius: 5px;
4145
box-sizing: border-box;
42-
font-size: 16px;
43-
height: 40px;
4446
line-height: $line-height-base;
45-
padding: 10px 10px 10px 130px;
46-
width: 100%;
47+
padding-left: 130px;
4748
}
4849

4950
.terms > a {

app/controllers/registrations_controller.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# the COPYRIGHT file.
66

77
class RegistrationsController < Devise::RegistrationsController
8-
before_action :check_registrations_open_or_valid_invite!
8+
before_action :check_registrations_open_or_valid_invite!, except: :registrations_closed
99

10-
layout -> { request.format == :mobile ? "application" : "with_header" }
10+
layout -> { request.format == :mobile ? "application" : "with_header_with_footer" }
1111

1212
def create
1313
@user = User.build(user_params)
@@ -28,13 +28,17 @@ def create
2828
end
2929
end
3030

31+
def registrations_closed
32+
render "registrations/registrations_closed"
33+
end
34+
3135
private
3236

3337
def check_registrations_open_or_valid_invite!
3438
return true if AppConfig.settings.enable_registrations? || invite.try(:can_be_used?)
3539

36-
flash[:error] = params[:invite] ? t("registrations.invalid_invite") : t("registrations.closed")
37-
redirect_to new_user_session_path
40+
flash[:error] = t("registrations.invalid_invite") if params[:invite]
41+
redirect_to registrations_closed_path
3842
end
3943

4044
def invite

app/controllers/sessions_controller.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ class SessionsController < Devise::SessionsController
1212
# rubocop:enable Rails/LexicallyScopedActionFilter
1313

1414
def find_user
15-
return User.find(session[:otp_user_id]) if session[:otp_user_id]
15+
return User.find_for_authentication(username: params[:user][:username]) if params[:user][:username]
1616

17-
User.find_for_authentication(username: params[:user][:username]) if params[:user][:username]
17+
User.find(session[:otp_user_id]) if session[:otp_user_id]
1818
end
1919

2020
def authenticate_with_2fa
2121
self.resource = find_user
22-
u = find_user
2322

24-
return true unless u&.otp_required_for_login?
23+
return true unless resource&.otp_required_for_login?
2524

2625
if params[:user][:otp_attempt].present? && session[:otp_user_id]
27-
authenticate_with_two_factor_via_otp(u)
28-
elsif u&.valid_password?(params[:user][:password])
29-
prompt_for_two_factor(u)
26+
authenticate_with_two_factor_via_otp(resource)
27+
else
28+
strategy = Warden::Strategies[:database_authenticatable].new(warden.env, :user)
29+
prompt_for_two_factor(strategy.user) if strategy.valid? && strategy._run!.successful?
3030
end
3131
end
3232

app/models/open_graph_cache.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def self.find_or_create_by(opts)
3333
end
3434

3535
def fetch_and_save_opengraph_data!
36-
object = OpenGraphReader.fetch!(self.url)
36+
uri = URI.parse(url.start_with?("http") ? url : "http://#{url}")
37+
uri.normalize!
38+
object = OpenGraphReader.fetch!(uri)
3739

3840
return unless object
3941

app/models/user.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,10 @@ def after_database_authentication
591591
end
592592
end
593593

594+
def remember_me
595+
true
596+
end
597+
594598
private
595599

596600
def clearable_fields

app/views/devise/passwords/edit.haml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
autocorrect: "off",
3838
aria: {labelledby: "passwordConfirmationLabel"}
3939

40-
= hidden_field(:user, :remember_me, value: 1)
4140
= f.submit t("devise.passwords.edit.change_password"), class: "btn btn-block btn-primary"
4241

4342
.text-center

app/views/home/default.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
.row
55
.col-md-8.text-center
66
%h1= t("home.default.headline", pod_name: pod_name)
7+
- if pod_name != "diaspora*"
8+
%h2.part-of-diaspora
9+
!= t("home.default.part_of_diaspora",
10+
diaspora_site_link: link_to(t("home.default.diaspora_site_link"), "https://diasporafoundation.org/"))
711
%h2= t("home.default.byline")
812
.col-md-4.login-form
913
= render partial: "sessions/form", locals: {mobile: false, resource: User.new, resource_name: :user}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%ul.nav.navbar-nav.navbar-right
2-
- if AppConfig.settings.enable_registrations? && !current_page?(controller: "/registrations", action: :new)
2+
- unless current_page?(controller: "/registrations", action: :new)
33
%li= link_to t("devise.shared.links.sign_up"), new_user_registration_path, class: "login"
44
- unless current_page?(controller: "/sessions", action: :new)
55
%li= link_to t("devise.shared.links.sign_in"), new_user_session_path, class: "login"

app/views/registrations/_form.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- if mobile
55
%legend
66
= image_tag("branding/logos/header-logo2x.png", height: 40, width: 40)
7-
= t("aspects.aspect_stream.make_something")
7+
= AppConfig.settings.pod_name
88

99
- if mobile
1010
= f.label :email, t("registrations.new.email"), class: "control-label", id: "emailLabel"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
%h2
2+
= t("devise.shared.links.sign_up_closed")
3+
4+
!= t("registrations.closed.closed_pod",
5+
wiki: link_to(t("registrations.closed.another_pod"), "https://diasporafoundation.org/getting_started/sign_up"))
6+
7+
!= t("registrations.closed.find_pods",
8+
poduptime: link_to("Poduptime", "https://podupti.me/"))
9+
10+
!= t("registrations.closed.other_questions",
11+
wiki: link_to("Wiki", "https://wiki.diasporafoundation.org/Choosing_a_pod"))

app/views/registrations/new.haml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#registration
22
.container
33
.row
4-
.col-md-10.offset1
5-
.col-md-7.hidden-phone
6-
%h1.ball
7-
.col-md-5.v-center
8-
.content.text-center
9-
%h2#pod-name
10-
= AppConfig.settings.pod_name
4+
.col-sm-6.hidden-xs
5+
.ball
6+
.col-sm-6.col-xs-12.v-center
7+
.content.text-center
8+
%h1#pod-name
9+
= AppConfig.settings.pod_name
1110

12-
= render partial: "form", locals: {mobile: false}
11+
= render partial: "form", locals: {mobile: false}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#registration
2+
.container
3+
.row
4+
.col-sm-6.hidden-xs
5+
.ball
6+
.col-sm-6.col-xs-12.v-center
7+
.content
8+
= render partial: "registrations_closed"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
.stream#main-stream
3+
- flash.each do |name, msg|
4+
.expose#flash-container
5+
.flash-message{class: "message alert alert-#{flash_class name}", role: "alert"}
6+
= msg
7+
8+
.login-form
9+
.login-container
10+
= render partial: "registrations_closed"

app/views/sessions/_form.haml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@
4040
autocorrect: "off",
4141
aria: {labelledby: "passwordLabel"}
4242

43-
= f.hidden_field :remember_me, value: 1
4443
= f.submit t("devise.sessions.new.sign_in"), class: "btn btn-large btn-block btn-primary"

config/defaults.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
defaults:
66
version:
7-
number: "0.7.11.0" # Do not touch unless doing a release, do not backport the version number that's in master
7+
number: "0.7.12.0" # Do not touch unless doing a release, do not backport the version number that's in master
88
heroku: false
99
environment:
1010
url: "http://localhost:3000/"

config/initializers/devise.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ def to_mobile
1515
# Use this hook to configure devise mailer, warden hooks and so forth.
1616
# Many of these configuration options can be set straight in your model.
1717
Devise.setup do |config|
18-
config.warden do |manager|
19-
manager.default_strategies(scope: :user).unshift :two_factor_authenticatable
20-
manager.default_strategies(scope: :user).unshift :two_factor_backupable
21-
end
22-
2318
# The secret key used by Devise. Devise uses this key to generate
2419
# random tokens. Changing this key will render invalid all existing
2520
# confirmation, reset password and unlock tokens in the database.

config/locales/devise/devise.pt-BR.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pt-BR:
8686
remember_me: "Lembre-se de mim"
8787
sign_in: "Entrar"
8888
username: "Nome de usuário"
89-
signed_in: "Você entrou com sucesso."
89+
signed_in: "Você entrou."
9090
signed_out: "Você saiu com sucesso."
9191
shared:
9292
links:

config/locales/diaspora/ar.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ ar:
442442
updated: "تم تحديث ملفك الشخصى"
443443
public: "عامّ"
444444
registrations:
445-
closed: "التسجيلات مغلقة على هذه المنصة"
446445
create:
447446
success: "لقد انضممت الى دياسبرا "
448447
new:

0 commit comments

Comments
 (0)