Skip to content

Commit

Permalink
remove Appointments
Browse files Browse the repository at this point in the history
  • Loading branch information
fwolfst committed Oct 7, 2020
1 parent fa4c61f commit ef0fab0
Show file tree
Hide file tree
Showing 17 changed files with 3 additions and 487 deletions.
72 changes: 0 additions & 72 deletions app/controllers/admin/appointments_controller.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/models/appointment.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class Style < ApplicationRecord

has_many :courses
has_many :lessons
has_many :appointments

validates :name, presence: true, length: { minimum: 2 }, uniqueness: true

Expand Down
32 changes: 0 additions & 32 deletions app/views/admin/appointments/_form.html.haml

This file was deleted.

30 changes: 0 additions & 30 deletions app/views/admin/appointments/_table.html.haml

This file was deleted.

7 changes: 0 additions & 7 deletions app/views/admin/appointments/edit.html.haml

This file was deleted.

23 changes: 0 additions & 23 deletions app/views/admin/appointments/index.html.haml

This file was deleted.

10 changes: 0 additions & 10 deletions app/views/admin/appointments/new.html.haml

This file was deleted.

34 changes: 0 additions & 34 deletions app/views/admin/appointments/show.html.haml

This file was deleted.

7 changes: 1 addition & 6 deletions app/views/admin/styles/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
%th= t('admin.courses.name')
%th= t('admin.courses.number_lessons')
%th= t('admin.courses.number_courses')
-#%th= t('admin.courses.number_appointments')
-#%th= t('admin.courses.next_appointment')
%th

%tbody
Expand Down Expand Up @@ -55,6 +53,7 @@
%i.fas.fa-eye-slash
%td
- if style.image.attached?
-# darken out if inactive?
= image_tag style.image.variant(resize_to_fill: [180,120]).processed,
class: (style.active?) ? '' : 'semi-transparent'
- else
Expand All @@ -67,10 +66,6 @@
= style.lessons.length
%td
= style.courses.active.length
-#%td
-# = style.appointments.length
-#%td
-# = style.appointments.future.first&.date_from
%td
.buttons
= link_to t('actions.show'), style, class: 'button is-small'
Expand Down
86 changes: 2 additions & 84 deletions app/views/courses/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -40,90 +40,8 @@
= @course.description
%br

-if @course.appointments.future.empty?
- else
.box.flame-box
%h3.title.is-4
= t('courses.appointments.upcoming')
= render partial: 'pages/appointments', locals: { appointments: @course.appointments.future }

%h2.title.is-4
= t('courses.videos')

- if @course.lessons.active.empty?
.box
=t('courses.no_lessons_yet')
- first = @course.lessons.active.rank(:row_order).first
- last = @course.lessons.active.rank(:row_order).last
- access_level = AccessState.new(current_user).level
- @course.lessons.active.rank(:row_order).each_with_index do |lesson, idx|
.box
- if lesson.preview_image.attached? && lesson.video.attached?
%article.media
%figure.media-left
- if access_level == :admin || access_level == :full || (access_level == :trial && idx < 3)
%video(controls="true" poster="#{url_for lesson.preview_image.variant(resize_to_fill: [354, 200])}" preload="metadata" id="vs-#{lesson.id}" width="354")
%source{src: rails_blob_url(lesson.video), type:"video/mp4"}
= t('no-video-support')
- elsif user_signed_in? || access_level == :trial
.image
= image_tag lesson.preview_image.variant(resize_to_fill: [354,200]).processed,
alt: t('video.image_alt', video: t('lesson.show.video'), video_title: lesson.name)
= link_to explanation_path, class: 'is-overlay has-text-centered is-vcentered columns is-flex' do
%span.icon.has-text-primary.is-large.has-text-centered.auto-margin
%i.far.fa-play-circle.fa-3x
- else
.image
= image_tag lesson.preview_image.variant(resize_to_fill: [354,200]).processed,
alt: t('video.image_alt', video: t('lesson.show.video'), video_title: lesson.name)
= link_to new_user_registration_path, class: 'is-overlay has-text-centered is-vcentered columns is-flex' do
%span.icon.has-text-primary.is-large.has-text-centered.auto-margin
%i.far.fa-play-circle.fa-3x
.media-content.is-hidden-mobile
.content
.level
.level-left
.level-item
%h3.is-title.is-7.has-text-primary
= lesson.name
- if user_admin?
.level-right
.level-item
.buttons
- if lesson != first
= link_to admin_course_lesson_position_path(lesson.course, lesson_id: lesson.id), method: :post, class: 'button is-primary is-outlined is-small' do
%span.icon.is-small.has-text-primary
%i.fas.fa-arrow-up
- if lesson != last
= link_to admin_course_lesson_position_path(lesson.course, lesson_id: lesson.id), method: :delete, class: 'button is-primary is-outlined is-small' do
%span.icon.is-small.has-text-primary
%i.fas.fa-arrow-down
= link_to edit_admin_course_lesson_path(lesson.course, lesson), class: 'button is-link is-outlined is-small' do
%span.icon.is-small
%i.fas.fa-user-shield
%span
= t('course.admin.edit-lesson')
= link_to [:admin, lesson.course, lesson], method: :delete, data: { confirm: 'Are you sure?' }, class: 'button is-link is-outlined is-small' do
%span.icon.is-small
%i.fas.fa-user-shield
%span
= t('course.admin.destroy-lesson')
= l lesson.created_at, format: '%A, %d. %B %Y'
- if lesson.video.attached? && lesson.video.metadata[:duration]
%br/
= "%s:" % t('video.length')
= (lesson.video.metadata[:duration] / 60).round
= t('video.minutes')
.is-hidden-tablet
%h3.is-title.is-7.has-text-primary
= lesson.name
= l lesson.created_at, format: '%A, %d. %B %Y'
- if lesson.video.attached? && lesson.video.metadata[:duration]
%br/
= "%s:" % t('video.length')
= (lesson.video.metadata[:duration] / 60).round
= t('video.minutes')

.content
!= SiteSetting['courses_general']

- if user_admin?
%h2.title.is-4
Expand Down
Loading

0 comments on commit ef0fab0

Please sign in to comment.