diff --git a/Gemfile b/Gemfile
index 8b2e9a4..7f1c24b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,9 +27,9 @@ gem 'travis'
gem 'haml-rails'
-gem "kramdown", "~> 1.1.0"
+# gem 'kramdown', '~> 1.1.0'
-gem "font-awesome-rails"
+gem 'font-awesome-rails'
gem 'bcrypt', '3.1.11'
@@ -37,12 +37,20 @@ gem 'omniauth-slack'
gem 'bootsnap'
-gem "pg"
+gem 'pg'
+
+gem 'bootstrap', '~> 4.1.1'
+
+gem 'simple_form'
+
+gem 'redcarpet'
+
+gem 'slack-notifier'
+
+gem 'toastr-rails'
group :development, :test do
- # Use sqlite3 as the database for Active Record
gem 'sqlite3'
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'rspec-rails'
@@ -52,9 +60,9 @@ group :development, :test do
end
group :test do
- gem "simplecov"
- gem "codeclimate-test-reporter", "~> 1.0.0"
- gem "timecop"
+ gem 'simplecov'
+ gem 'codeclimate-test-reporter', '~> 1.0.0'
+ gem 'timecop'
end
group :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index 4ff7e80..28f7546 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -44,12 +44,18 @@ GEM
tzinfo (~> 1.1)
addressable (2.4.0)
arel (9.0.0)
+ autoprefixer-rails (8.6.4)
+ execjs
backports (3.11.3)
bcrypt (3.1.11)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bootsnap (1.3.0)
msgpack (~> 1.0)
+ bootstrap (4.1.1)
+ autoprefixer-rails (>= 6.0.3)
+ popper_js (>= 1.12.9, < 2)
+ sass (>= 3.5.2)
builder (3.2.3)
byebug (10.0.2)
codeclimate-test-reporter (1.0.8)
@@ -125,7 +131,6 @@ GEM
thor (>= 0.14, < 2.0)
json (1.8.6)
jwt (1.5.6)
- kramdown (1.1.0)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.1.5)
@@ -172,6 +177,7 @@ GEM
omniauth-slack (2.3.0)
omniauth-oauth2 (~> 1.3.1)
pg (1.0.0)
+ popper_js (1.12.9)
pusher-client (0.6.2)
json
websocket (~> 1.0)
@@ -211,6 +217,7 @@ GEM
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rdoc (4.3.0)
+ redcarpet (3.4.0)
rest-client (2.0.2)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
@@ -250,11 +257,15 @@ GEM
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
sexp_processor (4.11.0)
+ simple_form (4.0.1)
+ actionpack (>= 5.0)
+ activemodel (>= 5.0)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
+ slack-notifier (2.3.2)
spring (2.0.2)
activesupport (>= 4.2)
sprockets (3.7.2)
@@ -270,6 +281,8 @@ GEM
thread_safe (0.3.6)
tilt (2.0.8)
timecop (0.9.1)
+ toastr-rails (1.0.3)
+ railties (>= 3.1.0)
travis (1.8.8)
backports
faraday (~> 0.9)
@@ -307,6 +320,7 @@ PLATFORMS
DEPENDENCIES
bcrypt (= 3.1.11)
bootsnap
+ bootstrap (~> 4.1.1)
byebug
codeclimate-test-reporter (~> 1.0.0)
coffee-rails (~> 4.2.1)
@@ -316,20 +330,23 @@ DEPENDENCIES
haml-rails
jbuilder (~> 2.0)
jquery-rails
- kramdown (~> 1.1.0)
listen
omniauth-slack
pg
rails (= 5.2.0)
rails-controller-testing
+ redcarpet
rest-client
rspec-rails
sass-rails (~> 5.0.5)
sdoc (~> 0.4.0)
+ simple_form
simplecov
+ slack-notifier
spring
sqlite3
timecop
+ toastr-rails
travis
turbolinks
uglifier (>= 1.3.0)
diff --git a/README.md b/README.md
index c3d07f2..5f2a734 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# [CoderDojo 岡山 岡南 公式ホームページ (テスト公開中)](https://coderdojo-konan-jp-rails.herokuapp.com/)
+# CoderDojo 岡山 岡南 公式ホームページ [(テスト公開中)](https://coderdojo-konan-jp-rails.herokuapp.com/)
[](https://travis-ci.org/CoderDojo-Konan-Okayama/coderdojo-konan.jp)
[](https://codeclimate.com/github/CoderDojo-Konan-Okayama/coderdojo-konan.jp/maintainability)
@@ -23,7 +23,7 @@ Contributor を大々的?に募っておきながら仕様とかもなにも
### 全体的な仕様
-- デザインは、表側が MDL(マテリアルデザイン・ライト)、ダッシュボードが、AdminLTE を使用。
+- ~~デザインは、表側が MDL(マテリアルデザイン・ライト)、ダッシュボードが、AdminLTE を使用。~~ 現在 future/update-desgin-to-own--front ブランチにて、 Bootstrap4 を使用して独自デザインを使おうとしてます。フロントだけでなく、バックもそうする予定。
- Ruby on Rails + RSpec
- 公開環境はいまのところ Heroku
- Heroku のためProduction環境のデータベースは PostgreSQL
@@ -37,12 +37,16 @@ coderdojo-japan/coderdojo.jp
db/pages 配下のMDファイルをそのまま変換し、比較的軽いページの生成をします。
+WP で言う所の **固定ページ** 的感覚です。
+
### StaticPages, 静的ページ
-HAML直書き... そのまま表示です。
+HAML直書き... そのまま表示です。(ヘッダー・フッターのぞく。)
デザインが変則的な場合に使います。(例: Topページ、作品紹介ページなど)
+WP で言う所の **固定ページ** 的感覚で、なおかつ複雑なデザインがいい場合に使う。
+
### Posts Model, ブログ記事
ダッシュボードからの操作で投稿・削除・予約公開などを行います。
@@ -57,6 +61,8 @@ MDを使いますが、今後 TinyMCE みたいなのを導入するかもしれ
まだまだ一部を作っていってる途中で、後々もうちょっと追加したいと思っている機能もあります。
+WP で言う所の **投稿** ですね、ストレート。
+
## Want to...
-- SpeakerDeck においてあるチュートリアルの組み込み・課題などはリンクさせてスコアとか出したかったりする。
\ No newline at end of file
+- SpeakerDeck においてあるチュートリアルの組み込み・課題などはリンクさせてスコアとか出したかったりする。
diff --git a/app/assets/images/index/introduction-image/dojo-image-06.jpg b/app/assets/images/index/introduction-image/dojo-image-06.jpg
new file mode 100644
index 0000000..776b9db
Binary files /dev/null and b/app/assets/images/index/introduction-image/dojo-image-06.jpg differ
diff --git a/app/assets/images/index/introduction-image/dojo-image-07.png b/app/assets/images/index/introduction-image/dojo-image-07.png
new file mode 100644
index 0000000..2f4016b
Binary files /dev/null and b/app/assets/images/index/introduction-image/dojo-image-07.png differ
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index d81f51a..45fe78e 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -10,7 +10,10 @@
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
-//= require jquery
-//= require jquery_ujs
+//= require rails-ujs
//= require turbolinks
-//= require_tree .
\ No newline at end of file
+//= require jquery3
+//= require toastr
+//= require popper
+//= require bootstrap
+//= require_tree .
diff --git a/app/assets/javascripts/creative.js b/app/assets/javascripts/creative.js
new file mode 100644
index 0000000..7a65340
--- /dev/null
+++ b/app/assets/javascripts/creative.js
@@ -0,0 +1,75 @@
+(function($) {
+ "use strict"; // Start of use strict
+
+ // Smooth scrolling using jQuery easing
+ $('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function() {
+ if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
+ var target = $(this.hash);
+ target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
+ if (target.length) {
+ $('html, body').animate({
+ scrollTop: (target.offset().top - 57)
+ }, 1000, "easeInOutExpo");
+ return false;
+ }
+ }
+ });
+
+ // Closes responsive menu when a scroll trigger link is clicked
+ $('.js-scroll-trigger').click(function() {
+ $('.navbar-collapse').collapse('hide');
+ });
+
+ // Activate scrollspy to add active class to navbar items on scroll
+ $('body').scrollspy({
+ target: '#mainNav',
+ offset: 57
+ });
+
+ // Collapse Navbar
+ var navbarCollapse = function() {
+ if ($("#mainNav").offset().top > 100) {
+ $("#mainNav").addClass("navbar-shrink");
+ } else {
+ $("#mainNav").removeClass("navbar-shrink");
+ }
+ };
+ // Collapse now if page is not at top
+ navbarCollapse();
+ // Collapse the navbar when page is scrolled
+ $(window).scroll(navbarCollapse);
+
+ // Scroll reveal calls
+ window.sr = ScrollReveal();
+ sr.reveal('.sr-icons', {
+ duration: 600,
+ scale: 0.3,
+ distance: '0px'
+ }, 200);
+ sr.reveal('.sr-button', {
+ duration: 1000,
+ delay: 200
+ });
+ sr.reveal('.sr-contact', {
+ duration: 600,
+ scale: 0.3,
+ distance: '0px'
+ }, 300);
+
+ // Magnific popup calls
+ $('.popup-gallery').magnificPopup({
+ delegate: 'a',
+ type: 'image',
+ tLoading: 'Loading image #%curr%...',
+ mainClass: 'mfp-img-mobile',
+ gallery: {
+ enabled: true,
+ navigateByImgClick: true,
+ preload: [0, 1]
+ },
+ image: {
+ tError: 'The image #%curr% could not be loaded.'
+ }
+ });
+
+})(jQuery); // End of use strict
diff --git a/app/assets/javascripts/toast-massage.coffee b/app/assets/javascripts/toast-massage.coffee
new file mode 100644
index 0000000..68522a1
--- /dev/null
+++ b/app/assets/javascripts/toast-massage.coffee
@@ -0,0 +1,9 @@
+$(document).on 'turbolinks:load', ->
+ if $.trim($('#info > .notice').html())!=''
+ toastr.success $('#info > .notice').text()
+ console.log 'Show Notice:' + $('#info > .notice').text()
+ else if $.trim($('#info > .alert').html())!=''
+ toastr.error $('#info > .alert').text()
+ console.log 'Show Alert:' + $('#info > .alert').text()
+ else
+ console.log 'No Words'
diff --git a/app/assets/javascripts/tool-tips.coffee b/app/assets/javascripts/tool-tips.coffee
new file mode 100644
index 0000000..498e72d
--- /dev/null
+++ b/app/assets/javascripts/tool-tips.coffee
@@ -0,0 +1,2 @@
+$ ->
+ $('[data-toggle="tooltip"]').tooltip()
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.scss
similarity index 76%
rename from app/assets/stylesheets/application.css
rename to app/assets/stylesheets/application.scss
index 9ead29f..5107641 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.scss
@@ -10,13 +10,22 @@
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
- *= require_tree .
- *= require_self
- *= require font-awesome
*/
-body {
- background-color: floralwhite;
-}
+
+
+@import "font-awesome";
+
+@import "toastr";
+
+@import "bootstrap-creative/creative";
+@import "pages";
+@import "posts";
+@import "bootstrap";
+
+//
+// body {
+// background-color: floralwhite;
+// }
::-webkit-scrollbar{
width: 12px;
}
@@ -29,14 +38,3 @@ body {
border-radius: 1rem;
box-shadow: none;
}
-.clearfix:after {
- visibility: hidden;
- display: block;
- content: " ";
- clear: both;
- height: 0;
-}
-
-.mdl-layout__drawer-button {
- color: black;
-}
\ No newline at end of file
diff --git a/app/assets/stylesheets/bootstrap-creative/_about.scss b/app/assets/stylesheets/bootstrap-creative/_about.scss
new file mode 100644
index 0000000..700d8c3
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_about.scss
@@ -0,0 +1,5 @@
+#about {
+ p {
+ font-size: 1rem;
+ }
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_animation.scss b/app/assets/stylesheets/bootstrap-creative/_animation.scss
new file mode 100644
index 0000000..dd443f6
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_animation.scss
@@ -0,0 +1,12 @@
+.shake_text_line {
+ display: inline-block;
+ animation: shake_line .3s infinite;
+}
+
+@keyframes shake_line {
+ 0% {transform: translate(0px, 0px) rotateZ(0deg)}
+ 25% {transform: translate(2px, 2px) rotateZ(1deg)}
+ 50% {transform: translate(0px, 2px) rotateZ(0deg)}
+ 75% {transform: translate(2px, 0px) rotateZ(-1deg)}
+ 100% {transform: translate(0px, 0px) rotateZ(0deg)}
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_bootstrap-overrides.scss b/app/assets/stylesheets/bootstrap-creative/_bootstrap-overrides.scss
new file mode 100644
index 0000000..ae25c6b
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_bootstrap-overrides.scss
@@ -0,0 +1,32 @@
+
+// Bootstrap overrides for this template
+.text-primary {
+ color: $primary !important;
+}
+
+.btn {
+ font-weight: 700 !important;
+ text-transform: uppercase !important;
+ border: none !important;
+ border-radius: 300px !important;
+ @include sans-serif-font;
+}
+
+.btn-xl {
+ padding: 1rem 2rem !important;
+}
+
+.btn-primary {
+ background-color: $primary !important;
+ border-color: $primary !important;
+ &:hover,
+ &:focus,
+ &:active {
+ color: $white;
+ background-color: darken($primary, 5%) !important;
+ }
+ &:active,
+ &:focus {
+ box-shadow: 0 0 0 0.2rem rgba(240, 95, 64,.5) !important;
+ }
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_global.scss b/app/assets/stylesheets/bootstrap-creative/_global.scss
new file mode 100644
index 0000000..214bfff
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_global.scss
@@ -0,0 +1,83 @@
+
+// Global styling for this template
+body,
+html {
+ width: 100%;
+ height: 100%;
+}
+
+body {
+ @include serif-font;
+}
+
+hr {
+ max-width: 50px;
+ border-width: 3px;
+ border-color: $primary;
+}
+
+hr.light {
+ border-color: $white;
+}
+
+a {
+ color: $primary;
+ @include transition-all;
+ &:hover {
+ color: darken($primary, .1);
+ }
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ @include sans-serif-font;
+}
+
+.bg-primary {
+ background-color: $primary !important;
+}
+
+.bg-dark {
+ background-color: $gray-200 !important;
+}
+
+.text-faded {
+ color: fade-out($white, .3);
+}
+
+section {
+ padding: 8rem 0;
+}
+
+.section-heading {
+ margin-top: 0;
+}
+
+::-moz-selection {
+ color: $white;
+ background: $gray-100;
+ text-shadow: none;
+}
+
+::selection {
+ color: $white;
+ background: $gray-100;
+ text-shadow: none;
+}
+
+img::selection {
+ color: $white;
+ background: transparent;
+}
+
+img::-moz-selection {
+ color: $white;
+ background: transparent;
+}
+.cl-black {
+ color: black;
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_masthead.scss b/app/assets/stylesheets/bootstrap-creative/_masthead.scss
new file mode 100644
index 0000000..61f4620
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_masthead.scss
@@ -0,0 +1,63 @@
+
+// Styling for the masthead
+header.masthead {
+ color: snow;
+ padding-top: 10rem;
+ padding-bottom: calc(10rem - 56px);
+ background-image: linear-gradient(rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), image-url('coderdojo-konan-header-image-1.jpg');
+ background-position: center center;
+ @include background-cover;
+ hr {
+ margin-top: 30px;
+ margin-bottom: 30px;
+ }
+ h1 {
+ font-size: 2rem;
+ font-style: italic;
+ text-shadow: 1px 1px 0 rgba(0,0,0,.8);
+ }
+ p {
+ font-size: 1.3rem;
+ color: $p_color;
+ font-style: italic;
+ border-bottom: 0.3rem dotted $primary;
+ text-shadow: 1px 1px 0 rgba(0,0,0,.3);
+ strong {
+ font-size: 120%;
+ color: $p_color;
+ text-shadow: 1px 1px 0 rgba(0,0,0,.5);
+ }
+ }
+ @media (min-width: 768px) {
+ p {
+ font-size: 1.3rem;
+ color: $p_color;
+ font-style: italic;
+ border-bottom: 0.3rem dotted $primary;
+ text-shadow: 1px 1px 0 rgba(0,0,0,.3);
+ strong {
+ font-size: 120%;
+ color: $p_color;
+ text-shadow: 1px 1px 0 rgba(0,0,0,.5);
+ }
+ }
+ }
+ @media (min-width: 992px) {
+ height: 100vh;
+ min-height: 650px;
+ padding-top: 0;
+ padding-bottom: 0;
+ h1 {
+ font-size: 3rem;
+ font-style: italic;
+ text-shadow: 1px 1px 0 rgba(0,0,0,.8);
+ }
+ }
+ @media (min-width: 1200px) {
+ h1 {
+ font-size: 4rem;
+ font-style: italic;
+ text-shadow: 1px 1px 0 rgba(0,0,0,.8);
+ }
+ }
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_mixins.scss b/app/assets/stylesheets/bootstrap-creative/_mixins.scss
new file mode 100644
index 0000000..8113cae
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_mixins.scss
@@ -0,0 +1,18 @@
+// Mixins
+@mixin transition-all() {
+ -webkit-transition: all 0.2s;
+ -moz-transition: all 0.2s;
+ transition: all 0.2s;
+}
+@mixin background-cover() {
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+}
+@mixin serif-font() {
+ font-family: 'Merriweather', 'Helvetica Neue', Arial, sans-serif;
+}
+@mixin sans-serif-font() {
+ font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_navbar.scss b/app/assets/stylesheets/bootstrap-creative/_navbar.scss
new file mode 100644
index 0000000..9eeecc0
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_navbar.scss
@@ -0,0 +1,80 @@
+
+// Styling for the navbar
+#mainNav {
+ border-bottom: 1px solid fade-out($gray-900, .9);
+ background-color: $white;
+ @include sans-serif-font;
+ @include transition-all;
+ .navbar-brand {
+ background: image-url('coderdojo-konan-header-logo.png') no-repeat left center;;
+ background-size: contain;
+ height: 50px;
+ width: 200px;
+ &:focus,
+ &:hover {
+ color: darken($primary, .1);
+ }
+ }
+ .navbar-nav {
+ > li.nav-item {
+ > a.nav-link,
+ > a.nav-link:focus {
+ font-size: .9rem;
+ font-weight: 700;
+ text-transform: uppercase;
+ color: $gray-900;
+ &:hover {
+ color: $primary;
+ }
+ &.active {
+ color: $primary !important;
+ background-color: transparent;
+ &:hover {
+ background-color: transparent;
+ }
+ }
+ }
+ }
+ }
+ @media (min-width: 992px) {
+ border-color: transparent;
+ background: rgba(0,0,0,0.3);
+ .navbar-brand {
+ color: fade-out($white, .3);
+ height: 60px;
+ width: 350px;
+ &:focus,
+ &:hover {
+ color: $white;
+ }
+ }
+ .navbar-nav > li.nav-item > a.nav-link {
+ padding: 0.5rem 1rem;
+ }
+ .navbar-nav > li.nav-item > a.nav-link,
+ .navbar-nav > li.nav-item > a.nav-link:focus {
+ color: fade-out($white, .3);
+ &:hover {
+ color: $white;
+ }
+ }
+ &.navbar-shrink {
+ border-bottom: 1px solid fade-out($gray-900, .9);
+ background-color: $white;
+ .navbar-brand {
+ color: $primary;
+ &:focus,
+ &:hover {
+ color: darken($primary, .1);
+ }
+ }
+ .navbar-nav > li.nav-item > a.nav-link,
+ .navbar-nav > li.nav-item > a.nav-link:focus {
+ color: $gray-900;
+ &:hover {
+ color: $primary;
+ }
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_other-sections.scss b/app/assets/stylesheets/bootstrap-creative/_other-sections.scss
new file mode 100644
index 0000000..6cb8667
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_other-sections.scss
@@ -0,0 +1,19 @@
+#thinking-together.bg-dark{
+ background-color: $gray-100 !important;
+}
+#learn-with-each-other.bg-dark{
+ background-color: $gray-100 !important;
+}
+#contact {
+ .twitter-timeline-box {
+ display: inline-block;
+ position: relative;
+ margin: 0.5rem;
+ width: 340px;
+ height: 500px;
+ vertical-align: top;
+ }
+}
+#supporters.bg-dark{
+ background-color: $gray-100 !important;
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_portfolio.scss b/app/assets/stylesheets/bootstrap-creative/_portfolio.scss
new file mode 100644
index 0000000..e7214fa
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_portfolio.scss
@@ -0,0 +1,60 @@
+
+// Styling for the portfolio section
+.portfolio-box {
+ position: relative;
+ display: block;
+ max-width: 650px;
+ margin: 0 auto;
+ .portfolio-box-caption {
+ position: absolute;
+ bottom: 0;
+ display: block;
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ opacity: 0;
+ color: $white;
+ background: fade-out($primary, .1);
+ @include transition-all;
+ .portfolio-box-caption-content {
+ position: absolute;
+ top: 50%;
+ width: 100%;
+ transform: translateY(-50%);
+ text-align: center;
+ .project-category,
+ .project-name {
+ padding: 0 15px;
+ @include sans-serif-font;
+ }
+ .project-category {
+ font-size: 14px;
+ font-weight: 600;
+ text-transform: uppercase;
+ }
+ .project-name {
+ font-size: 18px;
+ }
+ }
+ }
+ &:hover {
+ .portfolio-box-caption {
+ opacity: 1;
+ }
+ }
+ &:focus {
+ outline: none;
+ }
+ @media (min-width: 768px) {
+ .portfolio-box-caption {
+ .portfolio-box-caption-content {
+ .project-category {
+ font-size: 16px;
+ }
+ .project-name {
+ font-size: 22px;
+ }
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_services.scss b/app/assets/stylesheets/bootstrap-creative/_services.scss
new file mode 100644
index 0000000..76b2259
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_services.scss
@@ -0,0 +1,5 @@
+
+// Styling for the services section
+.service-box {
+ max-width: 400px;
+}
diff --git a/app/assets/stylesheets/bootstrap-creative/_variables.scss b/app/assets/stylesheets/bootstrap-creative/_variables.scss
new file mode 100644
index 0000000..4655709
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/_variables.scss
@@ -0,0 +1,19 @@
+// Variables
+
+$white: #fff !default;
+$gray-100: #f8f9fa !default;
+$gray-200: #e9ecef !default;
+$gray-300: #dee2e6 !default;
+$gray-400: #ced4da !default;
+$gray-500: #adb5bd !default;
+$gray-600: #868e96 !default;
+$gray-700: #495057 !default;
+$gray-800: #343a40 !default;
+$gray-900: #212529 !default;
+$black: #000 !default;
+
+$p_color: #f0f8ff !default;
+
+$primary: #ffa500 !default;
+
+// $primary: #F05F40 !default;
diff --git a/app/assets/stylesheets/bootstrap-creative/creative.scss b/app/assets/stylesheets/bootstrap-creative/creative.scss
new file mode 100644
index 0000000..83160aa
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap-creative/creative.scss
@@ -0,0 +1,11 @@
+@import "variables";
+@import "mixins";
+@import "bootstrap-overrides";
+@import "global";
+@import "navbar";
+@import "masthead";
+@import "services";
+@import "portfolio";
+@import "animation";
+@import "about";
+@import "other-sections";
diff --git a/app/assets/stylesheets/pages.scss b/app/assets/stylesheets/pages.scss
index 4173e65..abafc43 100644
--- a/app/assets/stylesheets/pages.scss
+++ b/app/assets/stylesheets/pages.scss
@@ -1,128 +1,28 @@
-// Place all the styles related to the pages controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
-.pages-layout {
- .pages-layout__header {
- background-image: linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3)), image-url('coderdojo-konan-header-image-1.jpg');
- background-size: cover;
- background-position: center;
- .mdl-layout__header-row {
- margin-top: 0.5rem;
- margin-bottom: 0.5rem;
- }
- }
- article {
- margin: 0.5rem;
- #pages-section {
- padding: 0.8rem;
- .pages-section-card {
- width: 100%;
- height: 100%;
- padding: 0.5rem;
- }
- }
- .pages-section {
- padding: 0.8rem;
- .pages-section-card {
- width: 100%;
- height: 100%;
- padding: 0.5rem;
- }
- }
- }
- .mdl-layout__content {
- #pages-section {
- .docs-list {
- ul {
- font-size: 1.3rem;
- }
- }
- }
- .pages-contents {
- h1 {
- font-size: 2.0rem;
- color: black;
- line-height: 2.2rem;
- }
- h2 {
- font-size: 1.75rem;
- color: black;
- line-height: 1.8rem;
- }
- h3 {
- font-size: 1.65rem;
- color: black;
- line-height: 1.7rem;
- }
- h4 {
- font-size: 1.5rem;
- line-height: 1.6rem;
- color: black;
- }
- p {
- font-size: 1rem;
- }
- .pages-col {
- display: inline-block;
- vertical-align: middle;
- margin: 1rem;
- }
-
- .ninjas-works-video {
- iframe {
- width: 400px;
- height: 300px;
- }
- }
+// // Place all the styles related to the pages controller here.
+// // They will automatically be included in application.css.
+// // You can use Sass (SCSS) here: http://sass-lang.com/
- .ninjas-works-impressions {
- background: aliceblue;
- -webkit-box-shadow: 2px 2px 0px 0px #777;
- -moz-box-shadow: 2px 2px 0px 0px #777;
- box-shadow: 2px 2px 0px 0px #777;
- border-radius: 10px;
- p {
- color: black;
- }
- .ninjas-works-container {
- padding: 0.3rem;
- width: 100%;
- height: 100%;
- .pages-col {
- display: inline-block;
- padding: 0.3rem;
- margin: 0.5rem;
- margin-top: 1rem;
- h4 {
- margin-top: 0;
- margin-bottom: 0;
- line-height: 1.5rem;
- }
- }
- img {
- margin: auto;
- border-radius: 50%;
- width: 5rem;
- height: 5rem;
- }
- .ninjas-icon {
- p {
- text-align: center;
- margin: 0.1rem;
- }
- }
- }
- }
- .twitter-share-button-style {
- vertical-align: top;
- display: inline-block;
- margin: 0.5rem;
- }
- .fb-share-button-style {
- vertical-align: top;
- display: inline-block;
- margin: 0.5rem;
- }
- }
- }
-}
\ No newline at end of file
+#page-content {
+ .page-title {
+ border-bottom: 0.3rem dotted $primary;
+ }
+ hr {
+ max-width: 100%;
+ border-width: 100%;
+ border-color: $primary;
+ margin-bottom: 1.3rem;
+ }
+ h2 {
+ margin-top: 1.5rem;
+ }
+ h3 {
+ margin-top: 1rem;
+ margin-bottom: 1rem;
+ font-size: 1.5rem;
+ }
+ table {
+ @extend .table;
+ @extend .table-striped;
+ @extend .table-bordered;
+ }
+}
diff --git a/app/assets/stylesheets/staticpages.scss b/app/assets/stylesheets/staticpages.scss
index eb1900a..c06e8e0 100644
--- a/app/assets/stylesheets/staticpages.scss
+++ b/app/assets/stylesheets/staticpages.scss
@@ -1,221 +1,221 @@
-// Place all the styles related to the staticpages controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
-
-.mdl-layout__drawer {
- .mdl-layout-title {
- line-height: 2rem;
- }
-}
-.layout-transparent {
- background-image: linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3)), image-url('coderdojo-konan-header-image-1.jpg');
- background-size: cover;
- background-position: center;
-}
-.mdl-layout__header, .mdl-layout__drawer-button {
- color: snow;
- .mdl-layout__header-row {
- margin-top: 0.5rem;
- .mdl-layout-title {
-
- }
- }
- .header-section {
- color: snow;
- margin-left: auto;
- margin-right: auto;
- padding-top: 5%;
- padding-bottom: 5%;
- text-align: center;
- .header-section-text {
- p {
- font-size: 1.6rem;
- line-height: 2rem;
- text-align: center;
- }
- }
- .header-section-button {
- a {
- color: white;
- font-size: 1.3rem;
- border-radius: 3px;
- padding-left: 0.8rem;
- padding-bottom: 0.8rem;
- padding-top: 0.5rem;
- padding-bottom: 0.5rem;
- }
- }
- }
-}
-main {
-article {
- margin-top: 3rem;
- margin: 1rem;
- #about-section {
- padding: 1rem;
- .mdl-card__title {
- height: 25rem;
- background: linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.8) 90%, rgba(0, 0, 0, 1)), image-url('index/introduction-image/dojo-image-05.jpg') center / cover;
- color: snow;
- }
- .twitter-share-button-style {
- vertical-align: top;
- display: inline-block;
- margin: 0.5rem;
- }
- .fb-share-button-style {
- vertical-align: top;
- display: inline-block;
- margin: 0.5rem;
- }
- .about-section-card {
- width: 100%;
- height: 100%;
- // padding: 0.5rem;
- }
- .next-event-button {
- margin: 1rem;
- }
- }
- #language-section {
- padding: 1rem;
- .language-section-card {
- width: 100%;
- height: 100%;
- padding: 0.5rem;
- .mdl-card__supporting-text {
- padding: 0.5rem;
- margin: auto;
- }
- .language-section-card-cell {
- p,img {
- margin: auto;
- }
- }
- }
- }
- #summary-section {
- padding: 1rem;
- .summary-section-card {
- width: 100%;
- height: 100%;
- padding: 0.5rem;
- }
- }
- #partner-section {
- padding: 1rem;
- .partner-section-card {
- width: 100%;
- height: 100%;
- padding: 0.5rem;
- .mdl-card__supporting-text {
- width: 100%;
- height: 100%;
- padding: 0.5rem;
- margin: auto;
- h3 {
- font-size: 1.5rem;
- text-align: center;
- }
- }
- .language-section-card-cell {
- p,img {
- margin: auto;
- }
- p {
- text-align: center;
- }
- }
- .partner-list {
- padding: 0.8rem;
- margin: 1rem;
- }
- .partner-list-item {
- padding: 0.8rem;
- margin: 1rem;
- width: 20rem;
- height: 5rem;
- list-style-type: none;
- display: inline-block;
- img {
- width: 100%;
- }
- p {
- text-align: center;
- }
- }
- }
- }
- #contact-section {
- padding: 1rem;
- .contact-section-card {
- width: 100%;
- height: 100%;
- padding: 0.5rem;
- .sns-contact-block {
- text-align: center;
- margin: 0.8rem;
- padding: 0.5rem;
- width: 100%;
- height: 100%;
- .fb-page-style {
- display: inline-block;
- margin: 0.5rem;
- vertical-align: top;
- }
- .twitter-timeline-box {
- display: inline-block;
- position: relative;
- margin: 0.5rem;
- width: 340px;
- height: 500px;
- vertical-align: top;
- }
- }
- }
- }
- }
-}
-.still-planned-pages-layout {
- #still-planned-pages-section {
- h1 {
- font-size: 2.3rem
- }
- h2 {
- font-size: 2.0rem;
- }
- h3 {
- font-size: 1.8rem;
- }
- h4 {
- font-size: 1.5rem;
- }
- p {
- font-size: 1rem;
- }
- }
-}
-.next_event_button {
- display: flex;
- position: fixed;
- bottom: 1.5rem;
- right: 1.5rem;
- background-color: red;
- width: 12rem;
- height: 12rem;
- justify-content: center;
- align-items: center;
- text-align: center;
- box-sizing: border-box;
- border-radius: 50%;
- z-index: 8;
- p,a {
- display: block;
- font-size: 1.4rem;
- color: white !important;
- text-decoration: none;
- }
-}
-.next_event_button:hover {
- opacity: 0.7;
-}
+// // Place all the styles related to the staticpages controller here.
+// // They will automatically be included in application.css.
+// // You can use Sass (SCSS) here: http://sass-lang.com/
+//
+// .mdl-layout__drawer {
+// .mdl-layout-title {
+// line-height: 2rem;
+// }
+// }
+// .layout-transparent {
+// background-image: linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3)), image-url('coderdojo-konan-header-image-1.jpg');
+// background-size: cover;
+// background-position: center;
+// }
+// .mdl-layout__header, .mdl-layout__drawer-button {
+// color: snow;
+// .mdl-layout__header-row {
+// margin-top: 0.5rem;
+// .mdl-layout-title {
+//
+// }
+// }
+// .header-section {
+// color: snow;
+// margin-left: auto;
+// margin-right: auto;
+// padding-top: 5%;
+// padding-bottom: 5%;
+// text-align: center;
+// .header-section-text {
+// p {
+// font-size: 1.6rem;
+// line-height: 2rem;
+// text-align: center;
+// }
+// }
+// .header-section-button {
+// a {
+// color: white;
+// font-size: 1.3rem;
+// border-radius: 3px;
+// padding-left: 0.8rem;
+// padding-bottom: 0.8rem;
+// padding-top: 0.5rem;
+// padding-bottom: 0.5rem;
+// }
+// }
+// }
+// }
+// main {
+// article {
+// margin-top: 3rem;
+// margin: 1rem;
+// #about-section {
+// padding: 1rem;
+// .mdl-card__title {
+// height: 25rem;
+// background: linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.8) 90%, rgba(0, 0, 0, 1)), image-url('index/introduction-image/dojo-image-05.jpg') center / cover;
+// color: snow;
+// }
+// .twitter-share-button-style {
+// vertical-align: top;
+// display: inline-block;
+// margin: 0.5rem;
+// }
+// .fb-share-button-style {
+// vertical-align: top;
+// display: inline-block;
+// margin: 0.5rem;
+// }
+// .about-section-card {
+// width: 100%;
+// height: 100%;
+// // padding: 0.5rem;
+// }
+// .next-event-button {
+// margin: 1rem;
+// }
+// }
+// #language-section {
+// padding: 1rem;
+// .language-section-card {
+// width: 100%;
+// height: 100%;
+// padding: 0.5rem;
+// .mdl-card__supporting-text {
+// padding: 0.5rem;
+// margin: auto;
+// }
+// .language-section-card-cell {
+// p,img {
+// margin: auto;
+// }
+// }
+// }
+// }
+// #summary-section {
+// padding: 1rem;
+// .summary-section-card {
+// width: 100%;
+// height: 100%;
+// padding: 0.5rem;
+// }
+// }
+// #partner-section {
+// padding: 1rem;
+// .partner-section-card {
+// width: 100%;
+// height: 100%;
+// padding: 0.5rem;
+// .mdl-card__supporting-text {
+// width: 100%;
+// height: 100%;
+// padding: 0.5rem;
+// margin: auto;
+// h3 {
+// font-size: 1.5rem;
+// text-align: center;
+// }
+// }
+// .language-section-card-cell {
+// p,img {
+// margin: auto;
+// }
+// p {
+// text-align: center;
+// }
+// }
+// .partner-list {
+// padding: 0.8rem;
+// margin: 1rem;
+// }
+// .partner-list-item {
+// padding: 0.8rem;
+// margin: 1rem;
+// width: 20rem;
+// height: 5rem;
+// list-style-type: none;
+// display: inline-block;
+// img {
+// width: 100%;
+// }
+// p {
+// text-align: center;
+// }
+// }
+// }
+// }
+// #contact-section {
+// padding: 1rem;
+// .contact-section-card {
+// width: 100%;
+// height: 100%;
+// padding: 0.5rem;
+// .sns-contact-block {
+// text-align: center;
+// margin: 0.8rem;
+// padding: 0.5rem;
+// width: 100%;
+// height: 100%;
+// .fb-page-style {
+// display: inline-block;
+// margin: 0.5rem;
+// vertical-align: top;
+// }
+// .twitter-timeline-box {
+// display: inline-block;
+// position: relative;
+// margin: 0.5rem;
+// width: 340px;
+// height: 500px;
+// vertical-align: top;
+// }
+// }
+// }
+// }
+// }
+// }
+// .still-planned-pages-layout {
+// #still-planned-pages-section {
+// h1 {
+// font-size: 2.3rem
+// }
+// h2 {
+// font-size: 2.0rem;
+// }
+// h3 {
+// font-size: 1.8rem;
+// }
+// h4 {
+// font-size: 1.5rem;
+// }
+// p {
+// font-size: 1rem;
+// }
+// }
+// }
+// .next_event_button {
+// display: flex;
+// position: fixed;
+// bottom: 1.5rem;
+// right: 1.5rem;
+// background-color: red;
+// width: 12rem;
+// height: 12rem;
+// justify-content: center;
+// align-items: center;
+// text-align: center;
+// box-sizing: border-box;
+// border-radius: 50%;
+// z-index: 8;
+// p,a {
+// display: block;
+// font-size: 1.4rem;
+// color: white !important;
+// text-decoration: none;
+// }
+// }
+// .next_event_button:hover {
+// opacity: 0.7;
+// }
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 84d2cce..ba2a7d2 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,14 +2,24 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
-
+
before_action :put_ver_link
-
+
private
def put_ver_link
- @first_link = { :url => "#{root_url}", :text => "ROOT" }
- @second_link = { :url => "#{root_url}ninjas-works", :text => "作品紹介" }
- @third_link = { :url => "#{root_url}visit-interview", :text => "見学・取材について" }
- @fourth_link = { :url => "#{root_url}f-and-q", :text => "よくある質問 (F&Q)" }
+ @header_links = [
+ { url: "#{root_url}", text: "ROOT" },
+ { url: "#{root_url}", text: "ROOT" },
+ { url: "#{root_url}visit-interview", text: "見学・取材について" },
+ { url: "#{root_url}f-and-q", text: "よくある質問 (F&Q)" }
+ ]
+
+ @footer_links = [
+ { url: "#{root_url}pages", text: "ページ一覧" },
+ { url: "#{root_url}regulation", text: "会則" },
+ { url: "#{root_url}visit-interview", text: "見学・取材について" },
+ { url: "#{root_url}f-and-q", text: "よくある質問 (F&Q)"},
+ { url: "#{root_url}privacy-policy", text: "Privacy Policy(個人情報保護方針)"}
+ ]
end
end
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index 3c53aff..b2147de 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -1,5 +1,6 @@
-class PagesController < ApplicationController
+include MarkdownHelper
+class PagesController < ApplicationController
def index
@title = 'ページ一覧'
@pages = Page.all
@@ -11,10 +12,10 @@ def show
unless @page.exists?
render :action => "not_found_404", :status => 404
end
- @content = Kramdown::Document.new(@page.content).to_html
+ @content = MarkdownHelper.md_to_html @page.content
@url = request.url
end
-
+
def not_found_404
end
-end
\ No newline at end of file
+end
diff --git a/app/controllers/staticpages_controller.rb b/app/controllers/staticpages_controller.rb
index 8a76c6e..1426677 100644
--- a/app/controllers/staticpages_controller.rb
+++ b/app/controllers/staticpages_controller.rb
@@ -1,8 +1,34 @@
class StaticpagesController < ApplicationController
def index
+ @contact_form = ContactForm.new
end
def next_event_is_still_planned
end
def ninjas_works
end
+ def contact
+ @contact_form = ContactForm.new
+ end
+ def contact_form_send
+
+ @contact_form = ContactForm.new(contact_form_params)
+
+ respond_to do |format|
+ if @contact_form.save
+ flash[:notice] = 'お問い合わせの送信が完了しました'
+ format.html { redirect_to :action => "index" }
+ format.json { render :show, status: :ok, location: @contact_form }
+ else
+ flash.now[:alert] = '入力に不備があるか、何かの不具合で送れませんでした。もう一度お試しください。'
+ format.html { render :contact }
+ format.json { render json: @contact_form.errors, status: :unprocessable_entity }
+ end
+ end
+
+ end
+
+ private
+ def contact_form_params
+ params.require(:contact_form).permit(:name, :email, :subject, :body, :agreement_privacy_policy)
+ end
end
diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb
new file mode 100644
index 0000000..ff50761
--- /dev/null
+++ b/app/helpers/markdown_helper.rb
@@ -0,0 +1,21 @@
+module MarkdownHelper
+ def md_to_html(md_text)
+ options = {
+ hard_wrap: true,
+ space_after_headers: true
+ }
+
+ extensions = {
+ autolink: true,
+ no_intra_emphasis: true,
+ fenced_code_blocks: true,
+ tables: true
+ }
+ unless @markdown
+ renderer = Redcarpet::Render::OriginalHTML.new(options)
+ @markdown = Redcarpet::Markdown.new(renderer, extensions)
+ end
+
+ @markdown.render(md_text).html_safe
+ end
+end
diff --git a/app/models/contact_form.rb b/app/models/contact_form.rb
new file mode 100644
index 0000000..c5face2
--- /dev/null
+++ b/app/models/contact_form.rb
@@ -0,0 +1,43 @@
+class ContactForm
+ include ActiveModel::Model
+ include ActiveModel::Attributes
+ #include ActiveModel::Callbacks
+
+ attr_accessor :name, :email, :subject, :body, :agreement_privacy_policy
+ define_model_callbacks :save
+
+ validates :name, presence: true
+ validates :email, presence: true
+ validates :subject, presence: true
+ validates :body, presence: true
+ validates :agreement_privacy_policy, presence: true
+
+ validates_acceptance_of :agreement_privacy_policy, allow_nil: false
+ def save
+ run_callbacks :save do
+ return false if invalid?
+ @name = self.name
+ @email = self.email
+ @subject = self.subject
+ @body = self.body
+
+ bodyAttachments = {"title": "メンターお問いあわせ",
+ "text": "\n\n\n*Email* :\n" + @email +
+ "\n\n*お名前* :\n" + @name +
+ "\n\n*件名* :\n" + @subject +
+ "\n\n*本文* :\n" + @body
+ };
+
+ massage_body = " お問い合わせフォームより新しい通知が来ています! \n"
+
+ slack_notifer_client.post attachments: [bodyAttachments], text: massage_body
+ true
+ end
+ end
+
+ private
+ def slack_notifer_client
+ hooks_url = ENV['SLACK_INCOMING_WEBHOOKS_URL']
+ Slack::Notifier.new hooks_url, channel: "#各種お問い合わせボード"
+ end
+end
diff --git a/app/models/page.rb b/app/models/page.rb
index 1b0257e..997036a 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -29,14 +29,14 @@ def exists?
end
def description
- @desc ||= exists? ? self.content.lines.reject{|l| l =~ /^(\n|<)/ }.second.delete('
').strip : ''
+ @desc ||= exists? ? self.content.match(/\[desc:(.+)\]/)[1] : ''
end
def title
- @title ||= exists? ? self.content.lines.first[2..-1].strip.gsub('
', '') : ''
+ @title ||= exists? ? self.content.match(/\[title:(.+)\]/)[1] : ''
end
def content
@content ||= exists? ? File.read(path) : ''
end
-end
\ No newline at end of file
+end
diff --git a/app/views/application/_footer.haml b/app/views/application/_footer.haml
new file mode 100644
index 0000000..7ae763a
--- /dev/null
+++ b/app/views/application/_footer.haml
@@ -0,0 +1,26 @@
+%footer.bg-dark
+ .footer-connect
+ .container
+ .row
+ .col-lg-12.mx-auto.my-3.text-center.text-white
+ .footer-social
+ %h5 Social Links
+ .footer-social-icons
+ %a.mx-1{ target: "_blank" , href: "https://twitter.com/coderdojo_konan", title: "Twitter" }
+ = fa_icon "twitter 2x"
+ %a.mx-1{ target: "_blank", href: "http://facebook.com/Coderdojo.Konan/", title: "Facebook" }
+ = fa_icon "facebook 2x"
+ %a.mx-1{ target: "_blank", href: "https://www.instagram.com/coderdojo_konan/", title: "Instagram" }
+ = fa_icon "instagram 2x"
+ %a.mx-1{ target: "_blank", href: "https://github.com/CoderDojo-Konan-Okayama", title: "Github" }
+ = fa_icon "github 2x"
+ %a.mx-1{ target: "_blank", href: "https://www.youtube.com/channel/UCRN6euxI9l10q6I-gVewVcw", title: "YouTube" }
+ = fa_icon "youtube 2x"
+ .row
+ .col-lg-8.mx-auto.my-1.text-center.text-white
+ .footer-links
+ - @footer_links.each do |fotter_link|
+ = link_to fotter_link[:text], fotter_link[:url], { :class => "mx-1" }
+ .row
+ .col-lg-12.col-lg-12.mx-auto.my-3.text-center.text-white
+ %p Copyright © 2018 CoderDojo Konan Okayama
diff --git a/app/views/application/_header.haml b/app/views/application/_header.haml
new file mode 100644
index 0000000..7b604ef
--- /dev/null
+++ b/app/views/application/_header.haml
@@ -0,0 +1,13 @@
+- flash.each do |key, value|
+ #info{style: "display:none" }
+ = content_tag(:p, value, class: "#{key}")
+%nav#mainNav.navbar.navbar-expand-lg.navbar-light.fixed-top
+ .container-fluid
+ %a.navbar-brand.js-scroll-trigger{:href => "#{root_url}#page-top"}
+ %button.navbar-toggler.navbar-toggler-right{"aria-controls" => "navbarResponsive", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-target" => "#navbarResponsive", "data-toggle" => "collapse", :type => "button"}
+ %span.navbar-toggler-icon
+ #navbarResponsive.collapse.navbar-collapse
+ %ul.navbar-nav.ml-auto
+ - @header_links.each do |header_links|
+ %li.nav-item
+ = link_to header_links[:text], header_links[:url], { :class => "nav-link js-scroll-trigger" }
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index d61f9c0..4926a36 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -22,4 +22,6 @@
%meta{:coderdojo => "1881439892127060", :property => "fb:pages"}/
%meta{:content => "CoderDojo 岡山 岡南", :name => "author"}/
%body
+ = render 'header'
= yield
+ = render 'footer'
diff --git a/app/views/layouts/pages.html.haml b/app/views/layouts/pages.html.haml
index 4ba4f2a..684647d 100644
--- a/app/views/layouts/pages.html.haml
+++ b/app/views/layouts/pages.html.haml
@@ -2,10 +2,6 @@
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
- / Page styles
- %link{:href => "https://fonts.googleapis.com/icon?family=Material+Icons", :rel => "stylesheet"}/
- %link{:href => "https://code.getmdl.io/1.3.0/material.indigo-pink.min.css", :rel => "stylesheet"}/
- %script{:defer => "defer", :src => "https://code.getmdl.io/1.3.0/material.min.js"}
%title
= yield(:title)
| CoderDojo Konan Okayama
@@ -27,57 +23,15 @@
%meta{:content => "1974108302904511", :property => "fb:app_id"}/
%meta{:coderdojo => "1881439892127060", :property => "fb:pages"}/
%meta{:content => "CoderDojo 岡山 岡南", :name => "author"}/
- %body
- .mdl-layout.mdl-js-layout.pages-layout
- %header.mdl-layout__header.mdl-layout__header--scroll.pages-layout__header
- .mdl-layout__header-row
- / Title
- %span.mdl-layout-title
- %a{:href => root_path}
- %img{:alt => "CoderDojo Konan Okayama", :src => "#{asset_path "coderdojo-konan-header-logo.png"}"}/
- / Add spacer, to align navigation to the right
- .mdl-layout-spacer
- / Navigation
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- .mdl-layout__drawer
- %span.mdl-layout-title CoderDojo Konan Okayama Official Site
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- %main.mdl-layout__content
- %article
- %section#pages-section
- .pages-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text= yield(:title)
- .pages-contents.mdl-card__supporting-text
- .twitter-share-button-style
- %a.twitter-share-button{"data-hashtags" => "CoderDojo岡南", "data-related" => "CoderDojo_Konan,CoderDojoJapan", "data-show-count" => "false", "data-text" => "#{yield(:title) + " - CoderDojo 岡山 岡南 公式HP"}", "data-url" => "#{yield(:url)}", "data-via" => "CoderDojo_Konan", :href => "https://twitter.com/share?ref_src=twsrc%5Etfw"} Tweet
- .fb-share-button.fb-share-button-style{"data-href" => "#{request.url}", "data-layout" => "button_count", "data-mobile-iframe" => "true", "data-size" => "small"}
- %a.fb-xfbml-parse-ignore{:href => "https://www.facebook.com/sharer/sharer.php?u=#{request.url}=sdkpreparse", :target => "_blank"} シェア
- = yield
- %footer.mdl-mini-footer
- .mdl-mini-footer__left-section
- .mdl-logo
- CoderDojo Konan Okayama Official Site
- %ul.mdl-mini-footer__link-list
- %li Copyright © 2018 CoderDojo Konan Okayama
- .mdl-mini-footer__right-section
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://twitter.com/coderdojo_konan", :target => "_blank", :title => "Twitter"}
- %i.fa.fa-twitter
- %button.mdl-mini-footer__social-btn
- %a{:href => "http://facebook.com/Coderdojo.Konan/", :target => "_blank", :title => "Facebook"}
- %i.fa.fa-facebook
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://www.instagram.com/coderdojo_konan/", :target => "_blank", :title => "Instagram"}
- %i.fa.fa-instagram
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://github.com/CoderDojo-Konan-Okayama", :target => "_blank", :title => "Github"}
- %i.fa.fa-github
+ %link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800", :rel => "stylesheet", :type => "text/css"}/
+ %link{:href => "https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic", :rel => "stylesheet", :type => "text/css"}/
+
+ %body#page-top
+ = render 'header'
+ %article
+ %section#page-content
+ .container
+ .row
+ .col-lg-12.mx-auto.my-3
+ = yield
+ = render 'footer'
diff --git a/app/views/layouts/staticpages.html.haml b/app/views/layouts/staticpages.html.haml
index 13ee177..2e3f2fd 100644
--- a/app/views/layouts/staticpages.html.haml
+++ b/app/views/layouts/staticpages.html.haml
@@ -2,17 +2,12 @@
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
- / Page styles
- %link{:href => "https://fonts.googleapis.com/icon?family=Material+Icons", :rel => "stylesheet"}/
- %link{:href => "https://code.getmdl.io/1.3.0/material.indigo-pink.min.css", :rel => "stylesheet"}/
- %script{:defer => "defer", :src => "https://code.getmdl.io/1.3.0/material.min.js"}
- %meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
+ %meta{:name => "viewport", :content => "width=device-width, initial-scale=1, shrink-to-fit=no"}/
%title= full_title(yield(:title))
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
= favicon_link_tag
- %meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
%meta{:content => "summary", :name => "twitter:card"}/
%meta{:content => "@coderdojo_konan", :name => "twitter:site"}/
%meta{:content => "#{full_title(yield(:title))}", :name => "twitter:title"}/
@@ -26,5 +21,9 @@
%meta{:content => "1974108302904511", :property => "fb:app_id"}/
%meta{:coderdojo => "1881439892127060", :property => "fb:pages"}/
%meta{:content => "CoderDojo 岡山 岡南", :name => "author"}/
- %body
+ %link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800", :rel => "stylesheet", :type => "text/css"}/
+ %link{:href => "https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic", :rel => "stylesheet", :type => "text/css"}/
+ %body#page-top
+ = render 'header'
= yield
+ = render 'footer'
diff --git a/app/views/pages/index.html.haml b/app/views/pages/index.html.haml
index 0b9fc56..2aec15c 100644
--- a/app/views/pages/index.html.haml
+++ b/app/views/pages/index.html.haml
@@ -1,7 +1,10 @@
- provide(:title, @title)
- provide(:desc, 'このサイトのページ一覧です。特別なページなどは含まれていない場合もあります。')
- provide(:url, request.url)
-.docs-list
- %ul
+
+%h1.page-title.m-3.p-2= @title
+
+.docs-list.m-3.p-2
+ %ul.list-group
- @pages.each do |page|
- %li= link_to page.title, page.url
+ %li.list-group-item= link_to page.title, page.url
diff --git a/app/views/pages/show.html.haml b/app/views/pages/show.html.haml
index 2e5a904..6bd2aa0 100644
--- a/app/views/pages/show.html.haml
+++ b/app/views/pages/show.html.haml
@@ -1,4 +1,9 @@
- provide(:title, @page.title)
- provide(:desc, @page.description)
- provide(:url, request.url)
-= raw @content
+
+.headings.page-title.m-2.p-2
+ %h1= @page.title
+ %p= @page.description
+.content.m-3.p-2
+ = raw @content
diff --git a/app/views/staticpages/_form.html.haml b/app/views/staticpages/_form.html.haml
new file mode 100644
index 0000000..c283304
--- /dev/null
+++ b/app/views/staticpages/_form.html.haml
@@ -0,0 +1,9 @@
+= simple_form_for @contact_form, :html => { :class => 'form-horizontal' }, :url => { :action => 'contact_form_send'} do |f|
+ = f.input :name, as: :string, placeholder: 'お名前', error: 'この項目は空白にできません。', label: false
+ = f.input :email, as: :string, placeholder: 'メールアドレス', error: 'この項目は空白にできません。', label: false
+ = f.input :subject, as: :string, placeholder: '件名', error: 'この項目は空白にできません。', label: false
+ = f.input :body, as: :text, placeholder: '本文を入力してください。', :input_html => { :rows => 5 }, label: false,
+ error: 'この項目は空白にできません。'
+ = f.input :agreement_privacy_policy, as: :boolean, checked: false, error: '個人情報保護方針へのご同意をお願いします。',
+ label: link_to('個人情報保護方針', "#{root_url}privacy-policy", target: "_blank") + " に同意する。"
+ = f.submit '送信', :class => 'btn btn-primary'
diff --git a/app/views/staticpages/contact.html.haml b/app/views/staticpages/contact.html.haml
new file mode 100644
index 0000000..db49965
--- /dev/null
+++ b/app/views/staticpages/contact.html.haml
@@ -0,0 +1,14 @@
+%section#contact
+ .container
+ .row
+ .col-lg-8.mx-auto.text-center
+ %h2.section-heading
+ %i.fa.fa-envelope-o.sr-contact.mx-3
+ Contact us
+ %hr.my-4/
+ %p.mb-5 何か気になることがございましたら、お気軽にお問い合わせください!
+ .row
+ .col-lg-8.mx-auto.mw-100
+ = render 'form'
+ %br/
+ = link_to 'トップページへ戻る', root_url
diff --git a/app/views/staticpages/index.html.haml b/app/views/staticpages/index.html.haml
index 8874c09..f1db555 100644
--- a/app/views/staticpages/index.html.haml
+++ b/app/views/staticpages/index.html.haml
@@ -1,190 +1,215 @@
-%body
- - provide(:desc, 'CoderDojo 岡山 岡南 の公式サイトです。 CoderDojo とは、小中高生を対象とした無料プログラミング道場です。参加者(ニンジャ)の作りたいものを先生(メンター)がニンジャ目線で一緒に考え、アドバイスをし、 そしてモノづくりの楽しさを共有します!')
- .mdl-layout.mdl-js-layout
- %header.mdl-layout__header.mdl-layout__header--scroll.layout-transparent
- .mdl-layout__header-row
- / Title
- %span.mdl-layout-title
- %img{:alt => "CoderDojo Konan Okayama", :src => "#{asset_path "coderdojo-konan-header-logo.png"}"}/
- / Add spacer, to align navigation to the right
- .mdl-layout-spacer
- / Navigation
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- .header-section
- .header-section-text
- %h2 子供のためのプログラミング道場
- %h1 CoderDojo Konan Okayama
- %br/
- %p
- CoderDojo 岡山 岡南 は、小中高生を対象とした
- %strong> 無料プログラミング道場
- です。
- %br/
- 参加者(ニンジャ)の作りたいものを先生(メンター)がニンジャ目線で一緒に考え、
- %br/
- アドバイスをし、 そしてモノづくりの楽しさを共有します!
- .header-section-button
- - unless next_event_url.nil?
- = link_to "次回の開催をCheck!", next_event_url, class: 'btn mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent mdl-js-ripple-effect', target: "_new"
- - else
- = link_to "申し込みページは只今準備中です!", root_url, class: 'btn btn-disabled mdl-button mdl-js-button'
- .mdl-layout__drawer
- %span.mdl-layout-title CoderDojo Konan Okayama Official Site
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- %main.mdl-layout__content
- %article
- %section#about-section
- .about-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text CoderDojo って?
- .mdl-card__supporting-text
- .twitter-share-button-style
- %a.twitter-share-button{"data-hashtags" => "CoderDojo岡南", "data-related" => "CoderDojo_Konan,CoderDojoJapan", "data-show-count" => "false", "data-text" => "CoderDojo 岡山 岡南 公式ホームページ", "data-url" => root_url, "data-via" => "CoderDojo_Konan", :href => "https://twitter.com/share?ref_src=twsrc%5Etfw"} Tweet
- .fb-share-button.fb-share-button-style{"data-href" => root_url, "data-layout" => "button_count", "data-mobile-iframe" => "true", "data-size" => "small"}
- %a.fb-xfbml-parse-ignore{:href => "https://www.facebook.com/sharer/sharer.php?u=#{root_url}=sdkpreparse", :target => "_blank"} シェア
- %br/
- %p
- CoderDojo は7〜17歳の子どもを対象にした無料で参加できるプログラミング道場(サークル)です。
- %br/
- 2011年にアイルランドで始まり、世界では70カ国・1,200の道場、日本では全国に84以上の道場があります。(2017/5/27現在)
- %p
- 各地のCoderDojoは、それぞれの有志がボランティアで運営していて、
- %br/
- CoderDojoでは、Ninja同士(参加している子供をNinjaといいます。)で教えあったり、
- %br/
- わからないことがあれば、現役プログラマーを中心としたメンターさんに質問したりできます。
- %p CoderDojo で学べる内容は道場ごとに異なります。例えば、次の内容を学べる道場があります。
- %ul
- %li Scratch, Hour of Code
- %li HTML, CSS, JavaScript
- %li PHP, Python, Ruby, Unity
- %li Arduino, Raspberry Pi など
- %p 道場ごとに内容も規模も違いますが、Ninjaの自主性を重視している姿勢は一緒です。
- - unless next_event_url.nil?
- .mdl-card__actions.mdl-card--borde.next-event-button
- = link_to "次回の開催をCheck!", next_event_url, class: 'btn mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent mdl-js-ripple-effect', target: "_new"
- - else
- .mdl-card__actions.mdl-card--borde.next-event-button
- = link_to "申し込みページは只今準備中です!", root_url, class: 'btn btn-disabled mdl-button mdl-js-button'
- %section#language-section
- .language-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text CoderDojo 岡山 岡南での主な言語・ツール
- .mdl-card__supporting-text
- .mdl-grid
- .mdl-cell.mdl-cell--3-col.mdl-cell--8-col-tablet.language-section-card-cell
- %img{:alt => "Scratch Cat", :src => "#{asset_path "index/scratch-cat.png"}"}/
- %p
- %a{:href => "https://scratch.mit.edu/"} Scratch
- .mdl-cell.mdl-cell--3-col.mdl-cell--8-col-tablet.language-section-card-cell
- %img{:alt => "Java Logo", :src => "#{asset_path "index/java-original.png"}"}/
- %p
- %a{:href => "https://www.java.com/ja/"} Java
- .mdl-cell.mdl-cell--3-col.mdl-cell--8-col-tablet.language-section-card-cell
- %img{:alt => "Web系言語", :src => "#{asset_path "index/web-lang.png"}"}/
- %p
- %a HTML・CSS・JavaScript
- .mdl-cell.mdl-cell--3-col.mdl-cell--8-col-tablet.language-section-card-cell
- %img{:alt => "Ruby (on Rails)", :src => "#{asset_path "index/ruby-original.png"}"}/
- %p
- %a{:href => "https://www.ruby-lang.org/ja/"} Ruby (on Rails)
- %section#summary-section
- .summary-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text CoderDojo 岡山 岡南 の 開催概要
- .mdl-card__supporting-text
- %p
- %strong> 毎月 第三日曜日
- に開催しています。
- %p
- %strong> 事前申し込み制
- です。申し込みページよりお申し込みください。
- %p PCは無料でレンタル可能ですが、事前申込で、定員があります。
- %p 開始時刻の10分前には会場に到着しておいてください。
- %p 水筒などをお持ちの方は、開催前に指定場所においてください。
- %p
- %strong また、水分補給などは、指定場所ですること!(精密機械を扱っているため。)(配線に注意!)
- %section#partner-section
- .partner-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text パートナー
- .mdl-card__supporting-text
- %h3 CoderDojo 岡山 岡南 は、これらのパートナー様のご支援によって成り立っております!
- %ul.partner-list
- %li.partner-list-item
- %img#sakura-internet-logo{:src => "#{asset_path "index/supporter/sakura-internet.png"}"}/
- .mdl-tooltip{"data-mdl-for" => "sakura-internet-logo"} 「さくらのクラウド」の無償提供
- %p SAKURA INTERNET INC. 様
- %li.partner-list-item
- %img#esa-io-logo{:src => "#{asset_path "index/supporter/esa.png"}"}/
- .mdl-tooltip{"data-mdl-for" => "esa-io-logo"} ドキュメント共有サービスの提供
- %p ESA.IO 様
- %li.partner-list-item
- %img#rimgate-logo{:src => "#{asset_path "index/supporter/non-logo.png"}"}/
- .mdl-tooltip{"data-mdl-for" => "rimgate-logo"} サーバー・ドメイン代などの支援
- %p リムゲイト株式会社 様
- %section#contact-section
- .contact-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text お問い合わせ
- .mdl-card__supporting-text
- #wufoo-mv590ug0y8dwt7
- Fill out my
- = succeed "." do
- %a{:href => "https://coderdojokonancontact.wufoo.com/forms/mv590ug0y8dwt7"} online form
- #wuf-adv{:style => "font-family:inherit;font-size: small;color:#a7a7a7;text-align:center;display:block;"}
- There are tons of
- %a{:href => "http://www.wufoo.com/features/"} Wufoo features
- to help make your forms awesome.
- %br/
- :javascript
- var mv590ug0y8dwt7;(function(d, t) {
- var s = d.createElement(t), options = {
- 'userName':'coderdojokonancontact',
- 'formHash':'mv590ug0y8dwt7',
- 'autoResize':true,
- 'height':'560',
- 'async':true,
- 'host':'wufoo.com',
- 'header':'show',
- 'ssl':true};
- s.src = ('https:' == d.location.protocol ? 'https://' : 'http://') + 'www.wufoo.com/scripts/embed/form.js';
- s.onload = s.onreadystatechange = function() {
- var rs = this.readyState; if (rs) if (rs != 'complete') if (rs != 'loaded') return;
- try { mv590ug0y8dwt7 = new WufooForm();mv590ug0y8dwt7.initialize(options);mv590ug0y8dwt7.display(); } catch (e) {}};
- var scr = d.getElementsByTagName(t)[0], par = scr.parentNode; par.insertBefore(s, scr);
- })(document, 'script');
- .sns-contact-block
- .fb-page.fb-page-style{"data-adapt-container-width" => "true", "data-hide-cover" => "false", "data-href" => "https://www.facebook.com/Coderdojo.Konan/", "data-show-facepile" => "true", "data-small-header" => "false", "data-tabs" => "timeline"}
- %blockquote.fb-xfbml-parse-ignore{:cite => "https://www.facebook.com/Coderdojo.Konan/"}
- %a{:href => "https://www.facebook.com/Coderdojo.Konan/"} CoderDojo 岡山 岡南
- .twitter-timeline-box
- %a.twitter-follow-button{"data-show-count" => "false", :href => "https://twitter.com/CoderDojo_Konan?ref_src=twsrc%5Etfw"} Follow @CoderDojo_Konan
- %a.twitter-timeline{"data-height" => "500", "data-theme" => "light", "data-width" => "340", :href => "https://twitter.com/coderdojo_konan?ref_src=twsrc%5Etfw"} Tweets by coderdojo_konan
- %footer.mdl-mini-footer
- .mdl-mini-footer__left-section
- .mdl-logo
- CoderDojo Konan Okayama Official Site
- %ul.mdl-mini-footer__link-list
- %li Copyright © 2018 CoderDojo Konan Okayama
- .mdl-mini-footer__right-section
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://twitter.com/coderdojo_konan", :target => "_blank", :title => "Twitter"}
- %i.fa.fa-twitter
- %button.mdl-mini-footer__social-btn
- %a{:href => "http://facebook.com/Coderdojo.Konan/", :target => "_blank", :title => "Facebook"}
- %i.fa.fa-facebook
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://www.instagram.com/coderdojo_konan/", :target => "_blank", :title => "Instagram"}
- %i.fa.fa-instagram
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://github.com/CoderDojo-Konan-Okayama", :target => "_blank", :title => "Github"}
- %i.fa.fa-github
+%header.masthead.text-center.text-white.d-flex
+ .container.my-auto
+ .row
+ .col-lg-10.mx-auto
+ %h2 子供のためのプログラミング道場
+ %h1
+ %strong> CoderDojo Konan Okayama
+ %hr.light.my-4/
+ .col-lg-10.mx-auto
+ %p.mb-2
+ %strong>"CoderDojo"
+ とは小中高生を対象とした
+ %strong>"無料プログラミングコミュニティ"
+ です。
+ %br
+ %p.mb-5
+ %strong>"アイデア"
+ を形にする
+ %strong>"楽しさ"
+ を体感し、
+ %br/
+ %strong>"プロのCoder"
+ から
+ %strong>"アドバイス"
+ や
+ %strong>"刺激"
+ を受け、
+ %br/
+ %strong>"友達"
+ たちと交流しながら
+ %strong>"技術"を"磨き合い"
+ 、
+ %br/
+ %strong>"未来を創るクリエイター"
+ になれ!
+
+ - unless next_event_url.nil?
+ = link_to "次回の開催をCheck!", next_event_url, class: 'btn btn-primary btn-xl js-scroll-trigger text-white', target: "_new"
+ - else
+ = link_to "申し込みページは只今準備中です!", "#{root_url}#page-top", class: 'btn btn-disabled btn-xl border border-primary js-scroll-trigger text-white'
+%section#about.bg-primary.p-5
+ .container
+ .row
+ .col-lg-8.mx-auto.text-center
+ %h2.section-heading.text-white What's the CoderDojo? - CoderDojo とは
+ %hr.light.my-4/
+ %p.mb-4.text-white
+ CoderDojo は7〜17歳の子どもを対象にした無料で参加できるプログラミング道場(サークル)です。
+ %br/
+ 2011年にアイルランドで始まり、世界では70カ国・1,200以上の道場、
+ %br/
+ 日本では全国に84以上の道場があります。(2017/5/27現在)
+ %p.mb-4.text-white
+ 各地のCoderDojoは、それぞれの有志がボランティアで運営していて、
+ %br/
+ CoderDojoでは、Ninja同士(参加している子供をNinjaといいます。)で教えあったり、
+ %br/
+ わからないことがあれば、現役プログラマーを中心としたメンターさんに質問したりできます。
+ - unless next_event_url.nil?
+ = link_to "次回の開催をCheck!", next_event_url, class: 'btn btn-light btn-xl js-scroll-trigger', target: "_new"
+ - else
+ = link_to "申し込みページは只今準備中です!", "#{root_url}#page-top", class: 'btn btn-disabled border border-white btn-xl js-scroll-trigger text-white'
+%section#thinking-together.bg-dark.p-3
+ .container
+ .row
+ .col-lg-8.mx-auto.p-3.my-3
+ %img.img-fluid{:alt => "開催風景 1", :src => "#{asset_path "index/introduction-image/dojo-image-06.jpg"}"}/
+ .col-lg-8.mx-auto.my-3.text-center
+ %h2.section-heading Thinking together - 一緒になって考える
+ %hr.light.my-4/
+ %p.mb-4
+ CoderDojo 岡山 岡南 は、みんなが同じことをするのではなく、
+ %br/
+ それぞれのやりたいこと・作りたいものに対して、メンターが同じ目線で、
+ %br/
+ 一緒になって考えてくれ、
+ %br/
+ そしてアドバイスしてくれる場所です。
+ %p.mb-4
+ そのため、特にカリキュラムや、課題などは無く、
+ %br/
+ 各自がテキストを持ってきたり、作りたいものを作ったり、
+ %br/
+ %a{href: 'https://coderdojo.jp/kata/', target: '_new'} CoderDojo Kata
+ などに掲載されているテキストをやったりもしています。
+ %br/
+ とても自由な雰囲気で、そして楽しみながらやることに重点を置いているのです。
+%section#share-what-you-made.bg-white.p-3
+ .container
+ .row
+ .col-lg-8.mx-auto.p-3.my-3
+ %img.img-fluid{:alt => "開催風景 2", :src => "#{asset_path "index/introduction-image/dojo-image-07.png"}"}/
+ .col-lg-8.mx-auto.my-3.text-center
+ %h2.section-heading
+ Share what you made
+ %br - 作ったものを共有する
+ %hr.my-4/
+ %p.mb-4
+ CoderDojo では、必ず会の終わりに発表会があります。
+ %br/
+ そこでは、その日に作った作品や、学んだことなどを思う存分に発表することができます。
+ %br/
+ 素晴らしい箇所には拍手や、「すごい!」などの声があがり、やる気が上がります。
+ %br/
+ また、直した方が良い箇所や、悩んでいる所についても、
+ %br/
+ メンターや他のNinjaが一緒に考えたりしてくれます。
+ %p.mb-4
+ もちろん、これは Ninja だけが楽しむのではありません。
+ %br/
+ 参加しているメンターも、時には目を見張るような、
+ %br/
+ 素晴らしいアイデアや工夫をした作品に出会う時があります。
+ %br/
+ そういう時は、データを持ち帰って研究するなど、メンター自身も楽しんでいるのです。
+ %p.mb-4
+ このように、Ninja - メンター と双方向で楽しめるのが、CoderDojo で、
+ %br/
+ メンターの楽しんでいる様子を見て、また Ninja も楽しむようになるのです。
+
+%section#learn-with-each-other.bg-dark.p-3
+ .container
+ .row
+ .col-lg-8.mx-auto.p-3.my-3
+ %img.img-fluid{:alt => "開催風景 3", :src => "#{asset_path "index/introduction-image/dojo-image-01.jpg"}"}/
+ .col-lg-8.mx-auto.my-3.text-center
+ %h2.section-heading
+ Learn with each other and co-polish
+ %br - 共に学び、共に磨く
+ %hr.my-4/
+ %p.mb-4
+ それぞれが違うことをやっているからと言って、
+ %br/
+ 全くもって交流しないというわけではありません。
+ %p.mb-4
+ 自分も、他人も、それぞれがお互いにきちんと尊重し、
+ %br/
+ 同じことをやっているNinja同士、互いにそのやり方を教えあったり、
+ %br/
+ また別のことをやっていたとしても、そのNinjaに関心を持ち、
+ %br/
+ 積極的に交流ができ、どんどん知見や関係を深め、広めることができる。
+ %p.mb-4
+ CoderDojo 岡山 岡南 運営一同 は、そういう場でありたいと願っております。
+ %p.mb-4
+ 中には全くもって初対面だったのに、Dojoを通し、仲良くなったNinja達も居ます。
+ %br/
+ 彼らは互いに切磋琢磨し、めきめきと上達してきているのです。
+%section#language.bg-white
+ .container
+ .row
+ .col-lg-12.text-center
+ %h2.section-heading CoderDojo 岡山 岡南 での主な言語
+ %h6.section-heading あくまで目安であって、他の言語でも大歓迎です!
+ %hr.my-4/
+ .container
+ .row
+ .col-lg-3.col-md-6.text-center
+ .service-box.mt-5.mx-auto
+ %img.mb-3.sr-icons.img-fluid{:alt => "Scratch Cat", :src => "#{asset_path "index/scratch-cat.png"}"}/
+ %h4.mb-3 Scratch
+ .col-lg-3.col-md-6.text-center
+ .service-box.mt-5.mx-auto
+ %img.mb-3.sr-icons.img-fluid{:alt => "Java Logo", :src => "#{asset_path "index/java-original.png"}"}/
+ %h4.mb-3 Java
+ .col-lg-3.col-md-6.text-center
+ .service-box.mt-5.mx-auto
+ %img.mb-3.sr-icons.img-fluid{:alt => "Web系言語", :src => "#{asset_path "index/web-lang.png"}"}/
+ %h4.mb-3 HTML/CSS/JavaScript
+ .col-lg-3.col-md-6.text-center
+ .service-box.mt-5.mx-auto
+ %img.mb-3.sr-icons.img-fluid{:alt => "Ruby (on Rails)", :src => "#{asset_path "index/ruby-original.png"}"}/
+ %h4.mb-3 Ruby(on Rails)
+%section#supporters.bg-dark
+ .container
+ .row
+ .col-lg-12.text-center
+ %h2.section-heading Supporters
+ %h6.section-heading.text-fade CoderDojo 岡山 岡南 の活動はこれらのサポータの皆様によって成り立っています!
+ %hr.my-4/
+ .container
+ .row
+ .col-lg-3.col-md-6.text-center.mx-auto
+ .service-box.mt-5.mx-auto
+ %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="サーバー・ドメインなどの提供")/
+ %h4.mb-3 リムゲイト株式会社 様
+ .col-lg-3.col-md-6.text-center.mx-auto
+ .service-box.mt-5.mx-auto
+ %img.mb-3.sr-icons.img-fluid{:alt => "ESA", :src => "#{asset_path "index/supporter/esa.png"}"}(data-toggle="tooltip" data-placement="top" title="ドキュメント共有サービスの提供")/
+ %h4.mb-3 ESA.IO 様
+ .col-lg-3.col-md-6.text-center.mx-auto
+ .service-box.mt-5.mx-auto
+ %img.mb-3.sr-icons.img-fluid{:alt => "さくらインターネット", :src => "#{asset_path "index/supporter/sakura-internet.png"}"}(data-toggle="tooltip" data-placement="top" title="「さくらのクラウド」の無償提供")/
+ %h4.mb-3 SAKURA INTERNET INC. 様
+%section#contact
+ .container
+ .row
+ .col-lg-8.mx-auto.text-center
+ %h2.section-heading
+ %i.fa.fa-envelope-o.sr-contact.mx-3
+ Contact us
+ %hr.my-4/
+ %p.mb-5 何か気になることがございましたら、お気軽にお問い合わせください!
+ .row
+ .col-lg-8.mx-auto.mw-100
+ = render 'form'
+ .row
+ .col-lg-4.mx-auto.my-3.p-2.mw-100
+ .fb-page.fb-page-style{"data-adapt-container-width" => "true", "data-hide-cover" => "false", "data-href" => "https://www.facebook.com/Coderdojo.Konan/", "data-show-facepile" => "true", "data-small-header" => "false", "data-tabs" => "timeline"}
+ %blockquote.fb-xfbml-parse-ignore{:cite => "https://www.facebook.com/Coderdojo.Konan/"}
+ %a{:href => "https://www.facebook.com/Coderdojo.Konan/"} CoderDojo 岡山 岡南
+ .col-lg-4.mx-auto.my-3.p-2.mw-100
+ .twitter-timeline-box
+ %a.twitter-follow-button{"data-show-count" => "false", :href => "https://twitter.com/CoderDojo_Konan?ref_src=twsrc%5Etfw"} Follow @CoderDojo_Konan
+ %a.twitter-timeline{"data-height" => "500", "data-theme" => "light", "data-width" => "340", :href => "https://twitter.com/coderdojo_konan?ref_src=twsrc%5Etfw"} Tweets by coderdojo_konan
diff --git a/app/views/staticpages/next_event_is_still_planned.html.haml b/app/views/staticpages/next_event_is_still_planned.html.haml
deleted file mode 100644
index c8bd60b..0000000
--- a/app/views/staticpages/next_event_is_still_planned.html.haml
+++ /dev/null
@@ -1,61 +0,0 @@
-%body
- - provide(:title, '次回の開催はまだ計画中です...')
- - provide(:desc, '次回の開催はまだ計画中です...')
- .mdl-layout.mdl-js-layout.pages-layout
- %header.mdl-layout__header.mdl-layout__header--scroll.pages-layout__header
- .mdl-layout__header-row
- / Title
- %span.mdl-layout-title
- %a{:href => root_path}
- %img{:alt => "CoderDojo Konan Okayama", :src => "#{asset_path 'coderdojo-konan-header-logo.png'}"}/
- / Add spacer, to align navigation to the right
- .mdl-layout-spacer
- / Navigation
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- .mdl-layout__drawer
- %span.mdl-layout-title CoderDojo Konan Okayama Official Site
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- %main.mdl-layout__content
- %article
- %section#pages-section
- .pages-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text 次回の開催はまだ計画中です...
- #pages_contents.mdl-card__supporting-text
- .entry-content
- %h1{:style => "text-align: center;"}
- %span{:style => "color: #ff6600;"} 次回の開催はまだ計画中です… 😉
- %h2{:style => "text-align: center;"}
- %span{:style => "text-decoration: underline;"} 日時、場所などが決定したら、各種SNSや、ブログなどでお知らせします!
- %h3{:style => "text-align: center;"}
- %a{:href => "http://konan-coderdojo.connpass.com/"} イベント申込サービス(Connpass)グループページ
- %h4{:style => "text-align: center;"} このグループに参加すると、イベントが公開される度にメールでお知らせされます!!
- %h3{:style => "text-align: center;"} 決定するまで、もうしばらくお待ちください!
- %p{:style => "text-align: center;"}= link_to 'トップページに戻る', root_path
- %footer.mdl-mini-footer
- .mdl-mini-footer__left-section
- .mdl-logo
- CoderDojo Konan Okayama Official Site
- %ul.mdl-mini-footer__link-list
- %li Copyright © 2018 CoderDojo Konan Okayama
- .mdl-mini-footer__right-section
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://twitter.com/coderdojo_konan", :target => "_blank", :title => "Twitter"}
- %i.fa.fa-twitter
- %button.mdl-mini-footer__social-btn
- %a{:href => "http://facebook.com/Coderdojo.Konan/", :target => "_blank", :title => "Facebook"}
- %i.fa.fa-facebook
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://www.instagram.com/coderdojo_konan/", :target => "_blank", :title => "Instagram"}
- %i.fa.fa-instagram
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://github.com/CoderDojo-Konan-Okayama", :target => "_blank", :title => "Github"}
- %i.fa.fa-github
diff --git a/app/views/staticpages/ninjas_works.html.haml b/app/views/staticpages/ninjas_works.html.haml
deleted file mode 100644
index 12f3761..0000000
--- a/app/views/staticpages/ninjas_works.html.haml
+++ /dev/null
@@ -1,94 +0,0 @@
-%body
- - provide(:title, '参加したNinjaの作品')
- - provide(:desc, '参加したNinjaの作品です。
とてもユニークな発想で、とても面白いです。制作者のコメントと共にご覧ください。')
- .mdl-layout.mdl-js-layout.pages-layout
- %header.mdl-layout__header.mdl-layout__header--scroll.pages-layout__header
- .mdl-layout__header-row
- / Title
- %span.mdl-layout-title
- %a{:href => root_path}
- %img{:alt => "CoderDojo Konan Okayama", :src => "#{asset_path "coderdojo-konan-header-logo.png"}"}/
- / Add spacer, to align navigation to the right
- .mdl-layout-spacer
- / Navigation
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- .mdl-layout__drawer
- %span.mdl-layout-title CoderDojo Konan Okayama Official Site
- %nav.mdl-navigation
- %a.mdl-navigation__link{:href => "#{@first_link[:url]}"}= @first_link[:text]
- %a.mdl-navigation__link{:href => "#{@second_link[:url]}"}= @second_link[:text]
- %a.mdl-navigation__link{:href => "#{@third_link[:url]}"}= @third_link[:text]
- %a.mdl-navigation__link{:href => "#{@fourth_link[:url]}"}= @fourth_link[:text]
- %main.mdl-layout__content
- %article
- %section.pages-section
- .pages-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text 参加したNinjaの作品
- .pages-contents.mdl-card__supporting-text
- .twitter-share-button-style
- %a.twitter-share-button{"data-hashtags" => "CoderDojo岡南", "data-related" => "CoderDojo_Konan,CoderDojoJapan", "data-show-count" => "false", "data-text" => "作品紹介 - CoderDojo 岡山 岡南 公式HP", "data-url" => "#{request.url}", "data-via" => "CoderDojo_Konan", :href => "https://twitter.com/share?ref_src=twsrc%5Etfw"} Tweet
- %script{:async => "", :charset => "utf-8", :src => "https://platform.twitter.com/widgets.js"}
- .fb-share-button.fb-share-button-style{"data-href" => "#{request.url}", "data-layout" => "button_count", "data-mobile-iframe" => "true", "data-size" => "small"}
- %a.fb-xfbml-parse-ignore{:href => "https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fcoderdojo-konan.jp%2F&src=sdkpreparse", :target => "_blank"} シェア
- %p 参加したNinjaの作品です。
- %p とてもユニークな発想で、とても面白いです。
- %p 制作者のメッセージと一緒にご覧ください。
- %p
- %strong なお、作品を実際に動かすには、 Adobe Flash が必要となります!
- %p 対応した端末でご覧ください!
- %section.pages-section
- .pages-section-card.mdl-card.mdl-shadow--2dp
- .mdl-card__title
- %h1.mdl-card__title-text アンダイン的な何か
- .pages-contents.mdl-card__supporting-text
- .pages-col
- .ninjas-works-video
- %iframe#ytplayer{:allowfullscreen => "", :frameborder => "0", :height => "300", :src => "https://www.youtube.com/embed/_QdREfAxlAY?loop=1", :type => "text/html", :width => "400"}
- .pages-col
- .ninjas-works-impressions
- .ninjas-works-container
- .pages-col.ninjas-icon
- %img{:src => "#{asset_path "ninjas-icon/ucchi.jpg"}"}/
- %br/
- %p
- うっちー
- %br/
- .pages-col
- %h4 作ったNinjaのメッセージ
- %p
- 赤いハートを上下左右キーで動かして、猫が飛ばしてくる矢印をよけるゲームです。
- %br/
- 赤、青矢印はまっすぐ飛びますが、白い矢印はハートに向かって追尾してきて、
- %br/
- さらにあたってしまうと少しの間ハートが止まります。
- %br/
- しかし、白矢印は赤や青よりダメージが低いです。
- %br/
- 矢印の色別に速度や動きを変えたりと工夫しました。
- %br/
- = link_to "遊ぶ / コードを見てみる", 'https://scratch.mit.edu/projects/210911830/', |
- class: 'btn mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent mdl-js-ripple-effect', target: "_new" |
- %footer.mdl-mini-footer
- .mdl-mini-footer__left-section
- .mdl-logo
- CoderDojo Konan Okayama Official Site
- %ul.mdl-mini-footer__link-list
- %li Copyright © 2018 CoderDojo Konan Okayama
- .mdl-mini-footer__right-section
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://twitter.com/coderdojo_konan", :target => "_blank", :title => "Twitter"}
- %i.fa.fa-twitter
- %button.mdl-mini-footer__social-btn
- %a{:href => "http://facebook.com/Coderdojo.Konan/", :target => "_blank", :title => "Facebook"}
- %i.fa.fa-facebook
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://www.instagram.com/coderdojo_konan/", :target => "_blank", :title => "Instagram"}
- %i.fa.fa-instagram
- %button.mdl-mini-footer__social-btn
- %a{:href => "https://github.com/CoderDojo-Konan-Okayama", :target => "_blank", :title => "Github"}
- %i.fa.fa-github
diff --git a/config/application.rb b/config/application.rb
index 747e325..586dec6 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -11,6 +11,9 @@ class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1
+ config.autoload_paths += %W(#{config.root}/lib)
+ config.autoload_paths += Dir["#{config.root}/lib/**/"]
+
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb
new file mode 100644
index 0000000..3947db0
--- /dev/null
+++ b/config/initializers/simple_form.rb
@@ -0,0 +1,182 @@
+# frozen_string_literal: true
+#
+# Uncomment this and change the path if necessary to include your own
+# components.
+# See https://github.com/plataformatec/simple_form#custom-components to know
+# more about custom components.
+# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
+#
+# Use this setup block to configure all options available in SimpleForm.
+SimpleForm.setup do |config|
+ # Wrappers are used by the form builder to generate a
+ # complete input. You can remove any component from the
+ # wrapper, change the order or even add your own to the
+ # stack. The options given below are used to wrap the
+ # whole input.
+ config.wrappers :default, class: :input,
+ hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b|
+ ## Extensions enabled by default
+ # Any of these extensions can be disabled for a
+ # given input by passing: `f.input EXTENSION_NAME => false`.
+ # You can make any of these extensions optional by
+ # renaming `b.use` to `b.optional`.
+
+ # Determines whether to use HTML5 (:email, :url, ...)
+ # and required attributes
+ b.use :html5
+
+ # Calculates placeholders automatically from I18n
+ # You can also pass a string as f.input placeholder: "Placeholder"
+ b.use :placeholder
+
+ ## Optional extensions
+ # They are disabled unless you pass `f.input EXTENSION_NAME => true`
+ # to the input. If so, they will retrieve the values from the model
+ # if any exists. If you want to enable any of those
+ # extensions by default, you can change `b.optional` to `b.use`.
+
+ # Calculates maxlength from length validations for string inputs
+ # and/or database column lengths
+ b.optional :maxlength
+
+ # Calculate minlength from length validations for string inputs
+ b.optional :minlength
+
+ # Calculates pattern from format validations for string inputs
+ b.optional :pattern
+
+ # Calculates min and max from length validations for numeric inputs
+ b.optional :min_max
+
+ # Calculates readonly automatically from readonly attributes
+ b.optional :readonly
+
+ ## Inputs
+ # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :label_input
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
+ b.use :error, wrap_with: { tag: :span, class: :error }
+
+ ## full_messages_for
+ # If you want to display the full error message for the attribute, you can
+ # use the component :full_error, like:
+ #
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
+ end
+
+ # The default wrapper to be used by the FormBuilder.
+ config.default_wrapper = :default
+
+ # Define the way to render check boxes / radio buttons with labels.
+ # Defaults to :nested for bootstrap config.
+ # inline: input + label
+ # nested: label > input
+ config.boolean_style = :nested
+
+ # Default class for buttons
+ config.button_class = 'btn'
+
+ # Method used to tidy up errors. Specify any Rails Array method.
+ # :first lists the first message for each field.
+ # Use :to_sentence to list all errors for each field.
+ # config.error_method = :first
+
+ # Default tag used for error notification helper.
+ config.error_notification_tag = :div
+
+ # CSS class to add for error notification helper.
+ config.error_notification_class = 'error_notification'
+
+ # ID to add for error notification helper.
+ # config.error_notification_id = nil
+
+ # Series of attempts to detect a default label method for collection.
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
+
+ # Series of attempts to detect a default value method for collection.
+ # config.collection_value_methods = [ :id, :to_s ]
+
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
+ # config.collection_wrapper_tag = nil
+
+ # You can define the class to use on all collection wrappers. Defaulting to none.
+ # config.collection_wrapper_class = nil
+
+ # You can wrap each item in a collection of radio/check boxes with a tag,
+ # defaulting to :span.
+ # config.item_wrapper_tag = :span
+
+ # You can define a class to use in all item wrappers. Defaulting to none.
+ # config.item_wrapper_class = nil
+
+ # How the label text should be generated altogether with the required text.
+ config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
+
+ # You can define the class to use on all labels. Default is nil.
+ # config.label_class = nil
+
+ # You can define the default class to be used on forms. Can be overriden
+ # with `html: { :class }`. Defaulting to none.
+ # config.default_form_class = nil
+
+ # You can define which elements should obtain additional classes
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
+
+ # Whether attributes are required by default (or not). Default is true.
+ # config.required_by_default = true
+
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
+ # These validations are enabled in SimpleForm's internal config but disabled by default
+ # in this configuration, which is recommended due to some quirks from different browsers.
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
+ # change this configuration to true.
+ config.browser_validations = false
+
+ # Collection of methods to detect if a file type was given.
+ # config.file_methods = [ :mounted_as, :file?, :public_filename, :attached? ]
+
+ # Custom mappings for input types. This should be a hash containing a regexp
+ # to match as key, and the input type that will be used when the field name
+ # matches the regexp as value.
+ # config.input_mappings = { /count/ => :integer }
+
+ # Custom wrappers for input types. This should be a hash containing an input
+ # type as key and the wrapper that will be used for all inputs with specified type.
+ # config.wrapper_mappings = { string: :prepend }
+
+ # Namespaces where SimpleForm should look for custom input classes that
+ # override default inputs.
+ # config.custom_inputs_namespaces << "CustomInputs"
+
+ # Default priority for time_zone inputs.
+ # config.time_zone_priority = nil
+
+ # Default priority for country inputs.
+ # config.country_priority = nil
+
+ # When false, do not use translations for labels.
+ # config.translate_labels = true
+
+ # Automatically discover new inputs in Rails' autoload path.
+ # config.inputs_discovery = true
+
+ # Cache SimpleForm inputs discovery
+ # config.cache_discovery = !Rails.env.development?
+
+ # Default class for inputs
+ # config.input_class = nil
+
+ # Define the default class of the input wrapper of the boolean input.
+ config.boolean_label_class = 'checkbox'
+
+ # Defines if the default input wrapper class should be included in radio
+ # collection wrappers.
+ # config.include_default_input_wrapper_class = true
+
+ # Defines which i18n scope will be used in Simple Form.
+ # config.i18n_scope = 'simple_form'
+
+ # Defines validation classes to the input_field. By default it's nil.
+ # config.input_field_valid_class = 'is-valid'
+ # config.input_field_error_class = 'is-invalid'
+end
diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb
new file mode 100644
index 0000000..0178fd5
--- /dev/null
+++ b/config/initializers/simple_form_bootstrap.rb
@@ -0,0 +1,439 @@
+# frozen_string_literal: true
+
+# Please do not make direct changes to this file!
+# This generator is maintained by the community around simple_form-bootstrap:
+# https://github.com/rafaelfranca/simple_form-bootstrap
+# All future development, tests, and organization should happen there.
+# Background history: https://github.com/plataformatec/simple_form/issues/1561
+
+# Uncomment this and change the path if necessary to include your own
+# components.
+# See https://github.com/plataformatec/simple_form#custom-components
+# to know more about custom components.
+# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
+
+# Use this setup block to configure all options available in SimpleForm.
+SimpleForm.setup do |config|
+ # Default class for buttons
+ config.button_class = 'btn'
+
+ # Define the default class of the input wrapper of the boolean input.
+ config.boolean_label_class = 'form-check-label'
+
+ # How the label text should be generated altogether with the required text.
+ config.label_text = lambda { |label, required, explicit_label| "#{label} #{required}" }
+
+ # Define the way to render check boxes / radio buttons with labels.
+ config.boolean_style = :inline
+
+ # You can wrap each item in a collection of radio/check boxes with a tag
+ config.item_wrapper_tag = :div
+
+ # Defines if the default input wrapper class should be included in radio
+ # collection wrappers.
+ config.include_default_input_wrapper_class = false
+
+ # CSS class to add for error notification helper.
+ config.error_notification_class = 'alert alert-danger'
+
+ # Method used to tidy up errors. Specify any Rails Array method.
+ # :first lists the first message for each field.
+ # :to_sentence to list all errors for each field.
+ config.error_method = :to_sentence
+
+ # add validation classes to `input_field`
+ config.input_field_error_class = 'is-invalid'
+ config.input_field_valid_class = 'is-valid'
+
+
+ # vertical forms
+ #
+ # vertical default_wrapper
+ config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :maxlength
+ b.optional :minlength
+ b.optional :pattern
+ b.optional :min_max
+ b.optional :readonly
+ b.use :label, class: 'form-control-label'
+ b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # vertical input for boolean
+ config.wrappers :vertical_boolean, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper :form_check_wrapper, tag: 'div', class: 'form-check' do |bb|
+ bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ bb.use :label, class: 'form-check-label'
+ bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ # vertical input for radio buttons and check boxes
+ config.wrappers :vertical_collection, item_wrapper_class: 'form-check', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
+ ba.use :label_text
+ end
+ b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # vertical input for inline radio buttons and check boxes
+ config.wrappers :vertical_collection_inline, item_wrapper_class: 'form-check form-check-inline', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
+ ba.use :label_text
+ end
+ b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # vertical file input
+ config.wrappers :vertical_file, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :maxlength
+ b.optional :minlength
+ b.optional :readonly
+ b.use :label
+ b.use :input, class: 'form-control-file', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # vertical multi select
+ config.wrappers :vertical_multi_select, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.use :label, class: 'form-control-label'
+ b.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |ba|
+ ba.use :input, class: 'form-control mx-1', error_class: 'is-invalid', valid_class: 'is-valid'
+ end
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # vertical range input
+ config.wrappers :vertical_range, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :readonly
+ b.optional :step
+ b.use :label
+ b.use :input, class: 'form-control-range', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+
+ # horizontal forms
+ #
+ # horizontal default_wrapper
+ config.wrappers :horizontal_form, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :maxlength
+ b.optional :minlength
+ b.optional :pattern
+ b.optional :min_max
+ b.optional :readonly
+ b.use :label, class: 'col-sm-3 col-form-label'
+ b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba|
+ ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
+ ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ # horizontal input for boolean
+ config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper tag: 'label', class: 'col-sm-3' do |ba|
+ ba.use :label_text
+ end
+ b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |wr|
+ wr.wrapper :form_check_wrapper, tag: 'div', class: 'form-check' do |bb|
+ bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ bb.use :label, class: 'form-check-label'
+ bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+ end
+
+ # horizontal input for radio buttons and check boxes
+ config.wrappers :horizontal_collection, item_wrapper_class: 'form-check', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.use :label, class: 'col-sm-3 form-control-label'
+ b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba|
+ ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ # horizontal input for inline radio buttons and check boxes
+ config.wrappers :horizontal_collection_inline, item_wrapper_class: 'form-check form-check-inline', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.use :label, class: 'col-sm-3 form-control-label'
+ b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba|
+ ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ # horizontal file input
+ config.wrappers :horizontal_file, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :maxlength
+ b.optional :minlength
+ b.optional :readonly
+ b.use :label, class: 'col-sm-3 form-control-label'
+ b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba|
+ ba.use :input, error_class: 'is-invalid', valid_class: 'is-valid'
+ ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ # horizontal multi select
+ config.wrappers :horizontal_multi_select, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.use :label, class: 'col-sm-3 control-label'
+ b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba|
+ ba.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |bb|
+ bb.use :input, class: 'form-control mx-1', error_class: 'is-invalid', valid_class: 'is-valid'
+ end
+ ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ # horizontal range input
+ config.wrappers :horizontal_range, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :readonly
+ b.optional :step
+ b.use :label, class: 'col-sm-3 form-control-label'
+ b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba|
+ ba.use :input, class: 'form-control-range', error_class: 'is-invalid', valid_class: 'is-valid'
+ ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+
+ # inline forms
+ #
+ # inline default_wrapper
+ config.wrappers :inline_form, tag: 'span', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :maxlength
+ b.optional :minlength
+ b.optional :pattern
+ b.optional :min_max
+ b.optional :readonly
+ b.use :label, class: 'sr-only'
+
+ b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ b.optional :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # inline input for boolean
+ config.wrappers :inline_boolean, tag: 'span', class: 'form-check flex-wrap justify-content-start mr-sm-2', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :label, class: 'form-check-label'
+ b.use :error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ b.optional :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+
+ # bootstrap custom forms
+ #
+ # custom input for boolean
+ config.wrappers :custom_boolean, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper :form_check_wrapper, tag: 'div', class: 'custom-control custom-checkbox' do |bb|
+ bb.use :input, class: 'custom-control-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ bb.use :label, class: 'custom-control-label'
+ bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ config.wrappers :custom_boolean_switch, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper :form_check_wrapper, tag: 'div', class: 'custom-control custom-checkbox-switch' do |bb|
+ bb.use :input, class: 'custom-control-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ bb.use :label, class: 'custom-control-label'
+ bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+ end
+
+ # custom input for radio buttons and check boxes
+ config.wrappers :custom_collection, item_wrapper_class: 'custom-control', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
+ ba.use :label_text
+ end
+ b.use :input, class: 'custom-control-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # custom input for inline radio buttons and check boxes
+ config.wrappers :custom_collection_inline, item_wrapper_class: 'custom-control custom-control-inline', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
+ ba.use :label_text
+ end
+ b.use :input, class: 'custom-control-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # custom file input
+ config.wrappers :custom_file, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :maxlength
+ b.optional :minlength
+ b.optional :readonly
+ b.use :label, class: 'form-control-label'
+ b.wrapper :custom_file_wrapper, tag: 'div', class: 'custom-file' do |ba|
+ ba.use :input, class: 'custom-file-input', error_class: 'is-invalid', valid_class: 'is-valid'
+ ba.use :label, class: 'custom-file-label'
+ ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ end
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # custom multi select
+ config.wrappers :custom_multi_select, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.use :label, class: 'form-control-label'
+ b.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |ba|
+ ba.use :input, class: 'custom-select mx-1', error_class: 'is-invalid', valid_class: 'is-valid'
+ end
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # custom range input
+ config.wrappers :custom_range, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :readonly
+ b.optional :step
+ b.use :label, class: 'form-control-label'
+ b.use :input, class: 'custom-range', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+
+ # Input Group - custom component
+ # see example app and config at https://github.com/rafaelfranca/simple_form-bootstrap
+ # config.wrappers :input_group, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ # b.use :html5
+ # b.use :placeholder
+ # b.optional :maxlength
+ # b.optional :minlength
+ # b.optional :pattern
+ # b.optional :min_max
+ # b.optional :readonly
+ # b.use :label, class: 'form-control-label'
+ # b.wrapper :input_group_tag, tag: 'div', class: 'input-group' do |ba|
+ # ba.optional :prepend
+ # ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
+ # ba.optional :append
+ # end
+ # b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
+ # b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ # end
+
+
+ # Floating Labels form
+ #
+ # floating labels default_wrapper
+ config.wrappers :floating_labels_form, tag: 'div', class: 'form-label-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.optional :maxlength
+ b.optional :minlength
+ b.optional :pattern
+ b.optional :min_max
+ b.optional :readonly
+ b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :label, class: 'form-control-label'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+ # custom multi select
+ config.wrappers :floating_labels_select, tag: 'div', class: 'form-label-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
+ b.use :html5
+ b.optional :readonly
+ b.use :input, class: 'custom-select custom-select-lg', error_class: 'is-invalid', valid_class: 'is-valid'
+ b.use :label, class: 'form-control-label'
+ b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
+ b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
+ end
+
+
+ # The default wrapper to be used by the FormBuilder.
+ config.default_wrapper = :vertical_form
+
+ # Custom wrappers for input types. This should be a hash containing an input
+ # type as key and the wrapper that will be used for all inputs with specified type.
+ config.wrapper_mappings = {
+ boolean: :vertical_boolean,
+ check_boxes: :vertical_collection,
+ date: :vertical_multi_select,
+ datetime: :vertical_multi_select,
+ file: :vertical_file,
+ radio_buttons: :vertical_collection,
+ range: :vertical_range,
+ time: :vertical_multi_select
+ }
+
+ # enable custom form wrappers
+ # config.wrapper_mappings = {
+ # boolean: :custom_boolean,
+ # check_boxes: :custom_collection,
+ # date: :custom_multi_select,
+ # datetime: :custom_multi_select,
+ # file: :custom_file,
+ # radio_buttons: :custom_collection,
+ # range: :custom_range,
+ # time: :custom_multi_select
+ # }
+end
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
new file mode 100644
index 0000000..2374383
--- /dev/null
+++ b/config/locales/simple_form.en.yml
@@ -0,0 +1,31 @@
+en:
+ simple_form:
+ "yes": 'Yes'
+ "no": 'No'
+ required:
+ text: 'required'
+ mark: '*'
+ # You can uncomment the line below if you need to overwrite the whole required html.
+ # When using html, text and mark won't be used.
+ # html: '*'
+ error_notification:
+ default_message: "Please review the problems below:"
+ # Examples
+ # labels:
+ # defaults:
+ # password: 'Password'
+ # user:
+ # new:
+ # email: 'E-mail to sign in.'
+ # edit:
+ # email: 'E-mail.'
+ # hints:
+ # defaults:
+ # username: 'User name to sign in.'
+ # password: 'No special characters, please.'
+ # include_blanks:
+ # defaults:
+ # age: 'Rather not say'
+ # prompts:
+ # defaults:
+ # age: 'Select your age'
diff --git a/config/routes.rb b/config/routes.rb
index c1d57b2..f0b96e1 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -2,15 +2,19 @@
resources :posts
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
-
+
root 'staticpages#index'
-
+
+ post '/send-contact-form' => 'staticpages#contact_form_send'
+
+ get '/contact-form' => 'staticpages#contact'
+
get '/pages' => 'pages#index'
get '/next-event-is-still-planned' => 'staticpages#next_event_is_still_planned'
get '/ninjas-works' => 'staticpages#ninjas_works'
-
+
resources :pages, only: [:show], :path => '/'
-
+
# Example of regular route:
# get 'products/:id' => 'catalog#view'
diff --git a/db/pages/disaster-response.md b/db/pages/disaster-response.md
index 4a8d381..5243b40 100644
--- a/db/pages/disaster-response.md
+++ b/db/pages/disaster-response.md
@@ -1,51 +1,61 @@
-# 各種警報発令時・災害時 の対応について
+
今のところ、以下のようになっていますが、会場となる公民館なども別途対応を定めています。
場合によってはそちらの対応の方を優先される可能性もありますのでご注意ください。
また、この方針は、 CoderDojo 岡山 岡南 の方針です。
他のCoderDojo とは異なる場合もありますのでご注意ください。
-## 警報発令時・災害時の対応
+# 警報発令時・災害時の対応
+---
+
-### 開催前
+## 開催前
+---
-以下の場合、CoderDojo 岡山 岡南 の開催は中止です。
+以下の場合、CoderDojo 岡山 岡南 の開催は中止・延期となります。
- 岡山地域で、受付開始2時間前までに暴風・暴風雨・大雪・暴風雪・津波・土砂・噴火警報発令のいずれかが発令の場合。
- 岡山地域で、開始4時間前〜開催中に避難準備情報、避難勧告、避難指示のいずれかが発令された場合。
- その他に、非常に高い確率で、上記各種警報・各種情報が発令されると予測される場合。
- 会場への来場が非常に危険で、難しいと運営によって判断された場合。
-※ 以上に当てはまらず、開催される場合でも、来場が難しい・危険と判断される場合は、開催の有無にかかわらず、無理をせず自己判断で自主キャンセルをしてください。
-また、当日前に災害救助法が適用される災害が岡山地域に出るような災害が発生した時点で、その後のイベント全てを事前連絡無しでキャンセルする可能性がございます。
+※ 以上に当てはまらず、開催される場合でも、来場が難しい・危険と判断される場合は、開催の有無にかかわらず、
+無理をせず自己判断で自主キャンセルをしてください。
-※ Yahoo!防災情報アプリ などを活用し、情報を収集しながら来場ください。
+また、当日前に災害救助法が適用される災害が岡山地域に出るような災害が発生した時点で、
+その後のイベント全てを事前連絡無しでキャンセルする可能性がございます。
-### 開催中
+※ Yahoo!防災情報アプリ などを活用し、情報を収集しながら来場ください。
+## 開催中
+---
基本的に下記の場合、開催は即中止します。
-また、一人での帰宅が困難だと判断される場合、保護者様によるお迎えをお頼みすることがあります。
+また、一人での帰宅が困難だと判断される場合、保護者様によるお迎えをお願いすることがあります。
-- 岡山市で、開催中に、暴風・暴風雨・大雪・暴風雪・津波・土砂・噴火警報発令のいずれかが発令され、会場にいることが非常に危険だと判断されたとき。
+- 岡山市で、開催中に、暴風・暴風雨・大雪・暴風雪・津波・土砂・噴火警報発令のいずれかが発令され、
+ 会場にいることが非常に危険だと判断されたとき。
- 岡山市で、開催中に、避難準備情報、避難勧告、避難指示のいずれかが発令された場合。
- その他に、非常に高い確率で、上記各種警報・各種情報が発令されると予測される場合。
- その他に、重大な災害が起こる可能性があり、帰宅させたほうがいいと運営によって判断されたとき。
-
-
-## 中止の場合の連絡手段について
-### 開催前
+# 中止の場合の連絡手段について
+---
+## 開催前
+---
開催申込時に入力していただいたメールアドレスにお知らせいたします。
また、各種SNSでもお知らせします。
-### 開催中
-
+## 開催中
+---
メールアドレスにご連絡します。
また、余りにも緊急性の高い場合、緊急連絡先にもご連絡します。
-
-皆さん、気象情報にはよく気を付けてご来場ください!
\ No newline at end of file
+
+皆さん、気象情報にはよく気を付けてご来場ください!
diff --git a/db/pages/f-and-q.md b/db/pages/f-and-q.md
index 9ed3e64..48a3dba 100644
--- a/db/pages/f-and-q.md
+++ b/db/pages/f-and-q.md
@@ -1,8 +1,9 @@
-# よくある質問 (F&Q)
+
-お問い合わせなどでよく質問さえれる事項をまとめています。
-
-## Ninja って何するの?
+# Ninja って何するの?
---
Ninja は、CoderDojo 独自の用語で、主に参加者である子供の事を指します。
@@ -14,10 +15,9 @@ CoderDojo は自主性をとても重視しており、CoderDojo 岡山 岡南
**(なお、これは CoderDojo 岡山 岡南 の形であり、ほかの全Dojoがこのような形をとっているとは限りません。)**
-
-
+
-## Mentor(メンター)って何するの?
+# Mentor(メンター)って何するの?
---
自分の知っている知識、技術を子どもたちに見せ、思いっきり自慢し、また教えてあげるのがメンターの役目です。
@@ -33,4 +33,3 @@ CoderDojo は自主性をとても重視しており、CoderDojo 岡山 岡南
-
diff --git a/db/pages/marking-test.md b/db/pages/marking-test.md
deleted file mode 100644
index d1bb399..0000000
--- a/db/pages/marking-test.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# h1 エイチ1
-
-## h2 エイチ2
-
-### h3 エイチ3
-
-#### h4 エイチ4
-
-ふつうじ 普通時
-
-**Bold 太字**
\ No newline at end of file
diff --git a/db/pages/privacy-policy.md b/db/pages/privacy-policy.md
new file mode 100644
index 0000000..d6b6877
--- /dev/null
+++ b/db/pages/privacy-policy.md
@@ -0,0 +1,59 @@
+
+
+CoderDojo 岡山 岡南(以下「当会」)は、以下のとおり個人情報保護方針を定め、
+全スタッフ・関係者に遵守させるものとします。
+
+# 個人情報の取得について
+---
+
+当会は、業務上必要な範囲内で、適法かつ公正な手段により個人情報を取得します。
+当会は、申し込みページ、お問い合わせフォーム・お問い合わせへの回答業務などにより個人情報を取得します。
+
+
+# 個人情報の管理
+---
+
+## 個人情報の利用目的
+
+- 当会からの開催の準備などのご連絡
+- お問い合わせに対する回答
+- 各種報告書などの統計資料への利用
+- 各種メディアの取材への対応
+
+利用目的の達成に必要な範囲を超えて個人情報を取り扱うときは、個人情報保護法第16条第3号各号に掲げる場合を除き、ご本人の同意を得るものといたします。
+
+## 個人情報の第三者への開示・提供の禁止
+当会は、利用者様からお預かりした個人情報を適切に管理し、次のいずれかに該当する場合を除き、個人情報を第三者に開示いたしません。
+
+- 利用者様の同意がある場合
+- 利用者様が希望されるサービスを行なうために当会の活動に関連する、団体・企業(保険会社など)へ開示する必要がある場合
+- 法令に基づき開示することが必要である場合
+
+# 個人情報の管理について
+---
+当会は、個人情報の正確性及び安全性確保のために、以下の処置をします。
+
+## 個人情報に関する請求
+利用者様が個人情報の照会・修正・削除などをご希望される場合には、
+その権利を認め、ご本人であることを確認の上、対応させていただきます。
+
+## 法令、規範の遵守、見直し
+当会は、保有する個人情報に関して適用される日本の法令、その他規範を遵守するとともに、本ポリシーの内容を適宜見直し、その改善に努めます。
+
+## 匿名加工情報の取扱い
+当会は、法令に定める措置を講じて特定の個人を識別することができないように個人情報を加工して得られる個人に関する情報であって、
+当該個人情報を復元することができないようにしたもの(匿名加工個人情報) を作成する場合には、以下の対応を行います。
+
+- 法令で定める基準に従って、適法な加工を施すこと
+- 法令で定める基準に従って、削除した情報や加工の方法に関する情報の漏洩を防止するために安全管理措置を講じること
+
+# お問い合せ先
+---
+当会の個人情報の取扱に関するお問い合せは下記までご連絡ください。
+コーダー道場 岡山 岡南(CoderDojo Konan Okayama)
+E-mail: contact@coderdojo-konan.media-interesting.info
+
+以上
diff --git a/db/pages/visit-interview.md b/db/pages/visit-interview.md
index 19cd0eb..5724a50 100644
--- a/db/pages/visit-interview.md
+++ b/db/pages/visit-interview.md
@@ -1,14 +1,13 @@
-# 見学・取材について
+
-
-興味は持っているが参加までには踏み切れない、どのような感じでやっているのか気になる、そういう方は、見学が可能です。また、取材の場合もご連絡をお願いしていますので、ご覧ください。
-
-## 見学
+# 見学
---
見学は、開催日の一週間前までに、見学申込フォームよりお申し込みください。
ただ、Ninjaの場合は見学となりますととてもつまらないと思いますので、是非ご参加ください。
-
初参加、初心者でも丁寧にサポートいたします。ご安心ください。
見学フォーム: [https://goo.gl/forms/M9ouksAqZ37BZaRM2](https://goo.gl/forms/M9ouksAqZ37BZaRM2)
@@ -19,7 +18,7 @@
**会場の広さによって可否がございますので、イベント詳細ページよりご確認ください。**
-## 取材
+# 取材
---
申し訳ございませんが、まだフォームが完成していません。
@@ -29,7 +28,7 @@
ご了承ください。
-#### 送信していただく内容
+### 送信していただく内容
- 所属団体名
- お名前(複数人の場合は、代表者のお名前)
@@ -38,4 +37,4 @@
- 写真・動画の撮影の有無
- 返信の連絡先
-お手数ですが、よろしくお願いします。
\ No newline at end of file
+お手数ですが、よろしくお願いします。
diff --git a/lib/redcarpet/render/original_html.rb b/lib/redcarpet/render/original_html.rb
new file mode 100644
index 0000000..868e208
--- /dev/null
+++ b/lib/redcarpet/render/original_html.rb
@@ -0,0 +1,6 @@
+class Redcarpet::Render::OriginalHTML < Redcarpet::Render::HTML
+ def header(text, level)
+ level += 1
+ "