thecore_ui_commons 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/trix/LICENSE +20 -0
- data/app/assets/config/trix/README.md +395 -0
- data/app/assets/config/trix/dist/trix-core.js +12 -0
- data/app/assets/config/trix/dist/trix.css +374 -0
- data/app/assets/config/trix/dist/trix.js +21 -0
- data/app/assets/config/trix/package.json +29 -0
- data/app/assets/images/android-chrome-192x192.png +0 -0
- data/app/assets/images/android-chrome-512x512.png +0 -0
- data/app/assets/images/apple-touch-icon.png +0 -0
- data/app/assets/images/favicon-16x16.png +0 -0
- data/app/assets/images/favicon-32x32.png +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/images/mstile-150x150.png +0 -0
- data/app/assets/images/safari-pinned-tab.svg +1042 -0
- data/app/assets/images/up-arrow.png +0 -0
- data/app/assets/javascripts/browserconfig.xml +9 -0
- data/app/assets/javascripts/ie.js +19 -0
- data/app/assets/javascripts/manifest.json +20 -0
- data/app/assets/javascripts/pages.coffee +3 -0
- data/app/assets/javascripts/thecore.js +20 -0
- data/app/assets/javascripts/timer.js +135 -0
- data/app/assets/stylesheets/{thecore_ui_commons/actiontext.scss → actiontext.scss} +19 -20
- data/app/assets/stylesheets/thecore.scss +18 -0
- data/app/views/contact_mailer/contact_message.html.erb +5 -0
- data/app/views/devise/confirmations/new.html.erb +16 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/password_change.html.erb +5 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/menu/_login_items.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +25 -0
- data/app/views/devise/passwords/new.html.erb +18 -0
- data/app/views/devise/registrations/edit.html.erb +45 -0
- data/app/views/devise/registrations/new.html.erb +29 -0
- data/app/views/devise/sessions/new.html.erb +28 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +16 -0
- data/app/views/kaminari/_first_page.html.erb +3 -0
- data/app/views/kaminari/_gap.html.erb +3 -0
- data/app/views/kaminari/_last_page.html.erb +3 -0
- data/app/views/kaminari/_next_page.html.erb +3 -0
- data/app/views/kaminari/_page.html.erb +9 -0
- data/app/views/kaminari/_paginator.html.erb +15 -0
- data/app/views/kaminari/_prev_page.html.erb +3 -0
- data/app/views/layouts/_footer.html.erb +3 -0
- data/app/views/layouts/_messages.html.erb +9 -0
- data/app/views/layouts/_navigation.html.erb +20 -0
- data/app/views/layouts/_navigation_links.html.erb +7 -0
- data/app/views/layouts/mailer.html.erb +6 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/layouts/thecore.html.erb +42 -0
- data/app/views/shared/_flash.html.erb +10 -0
- data/config/initializers/thecore_ui_commons_application_config.rb +4 -3
- data/db/migrate/20200515070620_add_username_to_user.rb +11 -0
- data/db/migrate/20200515132932_add_rememberable_to_user.rb +5 -0
- data/lib/concerns/thecore_ui_commons_user.rb +10 -0
- data/lib/thecore_ui_commons/version.rb +1 -1
- data/lib/thecore_ui_commons.rb +4 -2
- metadata +58 -4
- data/app/controllers/pages_controller.rb +0 -43
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to t("devise.sessions.new.sign_in"), new_session_path(resource_name), :class => "btn btn-success" %><br />
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to t("devise.registrations.new.sign_up"), new_registration_path(resource_name), :class => "btn btn-success" %><br />
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
10
|
+
<%= link_to t("devise.passwords.new.forgot_your_password"), new_password_path(resource_name), :class => "btn btn-success" %><br />
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to t("devise.shared.links.didn_t_receive_confirmation_instructions"), new_confirmation_path(resource_name), :class => "btn btn-success" %><br />
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to t("devise.shared.links.didn_t_receive_unlock_instructions"), new_unlock_path(resource_name), :class => "btn btn-success" %><br />
|
19
|
+
<% end -%>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to t("devise.shared.links.sign_in_with_provider", provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), :class => "btn btn-success" %><br />
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2><%=t("devise.unlocks.new.resend_unlock_instructions")%></h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<div class="field">
|
7
|
+
<%= f.label :email %><br />
|
8
|
+
<%= f.email_field :email, autofocus: true %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="actions">
|
12
|
+
<%= f.submit <%=t("devise.unlocks.new.resend_unlock_instructions")%> %>
|
13
|
+
|
14
|
+
<%= render "devise/shared/links" %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% if page.current? %>
|
2
|
+
<li class='active'>
|
3
|
+
<%= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)) %>
|
4
|
+
</li>
|
5
|
+
<% else %>
|
6
|
+
<li>
|
7
|
+
<%= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)) %>
|
8
|
+
</li>
|
9
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%= paginator.render do -%>
|
2
|
+
<ul class="pagination">
|
3
|
+
<%= first_page_tag unless current_page.first? %>
|
4
|
+
<%= prev_page_tag unless current_page.first? %>
|
5
|
+
<% each_page do |page| -%>
|
6
|
+
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
|
7
|
+
<%= page_tag page %>
|
8
|
+
<% elsif !page.was_truncated? -%>
|
9
|
+
<%= gap_tag %>
|
10
|
+
<% end -%>
|
11
|
+
<% end -%>
|
12
|
+
<%= next_page_tag unless current_page.last? %>
|
13
|
+
<%= last_page_tag unless current_page.last? %>
|
14
|
+
</ul>
|
15
|
+
<% end -%>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%# Rails flash messages styled for Bootstrap 3.0 %>
|
2
|
+
<% flash.each do |name, msg| %>
|
3
|
+
<% if msg.is_a?(String) %>
|
4
|
+
<div class="alert alert-<%= name == "notice" ? "success" : "danger" %>">
|
5
|
+
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
6
|
+
<%= content_tag :div, msg, :id => "flash_#{name}" %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<nav class="navbar navbar-inverse">
|
2
|
+
<div class="container">
|
3
|
+
<div class="navbar-header">
|
4
|
+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
5
|
+
<span class="sr-only">Toggle navigation</span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
<span class="icon-bar"></span>
|
9
|
+
</button>
|
10
|
+
<% if user_signed_in? %>
|
11
|
+
<%= link_to t(:dashboard), inside_path, class: 'navbar-brand' %>
|
12
|
+
<%end%>
|
13
|
+
</div>
|
14
|
+
<div class="collapse navbar-collapse">
|
15
|
+
<ul class="nav navbar-nav">
|
16
|
+
<%= render 'layouts/navigation_links' %>
|
17
|
+
</ul>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</nav>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="<%=I18n.locale%>">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
6
|
+
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
+
<title><%= Settings.app_name rescue "Thecore" %></title>
|
9
|
+
|
10
|
+
<%= tag("link", rel: "manifest", href: asset_path("manifest.json", skip_pipeline: true)) %>
|
11
|
+
<meta name="turbolinks-cache-control" content="no-cache">
|
12
|
+
<%= stylesheet_link_tag 'thecore', media: 'all', 'data-turbolinks-track' => true %>
|
13
|
+
<%= javascript_include_tag 'thecore', 'data-turbolinks-track' => true %>
|
14
|
+
|
15
|
+
<%= favicon_link_tag 'apple-touch-icon.png', rel: 'apple-touch-icon', sizes: "180x180" %>
|
16
|
+
<%= favicon_link_tag 'favicon-32x32.png', rel: 'icon', sizes: "32x32" %>
|
17
|
+
<%= favicon_link_tag 'favicon-16x16.png', rel: 'icon', sizes: "16x16" %>
|
18
|
+
<%= favicon_link_tag 'safari-pinned-tab.svg', rel: 'mask-icon', color: "#5bbad5" %>
|
19
|
+
<meta name="theme-color" content="#3b4e59">
|
20
|
+
|
21
|
+
<%= csrf_meta_tags %>
|
22
|
+
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
23
|
+
<!--[if lt IE 9]> <%= javascript_include_tag "ie" %> <![endif]-->
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
<div class="jumbotron vertical-center">
|
27
|
+
<div class="container">
|
28
|
+
<div class="col-md-4 col-md-offset-4 text-center">
|
29
|
+
<img class="main-menu-app-logo" style="width: 25%; max-width: 152px" src="<%= image_url('logo.png') %>"/>
|
30
|
+
</div>
|
31
|
+
<%- unless flash.empty? %>
|
32
|
+
<div class="col-md-4 col-md-offset-4" style="margin-top: 1em;">
|
33
|
+
<%= render partial: 'shared/flash' %>
|
34
|
+
</div>
|
35
|
+
<%-end%>
|
36
|
+
<%= yield %>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<%= render 'layouts/footer' %>
|
41
|
+
</body>
|
42
|
+
</html>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% flash.each do |type, message| %>
|
2
|
+
<%-unless [true, "true", :true].include? message%>
|
3
|
+
<div class="alert <%= bootstrap_class_for(type) %> fade in" role='alert'>
|
4
|
+
<button class="close" data-dismiss="alert">×</button>
|
5
|
+
<span class="glyphicon <%= bootstrap_glyphs_icon(type)%>" aria-hidden="true"></span>
|
6
|
+
<span class="sr-only"><%= type.capitalize%>:</span>
|
7
|
+
<%= message %>
|
8
|
+
</div>
|
9
|
+
<%-end%>
|
10
|
+
<% end %>
|
@@ -10,11 +10,8 @@ Rails.application.configure do
|
|
10
10
|
config.assets.precompile += %w( android-chrome-512x512.png )
|
11
11
|
config.assets.precompile += %w( logo.png )
|
12
12
|
config.assets.precompile += %w( up-arrow.png )
|
13
|
-
# mstile-150x150
|
14
13
|
config.assets.precompile += %w( thecore.js )
|
15
14
|
config.assets.precompile += %w( thecore.css )
|
16
|
-
# config.assets.precompile += %w( app_logo.png )
|
17
|
-
# config.assets.precompile += %w( main_app_logo.png )
|
18
15
|
config.assets.precompile += %w( ie.js )
|
19
16
|
config.assets.precompile += %w( manifest.json )
|
20
17
|
config.assets.precompile += %w( browserconfig.xml )
|
@@ -32,4 +29,8 @@ Rails.application.configure do
|
|
32
29
|
config.serviceworker.routes.draw do
|
33
30
|
match "/manifest.json"
|
34
31
|
end
|
32
|
+
|
33
|
+
config.after_initialize do
|
34
|
+
User.send(:include, ThecoreUiCommonsUser)
|
35
|
+
end
|
35
36
|
end
|
data/lib/thecore_ui_commons.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
require "thecore_ui_commons/engine"
|
2
|
-
|
3
1
|
require 'thecore_backend_commons'
|
4
2
|
# Rails
|
5
3
|
require 'serviceworker-rails'
|
6
4
|
|
5
|
+
require 'concerns/thecore_ui_commons_user'
|
6
|
+
|
7
|
+
require "thecore_ui_commons/engine"
|
8
|
+
|
7
9
|
module ThecoreUiCommons
|
8
10
|
# Your code goes here...
|
9
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_ui_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_backend_commons
|
@@ -49,15 +49,69 @@ files:
|
|
49
49
|
- README.md
|
50
50
|
- Rakefile
|
51
51
|
- app/assets/config/thecore_ui_commons_manifest.js
|
52
|
-
- app/assets/
|
52
|
+
- app/assets/config/trix/LICENSE
|
53
|
+
- app/assets/config/trix/README.md
|
54
|
+
- app/assets/config/trix/dist/trix-core.js
|
55
|
+
- app/assets/config/trix/dist/trix.css
|
56
|
+
- app/assets/config/trix/dist/trix.js
|
57
|
+
- app/assets/config/trix/package.json
|
58
|
+
- app/assets/images/android-chrome-192x192.png
|
59
|
+
- app/assets/images/android-chrome-512x512.png
|
60
|
+
- app/assets/images/apple-touch-icon.png
|
61
|
+
- app/assets/images/favicon-16x16.png
|
62
|
+
- app/assets/images/favicon-32x32.png
|
63
|
+
- app/assets/images/favicon.ico
|
64
|
+
- app/assets/images/logo.png
|
65
|
+
- app/assets/images/mstile-150x150.png
|
66
|
+
- app/assets/images/safari-pinned-tab.svg
|
67
|
+
- app/assets/images/up-arrow.png
|
68
|
+
- app/assets/javascripts/browserconfig.xml
|
69
|
+
- app/assets/javascripts/ie.js
|
70
|
+
- app/assets/javascripts/manifest.json
|
71
|
+
- app/assets/javascripts/pages.coffee
|
72
|
+
- app/assets/javascripts/thecore.js
|
73
|
+
- app/assets/javascripts/timer.js
|
74
|
+
- app/assets/stylesheets/actiontext.scss
|
75
|
+
- app/assets/stylesheets/thecore.scss
|
53
76
|
- app/controllers/application_controller.rb
|
54
|
-
- app/controllers/pages_controller.rb
|
55
77
|
- app/views/active_storage/blobs/_blob.html.erb
|
78
|
+
- app/views/contact_mailer/contact_message.html.erb
|
79
|
+
- app/views/devise/confirmations/new.html.erb
|
80
|
+
- app/views/devise/mailer/confirmation_instructions.html.erb
|
81
|
+
- app/views/devise/mailer/password_change.html.erb
|
82
|
+
- app/views/devise/mailer/reset_password_instructions.html.erb
|
83
|
+
- app/views/devise/mailer/unlock_instructions.html.erb
|
84
|
+
- app/views/devise/menu/_login_items.html.erb
|
85
|
+
- app/views/devise/passwords/edit.html.erb
|
86
|
+
- app/views/devise/passwords/new.html.erb
|
87
|
+
- app/views/devise/registrations/edit.html.erb
|
88
|
+
- app/views/devise/registrations/new.html.erb
|
89
|
+
- app/views/devise/sessions/new.html.erb
|
90
|
+
- app/views/devise/shared/_links.html.erb
|
91
|
+
- app/views/devise/unlocks/new.html.erb
|
92
|
+
- app/views/kaminari/_first_page.html.erb
|
93
|
+
- app/views/kaminari/_gap.html.erb
|
94
|
+
- app/views/kaminari/_last_page.html.erb
|
95
|
+
- app/views/kaminari/_next_page.html.erb
|
96
|
+
- app/views/kaminari/_page.html.erb
|
97
|
+
- app/views/kaminari/_paginator.html.erb
|
98
|
+
- app/views/kaminari/_prev_page.html.erb
|
99
|
+
- app/views/layouts/_footer.html.erb
|
100
|
+
- app/views/layouts/_messages.html.erb
|
101
|
+
- app/views/layouts/_navigation.html.erb
|
102
|
+
- app/views/layouts/_navigation_links.html.erb
|
103
|
+
- app/views/layouts/mailer.html.erb
|
104
|
+
- app/views/layouts/mailer.text.erb
|
105
|
+
- app/views/layouts/thecore.html.erb
|
106
|
+
- app/views/shared/_flash.html.erb
|
56
107
|
- config/initializers/thecore_ui_commons_application_config.rb
|
57
108
|
- config/locales/en.simple_form.yml
|
58
109
|
- config/locales/it.simple_form.yml
|
59
110
|
- config/routes.rb
|
60
111
|
- db/migrate/20190920115550_create_action_text_tables.action_text.rb
|
112
|
+
- db/migrate/20200515070620_add_username_to_user.rb
|
113
|
+
- db/migrate/20200515132932_add_rememberable_to_user.rb
|
114
|
+
- lib/concerns/thecore_ui_commons_user.rb
|
61
115
|
- lib/tasks/thecore_ui_commons_tasks.rake
|
62
116
|
- lib/thecore_ui_commons.rb
|
63
117
|
- lib/thecore_ui_commons/engine.rb
|
@@ -1,43 +0,0 @@
|
|
1
|
-
class PagesController < ApplicationController
|
2
|
-
before_action :authenticate_user!, only: [
|
3
|
-
:inside, :contact
|
4
|
-
]
|
5
|
-
|
6
|
-
# So the static link navigation can be set runtime (yes it's an hack
|
7
|
-
# since I have to set this dynamically at runtime, using a class
|
8
|
-
# continously re-evaluated)
|
9
|
-
RailsAdmin.config do |config|
|
10
|
-
config.navigation_static_label = I18n.t('admin.links.label')
|
11
|
-
end
|
12
|
-
|
13
|
-
def home
|
14
|
-
end
|
15
|
-
|
16
|
-
def inside
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
def email
|
21
|
-
@name = params[:name]
|
22
|
-
@email = params[:email]
|
23
|
-
@message = params[:message]
|
24
|
-
|
25
|
-
if @name.blank?
|
26
|
-
flash[:alert] = "Please enter your name before sending your message. Thank you."
|
27
|
-
render :contact
|
28
|
-
elsif @email.blank? || @email.scan(/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i).size < 1
|
29
|
-
flash[:alert] = "You must provide a valid email address before sending your message. Thank you."
|
30
|
-
render :contact
|
31
|
-
elsif @message.blank? || @message.length < 10
|
32
|
-
flash[:alert] = "Your message is empty. Requires at least 10 characters. Nothing to send."
|
33
|
-
render :contact
|
34
|
-
elsif @message.scan(/<a href=/).size > 0 || @message.scan(/\[url=/).size > 0 || @message.scan(/\[link=/).size > 0 || @message.scan(/http:\/\//).size > 0
|
35
|
-
flash[:alert] = "You can't send links. Thank you for your understanding."
|
36
|
-
render :contact
|
37
|
-
else
|
38
|
-
ContactMailer.contact_message(@name,@email,@message).deliver_now
|
39
|
-
redirect_to root_path, notice: "Your message was sent. Thank you."
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|