Skip to content

[WIP]/events の追加 #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1c5b3cb
add notes `order`
AnaTofuZ Feb 28, 2018
b75746d
modofied `orde` notes
AnaTofuZ Feb 28, 2018
9c1212a
update_date_dojo.md
AnaTofuZ Feb 28, 2018
c02f95c
touch events.html.haml and add static_pages_controller_spec test
AnaTofuZ Feb 28, 2018
8880b62
Add IslayTouch to 水戸/ひたちなか
yasulab Mar 1, 2018
e29b99f
Update order column in yaml maigration task
yasulab Mar 2, 2018
c214365
Tweak layout of code in yaml migration
yasulab Mar 2, 2018
cea0909
Change order of columns due to updating yaml migration task
yasulab Mar 2, 2018
24da0f0
Merge pull request #273 from coderdojo-japan/add-order-to-yaml
yasulab Mar 2, 2018
e14ede1
:new: Add CoderDojo 津山
yasulab Mar 2, 2018
5fbe49f
Merge pull request #274 from coderdojo-japan/add-tsuyama-dojo
yasulab Mar 2, 2018
226f174
Add static number of dojos to flush meta tags in DB
yasulab Mar 2, 2018
b23815b
Revert to show number of dojos dynamically
yasulab Mar 2, 2018
db6d12b
Merge pull request #269 from AnaTofuZ/modified_how-to-add-dojo.md
yasulab Mar 2, 2018
fa396c1
Add new lines and shorten link to README
yasulab Mar 2, 2018
e2f3d32
Update how to add dojo document
yasulab Mar 2, 2018
8ba4ed8
Add example of adding dojo
yasulab Mar 2, 2018
5f88a07
Add Japanese message when failed to detect city code
yasulab Mar 2, 2018
477f973
Add CoderDojo 甲斐竜王
yasulab Mar 2, 2018
2a0529a
modofied namespace statiscs/providers/ to providers/
AnaTofuZ Mar 5, 2018
1a03b3c
remove module Statistics namespace for lib/providers/*.rb
AnaTofuZ Mar 5, 2018
cb0a915
Merge branch 'add_events_pages' of ssh://github.com/AnaTofuZ/coderdoj…
AnaTofuZ Mar 5, 2018
4b8f227
lib/statistics.rbでの `providers` の名前空間からstatisticsを外した
AnaTofuZ Mar 5, 2018
ec1f07b
名前空間の変更に伴うlib/tasks/statistics.rakeでのStatistics::Providersの名前修正
AnaTofuZ Mar 5, 2018
1e412e4
git mv spec/lib/statistics/providers -> spec/lib/providers/*
AnaTofuZ Mar 5, 2018
4721898
spec/lib/providers* でのテスト対象の名前空間の修正
AnaTofuZ Mar 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ https://coderdojo.jp/docs にあるドキュメントの編集方法も同様で

[Kata](https://coderdojo.jp/kata) や [Sotechsha](https://coderdojo.jp/sotechsha) などのいくつかのページは、[Scrivito](https://scrivito.com/) と呼ばれる CMS (コンテンツ管理サービス) で運営しています。背景や使用例については次のスライドをご参照ください。

CoderDojo を支える Rails CMS の活用事例 - Speaker Deck
CoderDojo を支える Rails CMS の活用事例 - Speaker Deck
https://speakerdeck.com/yasulab/case-study-rails-cms-for-coderdojo

編集方法については下記の手順書をご参考にしてください。

記事の編集手順書 - Google Drive
https://docs.google.com/document/d/1Va1tImybdArVHAoLgqv035OXeUd0P8MB98hCiUyG5z4/edit?usp=sharing
記事の編集手順書 - Google Drive
http://bit.ly/coderdojo-kata-edit


編集用のユーザーアカウントを発行したい場合は [@yasulab](https://twitter.com/yasulab) までお問い合わせください。

Expand Down
9 changes: 9 additions & 0 deletions app/controllers/static_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ def stats
end
end

def events
@url = request.url
@regions_and_dojos = Dojo.eager_load(:prefecture).default_order.group_by { |dojo| dojo.prefecture.region }
@events = Dojo.where(evented_at:
Time.zone.now..Time.zone.now.end_of_year)
#@hoge = Statistics::Aggregation.new(from: Time.current.strftime('%Y'),to:Time.current.strftime('%Y')).run
end


def letsencrypt
if params[:id] == ENV['LETSENCRYPT_REQUEST']
render text: ENV['LETSENCRYPT_RESPONSE']
Expand Down
19 changes: 19 additions & 0 deletions app/views/static_pages/events.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- provide(:url, @url)
- provide(:title, 'イベント情報')
- provide(:meta_description, '近日開催される CoderDojo の情報をまとめています。')
%section.cover
= image_tag "coderdojo-stats_cover.png", class: "cursor-default"
%section#dojos.dojos.text-center
%bpr
%h1 イベント情報
%p 本ページでは近日開催される CoderDojo の情報をまとめています。
CoderDojo の活動状況を把握する際などにご活用ください。


%h3 関連リンク
%ul{:style => "list-style: none; margin-left: -40px;"}
%li
%a{:href => "https://docs.google.com/spreadsheets/d/17-M-qv5c0MdE_ZIFk566I2CGCIDHFkQwXWiunDXCGVw/edit#gid=354377216"} 日本の CoderDojo (zen登録済) - Google Spreadsheet
%li
%a{:href => "https://github.com/coderdojo-japan/coderdojo.jp/issues/258"} 直近の CoderDojo 開催情報を表示したい issue 258
%br/
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Static Pages
root "static_pages#home"
get "/stats", to: 'static_pages#stats'
get "/events", to: 'static_pages#events'

# Redirects
get "/releases/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend')
Expand Down
Loading