Skip to content
This repository was archived by the owner on Mar 19, 2020. It is now read-only.

Commit 54dfa89

Browse files
author
Yuma Soga
committed
Update form for Privacy-Policy
1 parent 760a816 commit 54dfa89

File tree

12 files changed

+49
-74
lines changed

12 files changed

+49
-74
lines changed

app/assets/javascripts/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
//= require jquery3
1616
//= require toastr
1717
//= require popper
18-
//= require bootstrap-sprockets
18+
//= require bootstrap
1919
//= require_tree .
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$ ->
2+
$('[data-toggle="tooltip"]').tooltip()

app/assets/stylesheets/bootstrap-creative/_other-sections.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414
vertical-align: top;
1515
}
1616
}
17+
#supporters.bg-dark{
18+
background-color: $gray-100 !important;
19+
}

app/controllers/application_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def put_ver_link
1818
{ url: "#{root_url}pages", text: "ページ一覧" },
1919
{ url: "#{root_url}regulation", text: "会則" },
2020
{ url: "#{root_url}visit-interview", text: "見学・取材について" },
21-
{ url: "#{root_url}f-and-q", text: "よくある質問 (F&Q)"}
21+
{ url: "#{root_url}f-and-q", text: "よくある質問 (F&Q)"},
22+
{ url: "#{root_url}privacy-policy", text: "Privacy Policy(個人情報保護方針)"}
2223
]
2324
end
2425
end

app/controllers/staticpages_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ def contact_form_send
2929

3030
private
3131
def contact_form_params
32-
params.require(:contact_form).permit(:name, :email, :subject, :body)
32+
params.require(:contact_form).permit(:name, :email, :subject, :body, :agreement_privacy_policy)
3333
end
3434
end

app/models/contact_form.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ class ContactForm
33
include ActiveModel::Attributes
44
#include ActiveModel::Callbacks
55

6-
attr_accessor :name, :email, :subject, :body
6+
attr_accessor :name, :email, :subject, :body, :agreement_privacy_policy
77
define_model_callbacks :save
88

99
validates :name, presence: true
1010
validates :email, presence: true
1111
validates :subject, presence: true
1212
validates :body, presence: true
13+
validates :agreement_privacy_policy, presence: true
1314

15+
validates_acceptance_of :agreement_privacy_policy, allow_nil: false
1416
def save
1517
run_callbacks :save do
1618
return false if invalid?

app/views/pages/show.html.haml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
- provide(:desc, @page.description)
33
- provide(:url, request.url)
44

5-
.headings.page-title.m-3.p-2
5+
.headings.page-title.m-2.p-2
66
%h1= @page.title
7-
87
%p= @page.description
9-
%br/
108
.content.m-3.p-2
119
= raw @content

app/views/staticpages/_form.html.haml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
= simple_form_for @contact_form, :html => { :class => 'form-horizontal' }, :url => { :action => 'contact_form_send'} do |f|
2-
= f.input :name, as: :string, placeholder: 'お名前'
3-
= f.input :email, as: :string, placeholder: 'メールアドレス'
4-
= f.input :subject, as: :string, placeholder: '件名'
5-
= f.input :body, as: :text, placeholder: '本文を入力してください。', :input_html => { :rows => 5 }
2+
= f.input :name, as: :string, placeholder: 'お名前', error: 'この項目は空白にできません。', label: false
3+
= f.input :email, as: :string, placeholder: 'メールアドレス', error: 'この項目は空白にできません。', label: false
4+
= f.input :subject, as: :string, placeholder: '件名', error: 'この項目は空白にできません。', label: false
5+
= f.input :body, as: :text, placeholder: '本文を入力してください。', :input_html => { :rows => 5 }, label: false,
6+
error: 'この項目は空白にできません。'
7+
= f.input :agreement_privacy_policy, as: :boolean, checked: false, error: '個人情報保護方針へのご同意をお願いします。',
8+
label: link_to('個人情報保護方針', "#{root_url}privacy-policy", target: "_blank") + " に同意する。"
69
= f.submit '送信', :class => 'btn btn-primary'

app/views/staticpages/contact.html.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
.row
1111
.col-lg-8.mx-auto.mw-100
1212
= render 'form'
13+
%br/
14+
= link_to 'トップページへ戻る', root_url

app/views/staticpages/index.html.haml

Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -158,76 +158,40 @@
158158
.col-lg-3.col-md-6.text-center
159159
.service-box.mt-5.mx-auto
160160
%img.mb-3.sr-icons.img-fluid{:alt => "Scratch Cat", :src => "#{asset_path "index/scratch-cat.png"}"}/
161-
%h3.mb-3 Scratch
161+
%h4.mb-3 Scratch
162162
.col-lg-3.col-md-6.text-center
163163
.service-box.mt-5.mx-auto
164164
%img.mb-3.sr-icons.img-fluid{:alt => "Java Logo", :src => "#{asset_path "index/java-original.png"}"}/
165-
%h3.mb-3 Java
165+
%h4.mb-3 Java
166166
.col-lg-3.col-md-6.text-center
167167
.service-box.mt-5.mx-auto
168168
%img.mb-3.sr-icons.img-fluid{:alt => "Web系言語", :src => "#{asset_path "index/web-lang.png"}"}/
169-
%h3.mb-3 HTML/CSS/JavaScript
169+
%h4.mb-3 HTML/CSS/JavaScript
170170
.col-lg-3.col-md-6.text-center
171171
.service-box.mt-5.mx-auto
172172
%img.mb-3.sr-icons.img-fluid{:alt => "Ruby (on Rails)", :src => "#{asset_path "index/ruby-original.png"}"}/
173-
%h3.mb-3 Ruby(on Rails)
174-
-# %section#portfolio.p-0
175-
-# .container-fluid.p-0
176-
-# .row.no-gutters.popup-gallery
177-
-# .col-lg-4.col-sm-6
178-
-# %a.portfolio-box{:href => "img/portfolio/fullsize/1.jpg"}
179-
-# %img.img-fluid{:alt => "", :src => "img/portfolio/thumbnails/1.jpg"}/
180-
-# .portfolio-box-caption
181-
-# .portfolio-box-caption-content
182-
-# .project-category.text-faded
183-
-# Category
184-
-# .project-name
185-
-# Project Name
186-
-# .col-lg-4.col-sm-6
187-
-# %a.portfolio-box{:href => "img/portfolio/fullsize/2.jpg"}
188-
-# %img.img-fluid{:alt => "", :src => "img/portfolio/thumbnails/2.jpg"}/
189-
-# .portfolio-box-caption
190-
-# .portfolio-box-caption-content
191-
-# .project-category.text-faded
192-
-# Category
193-
-# .project-name
194-
-# Project Name
195-
-# .col-lg-4.col-sm-6
196-
-# %a.portfolio-box{:href => "img/portfolio/fullsize/3.jpg"}
197-
-# %img.img-fluid{:alt => "", :src => "img/portfolio/thumbnails/3.jpg"}/
198-
-# .portfolio-box-caption
199-
-# .portfolio-box-caption-content
200-
-# .project-category.text-faded
201-
-# Category
202-
-# .project-name
203-
-# Project Name
204-
-# .col-lg-4.col-sm-6
205-
-# %a.portfolio-box{:href => "img/portfolio/fullsize/4.jpg"}
206-
-# %img.img-fluid{:alt => "", :src => "img/portfolio/thumbnails/4.jpg"}/
207-
-# .portfolio-box-caption
208-
-# .portfolio-box-caption-content
209-
-# .project-category.text-faded
210-
-# Category
211-
-# .project-name
212-
-# Project Name
213-
-# .col-lg-4.col-sm-6
214-
-# %a.portfolio-box{:href => "img/portfolio/fullsize/5.jpg"}
215-
-# %img.img-fluid{:alt => "", :src => "img/portfolio/thumbnails/5.jpg"}/
216-
-# .portfolio-box-caption
217-
-# .portfolio-box-caption-content
218-
-# .project-category.text-faded
219-
-# Category
220-
-# .project-name
221-
-# Project Name
222-
-# .col-lg-4.col-sm-6
223-
-# %a.portfolio-box{:href => "img/portfolio/fullsize/6.jpg"}
224-
-# %img.img-fluid{:alt => "", :src => "img/portfolio/thumbnails/6.jpg"}/
225-
-# .portfolio-box-caption
226-
-# .portfolio-box-caption-content
227-
-# .project-category.text-faded
228-
-# Category
229-
-# .project-name
230-
-# Project Name
173+
%h4.mb-3 Ruby(on Rails)
174+
%section#supporters.bg-dark
175+
.container
176+
.row
177+
.col-lg-12.text-center
178+
%h2.section-heading Supporters
179+
%h6.section-heading.text-fade CoderDojo 岡山 岡南 の活動はこれらのサポータの皆様によって成り立っています!
180+
%hr.my-4/
181+
.container
182+
.row
183+
.col-lg-3.col-md-6.text-center.mx-auto
184+
.service-box.mt-5.mx-auto
185+
%img.mb-3.sr-icons.img-fluid{:alt => "Non Logo", :src => "#{asset_path "index/supporter/non-logo.png"}"}(data-toggle="tooltip" data-placement="top" title="サーバー・ドメインなどの提供")/
186+
%h4.mb-3 リムゲイト株式会社 様
187+
.col-lg-3.col-md-6.text-center.mx-auto
188+
.service-box.mt-5.mx-auto
189+
%img.mb-3.sr-icons.img-fluid{:alt => "ESA", :src => "#{asset_path "index/supporter/esa.png"}"}(data-toggle="tooltip" data-placement="top" title="ドキュメント共有サービスの提供")/
190+
%h4.mb-3 ESA.IO 様
191+
.col-lg-3.col-md-6.text-center.mx-auto
192+
.service-box.mt-5.mx-auto
193+
%img.mb-3.sr-icons.img-fluid{:alt => "さくらインターネット", :src => "#{asset_path "index/supporter/sakura-internet.png"}"}(data-toggle="tooltip" data-placement="top" title="「さくらのクラウド」の無償提供")/
194+
%h4.mb-3 SAKURA INTERNET INC. 様
231195
%section#contact
232196
.container
233197
.row

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Application < Rails::Application
1212
config.load_defaults 5.1
1313

1414
config.autoload_paths += %W(#{config.root}/lib)
15-
config.autoload_paths += Dir["#{config.root}/lib/**/"]
15+
config.autoload_paths += Dir["#{config.root}/lib/**/"]
1616

1717
# Settings in config/environments/* take precedence over those specified here.
1818
# Application configuration can go into files in config/initializers

config/initializers/simple_form.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
# config.item_wrapper_class = nil
111111

112112
# How the label text should be generated altogether with the required text.
113-
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
113+
config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
114114

115115
# You can define the class to use on all labels. Default is nil.
116116
# config.label_class = nil

0 commit comments

Comments
 (0)