diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 8c523df..0045e6f 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -15,9 +15,12 @@ */ @import "bulma/sass/utilities/initial-variables"; @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Lobster&family=Comfortaa:wght@400;500;600;700&display=swap'); +@import url('https://use.fontawesome.com/releases/v5.12.0/css/all.css'); -$family-sans-serif: 'Roboto', sans-serif; -$family-secondary: 'Comfortaa', cursive; +$family-sans-serif: 'Roboto', +sans-serif; +$family-secondary: 'Comfortaa', +cursive; // // https://coolors.co/06aed5-086788-f0c808-fff1d0-dd1c1a // $blue: #083d77; // $red: #dd1c1a; @@ -33,6 +36,7 @@ $primary: $blue; $text: $grey-dark; $body-background-color: #FAFCFE; +$light: #fff; @import 'bulma/bulma'; @@ -40,6 +44,10 @@ $body-background-color: #FAFCFE; font-family: 'Lobster', cursive; } +.card { + height: 100%; +} + body { min-height: 100vh; } \ No newline at end of file diff --git a/app/models/form.rb b/app/models/form.rb index c70d3bd..a1a13ca 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -11,6 +11,15 @@ class Form < ApplicationRecord validates_presence_of :title + # TODO: use counter_cache option on association + def submissions_count + submissions.count + end + + def last_submission_date + submissions.order(created_at: :desc).first&.created_at + end + def deactivate!(reason = nil) self.user.deactivate!(reason) end diff --git a/app/views/forms/index.html.erb b/app/views/forms/index.html.erb index d3877e7..261e4f7 100644 --- a/app/views/forms/index.html.erb +++ b/app/views/forms/index.html.erb @@ -1,5 +1,61 @@ -<%= link_to "new form", new_form_url %> -
<%= link_to form.title, form_url(form) %>
+ +