Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ def my_practice?(practice)
def smart_search_available?
Rails.env.local? || Switchlet.enabled?(:smart_search)
end

def movie_available?
Rails.env.local? || Switchlet.enabled?(:movie)
end
end
3 changes: 1 addition & 2 deletions app/helpers/page_tabs/practices_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def practice_page_tabs(practice, active_tab:)
tabs << { name: '日報', link: practice_reports_path(practice), count: practice.reports.length }
tabs << { name: '質問', link: practice_questions_path(practice), count: practice.questions.length }
tabs << { name: 'Docs', link: practice_pages_path(practice), count: practice.pages.length }
# TODO: 動画機能の完成時に本番環境で公開。動画リンクを隠した状態でのリリース。
tabs << { name: '動画', link: practice_movies_path(practice), count: practice.movies.length } unless Rails.env.production?
tabs << { name: '動画', link: practice_movies_path(practice), count: practice.movies.length } if movie_available?
tabs << { name: '提出物', link: practice_products_path(practice) }
tabs << { name: '模範解答', link: practice_submission_answer_path(practice) } if practice.submission_answer.present?
tabs << { name: 'コーディングテスト', link: practice_coding_tests_path(practice) } if practice.coding_tests.present?
Expand Down
7 changes: 3 additions & 4 deletions app/views/pages/_doc_movie_header.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ header.page-header
.page-header__inner
.page-header__start
h2.page-header__title
- if Rails.env.production?
// 動画リンクを隠した状態でのリリース。リリース後にDocs・動画に変更する
| Docs
- else
- if movie_available?
| Docs・動画
- else
| Docs
3 changes: 1 addition & 2 deletions app/views/pages/_tabs.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
li.page-tabs__item
= link_to pages_path, class: "page-tabs__item-link #{current_link(/^pages/)}"
| Docs
- unless Rails.env.production?
// リンクを隠した状態でのリリース
- if movie_available?
li.page-tabs__item
= link_to movies_path, class: "page-tabs__item-link #{current_link(/^movies/)}"
| 動画