shopify_app 13.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.babelrc +5 -0
- data/.github/CODEOWNERS +1 -0
- data/.github/ISSUE_TEMPLATE.md +14 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +6 -0
- data/.github/probots.yml +2 -0
- data/.github/workflows/rubocop.yml +28 -0
- data/.gitignore +16 -0
- data/.nvmrc +1 -0
- data/.rubocop.yml +17 -0
- data/.ruby-version +1 -0
- data/.travis.yml +28 -0
- data/CHANGELOG.md +505 -0
- data/Gemfile +11 -0
- data/LICENSE +19 -0
- data/README.md +620 -0
- data/Rakefile +7 -0
- data/SECURITY.md +59 -0
- data/app/assets/images/storage_access.svg +2 -0
- data/app/assets/javascripts/shopify_app/enable_cookies.js +3 -0
- data/app/assets/javascripts/shopify_app/itp_helper.js +40 -0
- data/app/assets/javascripts/shopify_app/partition_cookies.js +8 -0
- data/app/assets/javascripts/shopify_app/redirect.js +33 -0
- data/app/assets/javascripts/shopify_app/request_storage_access.js +3 -0
- data/app/assets/javascripts/shopify_app/storage_access.js +153 -0
- data/app/assets/javascripts/shopify_app/storage_access_redirect.js +17 -0
- data/app/assets/javascripts/shopify_app/top_level.js +2 -0
- data/app/assets/javascripts/shopify_app/top_level_interaction.js +11 -0
- data/app/controllers/concerns/shopify_app/authenticated.rb +16 -0
- data/app/controllers/concerns/shopify_app/require_known_shop.rb +39 -0
- data/app/controllers/shopify_app/authenticated_controller.rb +8 -0
- data/app/controllers/shopify_app/callback_controller.rb +140 -0
- data/app/controllers/shopify_app/extension_verification_controller.rb +15 -0
- data/app/controllers/shopify_app/sessions_controller.rb +184 -0
- data/app/controllers/shopify_app/webhooks_controller.rb +37 -0
- data/app/views/shopify_app/partials/_button_styles.html.erb +104 -0
- data/app/views/shopify_app/partials/_card_styles.html.erb +33 -0
- data/app/views/shopify_app/partials/_empty_state_styles.html.erb +129 -0
- data/app/views/shopify_app/partials/_layout_styles.html.erb +167 -0
- data/app/views/shopify_app/partials/_typography_styles.html.erb +35 -0
- data/app/views/shopify_app/sessions/enable_cookies.html.erb +75 -0
- data/app/views/shopify_app/sessions/new.html.erb +123 -0
- data/app/views/shopify_app/sessions/request_storage_access.html.erb +68 -0
- data/app/views/shopify_app/sessions/top_level_interaction.html.erb +64 -0
- data/app/views/shopify_app/shared/redirect.html.erb +23 -0
- data/config/locales/cs.yml +23 -0
- data/config/locales/da.yml +20 -0
- data/config/locales/de.yml +22 -0
- data/config/locales/en.yml +15 -0
- data/config/locales/es.yml +22 -0
- data/config/locales/fi.yml +20 -0
- data/config/locales/fr.yml +23 -0
- data/config/locales/hi.yml +23 -0
- data/config/locales/it.yml +21 -0
- data/config/locales/ja.yml +17 -0
- data/config/locales/ko.yml +19 -0
- data/config/locales/ms.yml +22 -0
- data/config/locales/nb.yml +21 -0
- data/config/locales/nl.yml +21 -0
- data/config/locales/pl.yml +21 -0
- data/config/locales/pt-BR.yml +21 -0
- data/config/locales/pt-PT.yml +22 -0
- data/config/locales/sv.yml +21 -0
- data/config/locales/th.yml +20 -0
- data/config/locales/tr.yml +22 -0
- data/config/locales/zh-CN.yml +16 -0
- data/config/locales/zh-TW.yml +16 -0
- data/config/routes.rb +23 -0
- data/docs/Quickstart.md +93 -0
- data/docs/Releasing.md +18 -0
- data/docs/Troubleshooting.md +16 -0
- data/docs/install-on-dev-shop.png +0 -0
- data/docs/test-your-app.png +0 -0
- data/images/app-proxy-screenshot.png +0 -0
- data/karma.conf.js +44 -0
- data/lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb +47 -0
- data/lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb +11 -0
- data/lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb +40 -0
- data/lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb +62 -0
- data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +69 -0
- data/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt +13 -0
- data/lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb +26 -0
- data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb +8 -0
- data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_route.rb +11 -0
- data/lib/generators/shopify_app/app_proxy_controller/templates/index.html.erb +19 -0
- data/lib/generators/shopify_app/authenticated_controller/authenticated_controller_generator.rb +15 -0
- data/lib/generators/shopify_app/authenticated_controller/templates/authenticated_controller.rb +5 -0
- data/lib/generators/shopify_app/controllers/controllers_generator.rb +30 -0
- data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +26 -0
- data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +8 -0
- data/lib/generators/shopify_app/home_controller/templates/index.html.erb +21 -0
- data/lib/generators/shopify_app/install/install_generator.rb +83 -0
- data/lib/generators/shopify_app/install/templates/_flash_messages.html.erb +3 -0
- data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +41 -0
- data/lib/generators/shopify_app/install/templates/flash_messages.js +24 -0
- data/lib/generators/shopify_app/install/templates/omniauth.rb +3 -0
- data/lib/generators/shopify_app/install/templates/session_store.rb +4 -0
- data/lib/generators/shopify_app/install/templates/shopify_app.js +15 -0
- data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +15 -0
- data/lib/generators/shopify_app/install/templates/shopify_app_index.js +2 -0
- data/lib/generators/shopify_app/install/templates/shopify_provider.rb +20 -0
- data/lib/generators/shopify_app/install/templates/user_agent.rb +6 -0
- data/lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator.rb +16 -0
- data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token.rake +17 -0
- data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token_job.rb +42 -0
- data/lib/generators/shopify_app/routes/routes_generator.rb +32 -0
- data/lib/generators/shopify_app/routes/templates/routes.rb +12 -0
- data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +43 -0
- data/lib/generators/shopify_app/shop_model/templates/db/migrate/create_shops.erb +15 -0
- data/lib/generators/shopify_app/shop_model/templates/shop.rb +8 -0
- data/lib/generators/shopify_app/shop_model/templates/shops.yml +3 -0
- data/lib/generators/shopify_app/shopify_app_generator.rb +18 -0
- data/lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb +16 -0
- data/lib/generators/shopify_app/user_model/templates/user.rb +8 -0
- data/lib/generators/shopify_app/user_model/templates/users.yml +4 -0
- data/lib/generators/shopify_app/user_model/user_model_generator.rb +43 -0
- data/lib/generators/shopify_app/views/views_generator.rb +30 -0
- data/lib/shopify_app.rb +61 -0
- data/lib/shopify_app/configuration.rb +94 -0
- data/lib/shopify_app/controller_concerns/app_proxy_verification.rb +38 -0
- data/lib/shopify_app/controller_concerns/csrf_protection.rb +15 -0
- data/lib/shopify_app/controller_concerns/embedded_app.rb +20 -0
- data/lib/shopify_app/controller_concerns/itp.rb +45 -0
- data/lib/shopify_app/controller_concerns/localization.rb +23 -0
- data/lib/shopify_app/controller_concerns/login_protection.rb +231 -0
- data/lib/shopify_app/controller_concerns/payload_verification.rb +24 -0
- data/lib/shopify_app/controller_concerns/webhook_verification.rb +23 -0
- data/lib/shopify_app/engine.rb +25 -0
- data/lib/shopify_app/jobs/scripttags_manager_job.rb +16 -0
- data/lib/shopify_app/jobs/webhooks_manager_job.rb +16 -0
- data/lib/shopify_app/managers/scripttags_manager.rb +78 -0
- data/lib/shopify_app/managers/webhooks_manager.rb +62 -0
- data/lib/shopify_app/middleware/jwt_middleware.rb +42 -0
- data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +34 -0
- data/lib/shopify_app/session/in_memory_session_store.rb +31 -0
- data/lib/shopify_app/session/in_memory_shop_session_store.rb +14 -0
- data/lib/shopify_app/session/in_memory_user_session_store.rb +14 -0
- data/lib/shopify_app/session/jwt.rb +61 -0
- data/lib/shopify_app/session/null_user_session_store.rb +22 -0
- data/lib/shopify_app/session/session_repository.rb +56 -0
- data/lib/shopify_app/session/session_storage.rb +20 -0
- data/lib/shopify_app/session/shop_session_storage.rb +42 -0
- data/lib/shopify_app/session/user_session_storage.rb +42 -0
- data/lib/shopify_app/test_helpers/all.rb +2 -0
- data/lib/shopify_app/test_helpers/webhook_verification_helper.rb +17 -0
- data/lib/shopify_app/utils.rb +24 -0
- data/lib/shopify_app/version.rb +4 -0
- data/package-lock.json +7177 -0
- data/package.json +28 -0
- data/service.yml +7 -0
- data/shipit.rubygems.yml +4 -0
- data/shopify_app.gemspec +37 -0
- data/translation.yml +7 -0
- data/webpack.config.js +24 -0
- data/yarn.lock +5263 -0
- metadata +420 -0
@@ -0,0 +1,167 @@
|
|
1
|
+
<style>
|
2
|
+
html,
|
3
|
+
body {
|
4
|
+
min-height:100%;
|
5
|
+
height:100%;
|
6
|
+
font-size:1.5rem;
|
7
|
+
font-weight:400;
|
8
|
+
line-height:2rem;
|
9
|
+
text-transform:initial;
|
10
|
+
letter-spacing:initial;
|
11
|
+
font-weight:400;
|
12
|
+
color:#212b36;
|
13
|
+
font-family:-apple-system, BlinkMacSystemFont, San Francisco, Roboto, Segoe UI, Helvetica Neue, sans-serif;
|
14
|
+
}
|
15
|
+
|
16
|
+
@media (min-width: 40em) {
|
17
|
+
html,
|
18
|
+
body {
|
19
|
+
font-size:1.4rem;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
html {
|
24
|
+
position:relative;
|
25
|
+
font-size:62.5%;
|
26
|
+
-webkit-font-smoothing:antialiased;
|
27
|
+
-moz-osx-font-smoothing:grayscale;
|
28
|
+
-webkit-text-size-adjust:100%;
|
29
|
+
-ms-text-size-adjust:100%;
|
30
|
+
text-size-adjust:100%;
|
31
|
+
text-rendering:optimizeLegibility;
|
32
|
+
}
|
33
|
+
|
34
|
+
body {
|
35
|
+
min-height:100%;
|
36
|
+
margin:0;
|
37
|
+
padding:0;
|
38
|
+
background-color:#f4f6f8;
|
39
|
+
}
|
40
|
+
|
41
|
+
*,
|
42
|
+
*::before,
|
43
|
+
*::after{
|
44
|
+
box-sizing:border-box; }
|
45
|
+
|
46
|
+
h1,
|
47
|
+
h2,
|
48
|
+
h3,
|
49
|
+
h4,
|
50
|
+
h5,
|
51
|
+
h6,
|
52
|
+
p {
|
53
|
+
margin:0;
|
54
|
+
font-size:1em;
|
55
|
+
font-weight:400;
|
56
|
+
}
|
57
|
+
|
58
|
+
.Polaris-Page {
|
59
|
+
margin:0 auto;
|
60
|
+
padding:0;
|
61
|
+
max-width:99.8rem;
|
62
|
+
}
|
63
|
+
|
64
|
+
@media (min-width: 30.625em) {
|
65
|
+
.Polaris-Page {
|
66
|
+
padding:0 2rem;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
@media (min-width: 46.5em) {
|
70
|
+
.Polaris-Page {
|
71
|
+
padding:0 3.2rem;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
.Polaris-Page__Content {
|
76
|
+
margin:2rem 0;
|
77
|
+
}
|
78
|
+
|
79
|
+
@media (min-width: 46.5em) {
|
80
|
+
.Polaris-Page__Content {
|
81
|
+
margin-top:2rem;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
@media (min-width: 46.5em) {
|
86
|
+
.Polaris-Page {
|
87
|
+
display: flex;
|
88
|
+
justify-content: center;
|
89
|
+
align-items: center;
|
90
|
+
height: 100vh;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
.Polaris-Layout {
|
95
|
+
display:-webkit-box;
|
96
|
+
display:-ms-flexbox;
|
97
|
+
display:flex;
|
98
|
+
-ms-flex-wrap:wrap;
|
99
|
+
flex-wrap:wrap;
|
100
|
+
-webkit-box-pack:center;
|
101
|
+
-ms-flex-pack:center;
|
102
|
+
justify-content:center;
|
103
|
+
-webkit-box-align:start;
|
104
|
+
-ms-flex-align:start;
|
105
|
+
align-items:flex-start;
|
106
|
+
margin-top:-2rem;
|
107
|
+
margin-left:-2rem;
|
108
|
+
}
|
109
|
+
|
110
|
+
.Polaris-Layout__Section {
|
111
|
+
-webkit-box-flex:2;
|
112
|
+
-ms-flex:2 2 48rem;
|
113
|
+
flex:2 2 48rem;
|
114
|
+
min-width:51%;
|
115
|
+
}
|
116
|
+
|
117
|
+
.Polaris-Layout__Section--fullWidth {
|
118
|
+
-webkit-box-flex:1;
|
119
|
+
-ms-flex:1 1 100%;
|
120
|
+
flex:1 1 100%;
|
121
|
+
}
|
122
|
+
|
123
|
+
.Polaris-Layout__Section {
|
124
|
+
max-width:calc(100% - 2rem);
|
125
|
+
margin-top:2rem;
|
126
|
+
margin-left:2rem;
|
127
|
+
}
|
128
|
+
|
129
|
+
.Polaris-Stack {
|
130
|
+
margin-top:-1.6rem;
|
131
|
+
margin-left:-1.6rem;
|
132
|
+
display:-webkit-box;
|
133
|
+
display:-ms-flexbox;
|
134
|
+
display:flex;
|
135
|
+
-ms-flex-wrap:wrap;
|
136
|
+
flex-wrap:wrap;
|
137
|
+
-webkit-box-align:stretch;
|
138
|
+
-ms-flex-align:stretch;
|
139
|
+
align-items:stretch;
|
140
|
+
}
|
141
|
+
|
142
|
+
.Polaris-Stack > .Polaris-Stack__Item {
|
143
|
+
margin-top:1.6rem;
|
144
|
+
margin-left:1.6rem;
|
145
|
+
max-width:calc(100% - 1.6rem);
|
146
|
+
}
|
147
|
+
|
148
|
+
.Polaris-Stack__Item {
|
149
|
+
-webkit-box-flex:0;
|
150
|
+
-ms-flex:0 0 auto;
|
151
|
+
flex:0 0 auto;
|
152
|
+
min-width:0;
|
153
|
+
}
|
154
|
+
|
155
|
+
.Polaris-Stack--distributionTrailing {
|
156
|
+
-webkit-box-pack:end;
|
157
|
+
-ms-flex-pack:end;
|
158
|
+
justify-content:flex-end;
|
159
|
+
}
|
160
|
+
|
161
|
+
.Polaris-Stack--vertical {
|
162
|
+
-webkit-box-orient:vertical;
|
163
|
+
-webkit-box-direction:normal;
|
164
|
+
-ms-flex-direction:column;
|
165
|
+
flex-direction:column;
|
166
|
+
}
|
167
|
+
</style>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<style>
|
2
|
+
.Polaris-Heading {
|
3
|
+
font-size:1.7rem;
|
4
|
+
font-weight:600;
|
5
|
+
line-height:2.4rem;
|
6
|
+
margin:0;
|
7
|
+
}
|
8
|
+
|
9
|
+
@media (min-width: 40em) {
|
10
|
+
.Polaris-Heading {
|
11
|
+
font-size:1.6rem;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
.Polaris-DisplayText {
|
16
|
+
margin:0;
|
17
|
+
}
|
18
|
+
|
19
|
+
.Polaris-DisplayText--sizeMedium {
|
20
|
+
font-size:2.1rem;
|
21
|
+
font-weight:400;
|
22
|
+
line-height:2.8rem;
|
23
|
+
}
|
24
|
+
|
25
|
+
@media (min-width: 40em) {
|
26
|
+
.Polaris-DisplayText--sizeMedium {
|
27
|
+
font-size:2.6rem;
|
28
|
+
line-height:3.2rem;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
.Polaris-TextContainer > * + * {
|
33
|
+
margin-top:1.6rem;
|
34
|
+
}
|
35
|
+
</style>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="<%= I18n.locale %>">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
|
+
<base target="_top">
|
7
|
+
<title>Redirecting…</title>
|
8
|
+
<%= render 'shopify_app/partials/layout_styles' %>
|
9
|
+
<%= render 'shopify_app/partials/typography_styles' %>
|
10
|
+
<%= render 'shopify_app/partials/card_styles' %>
|
11
|
+
<%= render 'shopify_app/partials/button_styles' %>
|
12
|
+
<style>
|
13
|
+
#CookiePartitionPrompt {
|
14
|
+
display: none;
|
15
|
+
}
|
16
|
+
</style>
|
17
|
+
<script>
|
18
|
+
window.apiKey = "<%= ShopifyApp.configuration.api_key %>";
|
19
|
+
window.shopOrigin = "https://<%= @shop %>";
|
20
|
+
window.returnTo = "<%= params[:return_to] %>"
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<%= javascript_include_tag('shopify_app/enable_cookies', crossorigin: 'anonymous', integrity: true) %>
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
<%=
|
27
|
+
content_tag(
|
28
|
+
:div, nil,
|
29
|
+
id: 'redirection-target',
|
30
|
+
data: {
|
31
|
+
target: {
|
32
|
+
myshopifyUrl: "https://#{current_shopify_domain}",
|
33
|
+
hasStorageAccessUrl: "#{has_storage_access_url}",
|
34
|
+
doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
|
35
|
+
appTargetUrl: "#{app_target_url}"
|
36
|
+
},
|
37
|
+
},
|
38
|
+
)
|
39
|
+
%>
|
40
|
+
<main id="CookiePartitionPrompt">
|
41
|
+
<div class="Polaris-Page">
|
42
|
+
<div class="Polaris-Page__Content">
|
43
|
+
<div class="Polaris-Layout">
|
44
|
+
<div class="Polaris-Layout__Section">
|
45
|
+
<div class="Polaris-Stack Polaris-Stack--vertical">
|
46
|
+
<div class="Polaris-Stack__Item">
|
47
|
+
<div class="Polaris-Card">
|
48
|
+
<div class="Polaris-Card__Header">
|
49
|
+
<h1 class="Polaris-Heading"><%= I18n.t('enable_cookies_heading', app: ShopifyApp.configuration.application_name) %></h1>
|
50
|
+
</div>
|
51
|
+
<div class="Polaris-Card__Section">
|
52
|
+
<p><%= I18n.t('enable_cookies_body', app: ShopifyApp.configuration.application_name) %></p>
|
53
|
+
</div>
|
54
|
+
<div class="Polaris-Card__Section Polaris-Card__Section--subdued">
|
55
|
+
<p><%= I18n.t('enable_cookies_footer') %></p>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
<div class="Polaris-Stack__Item">
|
60
|
+
<div class="Polaris-Stack Polaris-Stack--distributionTrailing">
|
61
|
+
<div class="Polaris-Stack__Item">
|
62
|
+
<button type="button" class="Polaris-Button Polaris-Button--primary" id="AcceptCookies">
|
63
|
+
<span class="Polaris-Button__Content"><span><%= I18n.t('enable_cookies_action') %></span></span>
|
64
|
+
</button>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
</main>
|
74
|
+
</body>
|
75
|
+
</html>
|
@@ -0,0 +1,123 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>Shopify App — Installation</title>
|
5
|
+
|
6
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
+
|
9
|
+
<style>
|
10
|
+
* {
|
11
|
+
-moz-box-sizing: border-box;
|
12
|
+
-webkit-box-sizing: border-box;
|
13
|
+
box-sizing: border-box;
|
14
|
+
}
|
15
|
+
|
16
|
+
body {
|
17
|
+
padding: 2.5em 0;
|
18
|
+
color: #212b37;
|
19
|
+
font-family: -apple-system,BlinkMacSystemFont,San Francisco,Roboto,Segoe UI,Helvetica Neue,sans-serif;
|
20
|
+
}
|
21
|
+
|
22
|
+
.container {
|
23
|
+
width: 100%;
|
24
|
+
text-align: center;
|
25
|
+
margin-left: auto;
|
26
|
+
margin-right: auto;
|
27
|
+
}
|
28
|
+
|
29
|
+
@media screen and (min-width: 510px) {
|
30
|
+
.container {
|
31
|
+
width: 510px;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
.title {
|
36
|
+
font-size: 1.5em;
|
37
|
+
margin: 2em auto;
|
38
|
+
display: flex;
|
39
|
+
align-items: center;
|
40
|
+
justify-content: center;
|
41
|
+
word-break: break-all;
|
42
|
+
}
|
43
|
+
|
44
|
+
.subtitle {
|
45
|
+
font-size: 0.8em;
|
46
|
+
font-weight: 500;
|
47
|
+
color: #64737f;
|
48
|
+
line-height: 2em;
|
49
|
+
}
|
50
|
+
|
51
|
+
.error {
|
52
|
+
line-height: 1em;
|
53
|
+
padding: 0.5em;
|
54
|
+
color: red;
|
55
|
+
}
|
56
|
+
|
57
|
+
input.marketing-input {
|
58
|
+
width: 100%;
|
59
|
+
height: 52px;
|
60
|
+
padding: 0 15px;
|
61
|
+
box-shadow: 0 0 0 1px #ddd;
|
62
|
+
border: 0;
|
63
|
+
border-radius: 5px;
|
64
|
+
background-color: #fff;
|
65
|
+
font-size: 1em;
|
66
|
+
margin-bottom: 15px;
|
67
|
+
}
|
68
|
+
|
69
|
+
input.marketing-input:focus {
|
70
|
+
color: #000;
|
71
|
+
outline: 0;
|
72
|
+
box-shadow: 0 0 0 2px #5e6ebf;
|
73
|
+
}
|
74
|
+
|
75
|
+
button.marketing-button {
|
76
|
+
display: inline-block;
|
77
|
+
width: 100%;
|
78
|
+
padding: 1.0625em 1.875em;
|
79
|
+
background-color: #5e6ebf;
|
80
|
+
color: #fff;
|
81
|
+
font-weight: 700;
|
82
|
+
font-size: 1em;
|
83
|
+
text-align: center;
|
84
|
+
outline: none;
|
85
|
+
border: 0 solid transparent;
|
86
|
+
border-radius: 5px;
|
87
|
+
cursor: pointer;
|
88
|
+
}
|
89
|
+
|
90
|
+
button.marketing-button:hover {
|
91
|
+
background: linear-gradient(to bottom, #5c6ac4, #4959bd);
|
92
|
+
border-color: #3f4eae;
|
93
|
+
}
|
94
|
+
|
95
|
+
button.marketing-button:focus {
|
96
|
+
box-shadow: 0 0 0.1875em 0.1875em rgba(94,110,191,0.5);
|
97
|
+
background-color: #223274;
|
98
|
+
color: #fff;
|
99
|
+
}
|
100
|
+
</style>
|
101
|
+
</head>
|
102
|
+
<body>
|
103
|
+
|
104
|
+
<main class="container" role="main">
|
105
|
+
<% application_name = ShopifyApp.configuration.application_name %>
|
106
|
+
<h3 class="title">
|
107
|
+
<%= application_name.presence || 'Shopify App – Installation' %>
|
108
|
+
</h3>
|
109
|
+
<p class="subtitle">
|
110
|
+
<label for="shop">Enter your shop domain to log in or install this app.</label>
|
111
|
+
</p>
|
112
|
+
|
113
|
+
<%= form_tag login_path do %>
|
114
|
+
<% if flash[:error] %>
|
115
|
+
<div class="error"><%= flash[:error] %></div>
|
116
|
+
<% end %>
|
117
|
+
<input id="shop" name="shop" type="text" autofocus="autofocus" placeholder="example.myshopify.com" class="marketing-input">
|
118
|
+
<button type="submit" class="marketing-button">Install</button>
|
119
|
+
<% end %>
|
120
|
+
</main>
|
121
|
+
|
122
|
+
</body>
|
123
|
+
</html>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="<%= I18n.locale %>">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
|
+
<base target="_top">
|
7
|
+
<title>Redirecting…</title>
|
8
|
+
<%= render 'shopify_app/partials/layout_styles' %>
|
9
|
+
<%= render 'shopify_app/partials/typography_styles' %>
|
10
|
+
<%= render 'shopify_app/partials/card_styles' %>
|
11
|
+
<%= render 'shopify_app/partials/button_styles' %>
|
12
|
+
<style>
|
13
|
+
#RequestStorageAccess {
|
14
|
+
display: none;
|
15
|
+
}
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<%=
|
20
|
+
content_tag(:div, nil,
|
21
|
+
id: 'redirection-target',
|
22
|
+
data: {
|
23
|
+
target: {
|
24
|
+
myshopifyUrl: "https://#{current_shopify_domain}",
|
25
|
+
hasStorageAccessUrl: "#{has_storage_access_url}",
|
26
|
+
doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
|
27
|
+
appTargetUrl: "#{app_target_url}"
|
28
|
+
},
|
29
|
+
},
|
30
|
+
)
|
31
|
+
%>
|
32
|
+
<main id="RequestStorageAccess">
|
33
|
+
<div class="Polaris-Page">
|
34
|
+
<div class="Polaris-Page__Content">
|
35
|
+
<div class="Polaris-Layout">
|
36
|
+
<div class="Polaris-Layout__Section">
|
37
|
+
<div class="Polaris-Stack Polaris-Stack--vertical">
|
38
|
+
<div class="Polaris-Stack__Item">
|
39
|
+
<div class="Polaris-Card">
|
40
|
+
<div class="Polaris-Card__Header">
|
41
|
+
<h1 class="Polaris-Heading"><%= I18n.t('request_storage_access_heading', app: ShopifyApp.configuration.application_name) %></h1>
|
42
|
+
</div>
|
43
|
+
<div class="Polaris-Card__Section">
|
44
|
+
<p><%= I18n.t('request_storage_access_body', app: ShopifyApp.configuration.application_name) %></p>
|
45
|
+
</div>
|
46
|
+
<div class="Polaris-Card__Section Polaris-Card__Section--subdued">
|
47
|
+
<p><%= I18n.t('request_storage_access_footer') %></p>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
<div class="Polaris-Stack__Item">
|
52
|
+
<div class="Polaris-Stack Polaris-Stack--distributionTrailing">
|
53
|
+
<div class="Polaris-Stack__Item">
|
54
|
+
<button type="button" class="Polaris-Button Polaris-Button--primary" id="TriggerAllowCookiesPrompt">
|
55
|
+
<span class="Polaris-Button__Content"><span><%= I18n.t('request_storage_access_action') %></span></span>
|
56
|
+
</button>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
</main>
|
66
|
+
<%= javascript_include_tag('shopify_app/request_storage_access', crossorigin: 'anonymous', integrity: true) %>
|
67
|
+
</body>
|
68
|
+
</html>
|