-
-
Notifications
You must be signed in to change notification settings - Fork 108
モバイル版のDojo一覧を地域ごとにアコーディオンにまとめるようにする #188
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
モバイル版のDojo一覧を地域ごとにアコーディオンにまとめるようにする #188
Conversation
@@ -33,6 +33,8 @@ gem 'faraday_middleware', '0.10' | |||
|
|||
gem 'koala' | |||
|
|||
gem 'rack-user_agent' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ページを参照している端末が、スマホかそうでないかの判定に使用します
app/views/static_pages/home.html.erb
Outdated
</li> | ||
<% end %> | ||
</ul> | ||
<% if request.from_smartphone? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここでUA判定をおこない、スマホのときはアコーディオンで表示。そうでない場合は従来と同じviewをrenderします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request.variant
を設定しているので、こちらを使ってテンプレートの出し分けをするほうがシンプルかなと思いましたがどうでしょうか?
cf: https://railsguides.jp/4_1_release_notes.html#action-pack-variant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
つまりhome.html.erb
を、PC用とスマホ用の2つ準備するイメージでしょうか? 🤔
今のところ一部だけなので、そこまでの切り分けは不要かなーと考えています。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nalabjp
あー・・・なんとなくわかりました 😅
ifで分けるのではなく、_dojos.html+phone.erb
と_dojo.html.erb
にするイメージでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifで分けるのではなく、_dojos.html+phone.erbと_dojo.html.erbにするイメージでしょうか?
👍
はい、partialで分けてしまうと条件判定が不要になるのでテンプレート的にも良さそうかなと思いました😌(なるべくviewにはロジックを置きたくないなーと)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
断然その通りですねー! 😄
修正します!
おぉ...!! 素早いPRありがとうございます 😸 |
@@ -9,7 +9,7 @@ | |||
</section> | |||
|
|||
<section class="introduction text-center list"> | |||
<p>CoderDojo は7〜17歳の子どもを対象にしたプログラミング道場です。2011年にアイルランドで始まり、世界では<%= Dojo::NUM_OF_COUNTRIES %>カ国・<%= Dojo::NUM_OF_WHOLE_DOJOS %>の道場、日本では全国に<b><%= @dojos.count %></b>以上の道場があります。これまでに<b><%= Dojo::NUM_OF_WHOLE_EVENTS %></b>回以上のイベントが開催されました。</p> | |||
<p>CoderDojo は7〜17歳の子どもを対象にしたプログラミング道場です。2011年にアイルランドで始まり、世界では<%= Dojo::NUM_OF_COUNTRIES %>カ国・<%= Dojo::NUM_OF_WHOLE_DOJOS %>の道場、日本では全国に<b><%= @dojo_count %></b>以上の道場があります。これまでに<b><%= Dojo::NUM_OF_WHOLE_EVENTS %></b>回以上のイベントが開催されました。</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dojo.count
-> @dojo_count
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI変更のbefore -> afterを確認したいですね。(スクショ比較)
デザイン的な確認と、pc版のオーダーが変わっていないかどうか、あたりを 👀
おー、スクリーンショットありがとうございます! 😸 ✨ 「ここはタップできるよ!」という演出 (ボタンっぽさの演出?) がなにか出せると良いのかなぁと考えているんですが、何かアイデアありませんか? 🤔💭 > @himajin315 @nanophate |
自分もキャレットを追加するのがいいかなと思いました。 ref: https://www.bootply.com/89084 これはプラスマイナスですが、格納時には右向きキャレット、展開時は下向きキャレットのイメージです。 |
.oO(himajin315さんの仕事が早い...!! 💨 ✨) |
文言に関してはちょっと考えたいですね。短い文言で伝えられたらなと考えています。例えば「四国 - 2 Dojos」や「四国 - 2 道場」のような感じです🤔💭 |
おー、PRの修正ありがとうございます! 😸 まずはこちらのキャレット案でデプロイしてみましょう! 🚀 ✨ マージしちゃいますね ;) 🔧 💨 |
あ、マージした後に気づいたんですが、アコーディオンを開いた後にといると、下線が残ってしまいますね >< 💦 こちらは別の Issue にまとめておきました! #196 「近畿」を開いて閉じた結果 |
すみません。あまり技術的なこととは関係がないのですが…これ、なんで中部が関東より先なんでしょう…いえ、なんとなく政府が出している統計データなども踏まえて一般的に北海道・東北・関東・中部…の順では…というところで、関東と中部の情報を見ようとして上下逆で迷子になりまして… |
@togazo お、たぶん僕が適当に並べちゃっていて、 zephiransas さんはそれに合わせていただいた感じですね 😅 この Issue/PR とは関係ないトピックなので、別の Issue として書き出してもらって良いですか? 🤔 |
#201 に書き出しておきました😉 |
ありがとうございます! 😸 |
close #174