lato 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 617a6a9833946efc6beec01f4727fc13341a2c1993e03e82dcc82a07b7971779
4
- data.tar.gz: 16670fad7ed0c70aeb2458ff7a0f82e26ee989f4e53f4a1dbe873e8bfae5c897
3
+ metadata.gz: 1db687404de50caa57771e92de805873276c6c6c5ab0270f0b2c937c5a2c92a0
4
+ data.tar.gz: 7c33db6b23a3882e887b5b49487e1f5ce021a92fc25e375cda1969d546e381e5
5
5
  SHA512:
6
- metadata.gz: 15b916ded489425afa8fed3d3af9160324dc2836a37a101e191c3fb5076940b960e7d1898ef7899690ac2a1e993bd39f8c799534f93e01819bf823f8ee3cfca0
7
- data.tar.gz: e801ceb370f8bd980c2d95a8d57fe60064767c502e4745f20b5f458ddf10b5ea293fdad61d7b8d07609ade0378de9a51c21d70453246020202914cc7bc69eb0d
6
+ metadata.gz: 80b25b7e6839a24be9a5041a1dbcc854a8d9257defb4fa5c6d8fd0cf62524bc846e332933324701885be9d359384ae02b5ac00e45f3f7cb0fcbdd6eaedf189f4
7
+ data.tar.gz: 1c66a00b3a9bfc71cb471df3eaec398d668271094527c88a8e25b01e8af977843dceaea955916fa9d8d6191fa5432259ebda300d551e42c20d7c308d31941372
@@ -14,6 +14,10 @@ module Lato
14
14
  redirect_to @session.valid? ? session_root_path : lato.authentication_signin_path
15
15
  end
16
16
 
17
+ def offline
18
+ respond_to_with_offline
19
+ end
20
+
17
21
  def not_found
18
22
  respond_to_with_not_found
19
23
  end
@@ -52,11 +56,19 @@ module Lato
52
56
  end
53
57
  end
54
58
 
59
+ def respond_to_with_offline
60
+ hide_sidebar
61
+ respond_to do |format|
62
+ format.html { render 'lato/errors/offline', status: :service_unavailable }
63
+ format.json { render json: { error: 'Network not available' }, status: :service_unavailable }
64
+ end
65
+ end
66
+
55
67
  def respond_to_with_not_found
56
68
  hide_sidebar
57
69
  respond_to do |format|
58
70
  format.html { render 'lato/errors/not_found', status: :not_found }
59
- format.json { render json: {}, status: :not_found }
71
+ format.json { render json: { error: 'Resource not found' }, status: :not_found }
60
72
  end
61
73
  end
62
74
 
@@ -0,0 +1,11 @@
1
+ <div class="w-100 h-100 d-flex justify-content-center align-items-center" style="min-height: calc(100vh - 54px - 2rem)">
2
+ <div class="card w-100" style="max-width: 600px">
3
+ <div class="card-header">
4
+ <h1 class="fs-3 mb-0 text-center">Network not available</h1>
5
+ </div>
6
+ <div class="card-body text-center">
7
+ <p class="lead">Seems like you are offline.</p>
8
+ <p class="lead">You need to be connected to the internet to use this app.</p>
9
+ </div>
10
+ </div>
11
+ </div>
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  Lato::Engine.routes.draw do
2
2
  root 'application#index'
3
+ get 'offline', to: 'application#offline', as: :offline
3
4
  get 'not_found', to: 'application#not_found', as: :not_found
4
5
  get 'error', to: 'application#error', as: :error
5
6
 
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
@@ -169,6 +169,7 @@ files:
169
169
  - app/views/lato/components/_sidebar_nav_item.html.erb
170
170
  - app/views/lato/errors/error.html.erb
171
171
  - app/views/lato/errors/not_found.html.erb
172
+ - app/views/lato/errors/offline.html.erb
172
173
  - app/views/lato/mailer/invitation/invite_mail.html.erb
173
174
  - app/views/lato/mailer/user/email_verification_mail.html.erb
174
175
  - app/views/lato/mailer/user/password_update_mail.html.erb