study_engine 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +42 -0
  3. data/app/assets/images/study_engine/spinner.gif +0 -0
  4. data/app/assets/images/study_engine/sprite/delete.png +0 -0
  5. data/app/assets/images/study_engine/sprite/download.png +0 -0
  6. data/app/assets/images/study_engine/sprite/edit.png +0 -0
  7. data/app/assets/images/study_engine/sprite/incomplete.png +0 -0
  8. data/app/assets/images/study_engine/sprite/metrc-sm.png +0 -0
  9. data/app/assets/images/study_engine/sprite/metrc.png +0 -0
  10. data/app/assets/images/study_engine/sprite/new.png +0 -0
  11. data/app/assets/javascripts/study_engine/admin_notes.js.coffee +12 -0
  12. data/app/assets/javascripts/study_engine/assessment_notifications.js.coffee +36 -0
  13. data/app/assets/javascripts/study_engine/assessment_timeout.js.coffee +24 -0
  14. data/app/assets/javascripts/study_engine/disable_buttons_after_click.js.coffee +6 -0
  15. data/app/assets/javascripts/study_engine/fire_click_event_immediately_on_mobile.js.coffee.erb +10 -0
  16. data/app/assets/javascripts/study_engine/response_validation.js.coffee +8 -0
  17. data/app/assets/javascripts/study_engine/restart_assessment_button.js.coffee +3 -0
  18. data/app/assets/javascripts/study_engine/study_engine.js.coffee +9 -0
  19. data/app/assets/javascripts/study_engine/study_id_picker.js.coffee +28 -0
  20. data/app/assets/stylesheets/study_engine.sass +1 -0
  21. data/app/assets/stylesheets/study_engine/_constant.sass +52 -0
  22. data/app/assets/stylesheets/study_engine/_mobile.sass +8 -0
  23. data/app/assets/stylesheets/study_engine/_tablet.sass +36 -0
  24. data/app/assets/stylesheets/study_engine/application.sass +101 -0
  25. data/app/assets/stylesheets/study_engine/base/_form.sass +131 -0
  26. data/app/assets/stylesheets/study_engine/base/_list.sass +38 -0
  27. data/app/assets/stylesheets/study_engine/base/_tables.sass +33 -0
  28. data/app/assets/stylesheets/study_engine/base/_text.sass +78 -0
  29. data/app/assets/stylesheets/study_engine/components/-fields/_login-fields.sass +14 -0
  30. data/app/assets/stylesheets/study_engine/components/-fields/_start-fields.sass +101 -0
  31. data/app/assets/stylesheets/study_engine/components/-nav/_global-nav.sass +19 -0
  32. data/app/assets/stylesheets/study_engine/components/-table/_results-table.sass +75 -0
  33. data/app/assets/stylesheets/study_engine/components/-table/_users-table.sass +11 -0
  34. data/app/assets/stylesheets/study_engine/components/_assessment-questions.sass +30 -0
  35. data/app/assets/stylesheets/study_engine/components/_form-buttons.sass +102 -0
  36. data/app/assets/stylesheets/study_engine/components/_helpt-text.sass +2 -0
  37. data/app/assets/stylesheets/study_engine/components/_method-icons.sass +15 -0
  38. data/app/assets/stylesheets/study_engine/components/_notes-modal.sass +65 -0
  39. data/app/assets/stylesheets/study_engine/components/_progress-bar.sass +25 -0
  40. data/app/assets/stylesheets/study_engine/components/_sortable-columns.sass +26 -0
  41. data/app/assets/stylesheets/study_engine/components/_table-actions.sass +8 -0
  42. data/app/assets/stylesheets/study_engine/components/_table-buttons.sass +17 -0
  43. data/app/assets/stylesheets/study_engine/components/_user-privileges.sass +3 -0
  44. data/app/assets/stylesheets/study_engine/mixins/_actions-table.sass +11 -0
  45. data/app/assets/stylesheets/study_engine/mixins/_buttons.sass +55 -0
  46. data/app/assets/stylesheets/study_engine/mixins/_checkbox-columns.sass +50 -0
  47. data/app/assets/stylesheets/study_engine/mixins/_custom-radios.sass +47 -0
  48. data/app/assets/stylesheets/study_engine/mixins/_icons.sass +38 -0
  49. data/app/assets/stylesheets/study_engine/mixins/_notification-text.sass +23 -0
  50. data/app/controllers/study_engine/admin/application_controller.rb +6 -0
  51. data/app/controllers/study_engine/admin/assessments_controller.rb +79 -0
  52. data/app/controllers/study_engine/admin/notes_controller.rb +17 -0
  53. data/app/controllers/study_engine/application_controller.rb +12 -0
  54. data/app/controllers/study_engine/assessments_controller.rb +94 -0
  55. data/app/helpers/study_engine/helpers.rb +15 -0
  56. data/app/helpers/study_engine/mailer_helpers.rb +11 -0
  57. data/app/mailers/study_engine/mailer.rb +25 -0
  58. data/app/models/study_engine/answer.rb +36 -0
  59. data/app/models/study_engine/assessment.rb +118 -0
  60. data/app/models/study_engine/begin_assessment_form.rb +110 -0
  61. data/app/models/study_engine/existing_assessments_form.rb +99 -0
  62. data/app/models/study_engine/form.rb +59 -0
  63. data/app/models/study_engine/report.rb +69 -0
  64. data/app/models/study_engine/result.rb +46 -0
  65. data/app/models/study_engine/screen_results.rb +54 -0
  66. data/app/models/study_engine/study_id.rb +47 -0
  67. data/app/models/study_engine/study_id/bank.rb +38 -0
  68. data/app/models/study_engine/study_id/sync.rb +52 -0
  69. data/app/models/study_engine/update_assessments_form.rb +53 -0
  70. data/app/views/study_engine/_progress_bar.html.slim +4 -0
  71. data/app/views/study_engine/admin/assessments/_assessment.html.slim +36 -0
  72. data/app/views/study_engine/admin/assessments/domain_results.csv.csvbuilder +17 -0
  73. data/app/views/study_engine/admin/assessments/edit.html.slim +68 -0
  74. data/app/views/study_engine/admin/assessments/index.html.slim +26 -0
  75. data/app/views/study_engine/admin/assessments/item_results.csv.csvbuilder +24 -0
  76. data/app/views/study_engine/admin/assessments/new.html.slim +46 -0
  77. data/app/views/study_engine/admin/assessments/screen_results.csv.csvbuilder +2 -0
  78. data/app/views/study_engine/assessments/complete.html.slim +25 -0
  79. data/app/views/study_engine/assessments/create.html.slim +46 -0
  80. data/app/views/study_engine/assessments/index.html.slim +43 -0
  81. data/app/views/study_engine/assessments/restart.html.slim +28 -0
  82. data/app/views/study_engine/assessments/show.html.slim +60 -0
  83. data/app/views/study_engine/mailer/assessment_recorded_notification.erb +8 -0
  84. data/app/views/study_engine/mailer/assessment_url_notification.erb +6 -0
  85. data/config/routes.rb +15 -0
  86. data/db/migrate/20160422185859_create_tables.rb +52 -0
  87. data/lib/study_engine.rb +5 -0
  88. data/lib/study_engine/config.rb +37 -0
  89. data/lib/study_engine/cucumber.rb +96 -0
  90. data/lib/study_engine/engine.rb +7 -0
  91. data/lib/study_engine/version.rb +3 -0
  92. data/lib/tasks/study_engine_tasks.rake +10 -0
  93. data/spec/ar_helper.rb +30 -0
  94. data/spec/models/study_engine/answer_spec.rb +28 -0
  95. data/spec/models/study_engine/assessment_spec.rb +250 -0
  96. data/spec/models/study_engine/begin_assessment_form_spec.rb +87 -0
  97. data/spec/models/study_engine/existing_assessments_form_spec.rb +171 -0
  98. data/spec/models/study_engine/report_spec.rb +48 -0
  99. data/spec/models/study_engine/result_spec.rb +102 -0
  100. data/spec/models/study_engine/screen_results_spec.rb +69 -0
  101. data/spec/models/study_engine/study_id/bank_spec.rb +72 -0
  102. data/spec/models/study_engine/study_id/sync_spec.rb +61 -0
  103. data/spec/models/study_engine/study_id_spec.rb +7 -0
  104. data/spec/models/study_engine/update_assessments_form_spec.rb +38 -0
  105. data/spec/rails_helper.rb +50 -0
  106. data/spec/schema.rb +65 -0
  107. data/spec/spec_helper.rb +72 -0
  108. data/spec/support/CATEngine3.exe +0 -0
  109. data/spec/support/forms/01. Physical Function Bank.xml +1213 -0
  110. data/spec/support/forms/02. Pain Interference Bank.xml +443 -0
  111. data/spec/support/forms/03. Anxiety Bank.xml +322 -0
  112. data/spec/support/forms/04. Depression Bank.xml +311 -0
  113. data/spec/support/forms/05. Ability to Participate Social bank Version 2.xml +353 -0
  114. data/spec/support/forms/06. Psychosocial Illness Impact Pos Bank.xml +900 -0
  115. data/spec/support/forms/07. Applied Cognition Gen Concerns Bank.xml +377 -0
  116. data/spec/support/forms/08. Satisfaction with Roles and Activities Bank Version 2.xml +443 -0
  117. data/spec/support/forms/09. Sleep Disturbance Bank.xml +300 -0
  118. data/spec/support/forms/10. Emotional Support Bank.xml +163 -0
  119. data/spec/support/forms/A - 07. Psychosocial Illness Impact Pos Bank.xml +471 -0
  120. data/spec/support/forms/A - 08. Pain interference Bank.xml +443 -0
  121. data/spec/support/forms/A - 09. Depression Bank.xml +311 -0
  122. data/spec/support/forms/B - 07. Physical Function Short Form.xml +123 -0
  123. data/spec/support/forms/B - 08. Physical Function Remainder A.xml +543 -0
  124. data/spec/support/forms/B - 09. Ability to Participate Social bank Version 2.xml +353 -0
  125. data/spec/support/forms/C - 07. Physical Function Short Form.xml +123 -0
  126. data/spec/support/forms/C - 08. Physical Function Remainder B.xml +553 -0
  127. data/spec/support/forms/C - 09. Anxiety Bank.xml +322 -0
  128. data/spec/support/parameters/01. Physical Function Bank.xml +682 -0
  129. data/spec/support/parameters/02. Pain Interference Bank.xml +256 -0
  130. data/spec/support/parameters/03. Anxiety Bank.xml +190 -0
  131. data/spec/support/parameters/04. Depression Bank.xml +184 -0
  132. data/spec/support/parameters/05. Ability to Participate Social bank Version 2.xml +226 -0
  133. data/spec/support/parameters/06. Psychosocial Illness Impact Pos Bank.xml +211 -0
  134. data/spec/support/parameters/07. Applied Cognition Gen Concerns Bank.xml +1 -0
  135. data/spec/support/parameters/08. Satisfaction with Roles and Activities Bank Version 2.xml +1 -0
  136. data/spec/support/parameters/09. Sleep Disturbance Bank.xml +1 -0
  137. data/spec/support/parameters/10. Emotional Support Bank.xml +1 -0
  138. metadata +394 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a814703c6b22e5256caaa924bb26f41939597c88
4
+ data.tar.gz: b1cf95a28f953d46934393a4749c15b514154d92
5
+ SHA512:
6
+ metadata.gz: ba765d737471789999ec261765a3a664e2d9e5326c5b57a8cddebff355348e7cb70d70d0b6bbaec9736d35bf9dd28eac87edeee5885faf84400fa4f22ba920a1
7
+ data.tar.gz: 8c13ccf968abdaea10ff61bee6c66c0e546ad82b49c94faa1db6cf67ddfe1ec482f08e0fb75de51e841ae911364429eedada33b62faa6b917260e4031cdba88a
data/Rakefile ADDED
@@ -0,0 +1,42 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'StudyEngine'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ # APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ # load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ Bundler::GemHelper.install_tasks
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'lib'
31
+ t.libs << 'test'
32
+ t.pattern = 'test/**/*_test.rb'
33
+ t.verbose = false
34
+ end
35
+
36
+
37
+ task default: :test
38
+
39
+ task :compile_cat_engine do
40
+ require "./app/models/study_engine/cat_engine"
41
+ StudyEngine::CatEngine.compile
42
+ end
@@ -0,0 +1,12 @@
1
+ $ ->
2
+ $(".note-wrapper form").submit (event) ->
3
+ event.preventDefault()
4
+
5
+ $note = $(this).find(".note")
6
+ $(this).find(".toggle-note").prop "checked", false
7
+ $note.addClass "-saving"
8
+
9
+ $.post this.action, $(this).serialize(), (data) =>
10
+ $note.removeClass "-saving"
11
+ $note.toggleClass "-saved", data == "true"
12
+
@@ -0,0 +1,36 @@
1
+ #= require jquery.pjax
2
+
3
+ class AssessmentNotification
4
+ constructor: ->
5
+ @enable()
6
+
7
+ enable: ->
8
+ $(document).on "submit", "form[data-pjax]", (event) ->
9
+ $.pjax.submit event, "[data-pjax-container]"
10
+
11
+ $(window).on "beforeunload", =>
12
+ @sendNotification()
13
+
14
+ $(window).on "unload", =>
15
+ @sendNotification()
16
+
17
+ $(document).on "pjax:popstate", (event) ->
18
+ event.preventDefault() if event.direction == "back"
19
+
20
+ disable: ->
21
+ $(document).off "submit", "form[data-pjax]"
22
+
23
+ $(window).off("beforeunload").off("unload")
24
+
25
+ sendNotification: ->
26
+ unless @_sentNotification
27
+ $.ajax window.location.href + "/notification", method: "POST", async: false
28
+ @_sentNotification = true
29
+ `void(0)`
30
+
31
+ _sentNotification: false
32
+
33
+ $ ->
34
+ if $("form[data-pjax]").length and $.support.pjax
35
+ window.assessmentNotification = new AssessmentNotification()
36
+
@@ -0,0 +1,24 @@
1
+ #= require jquery.pjax
2
+
3
+ class AssessmentTimer
4
+ constructor: (@timeoutInterval, @timeout) ->
5
+ @start()
6
+
7
+ start: ->
8
+ @timeoutId = window.setTimeout =>
9
+ @timeout()
10
+ , @timeoutInterval * 1000
11
+
12
+ restart: ->
13
+ window.clearTimeout @timeoutId
14
+ @start()
15
+
16
+ $ ->
17
+ if $("[data-timeout]").length and $.support.pjax
18
+ timeoutInterval = parseInt($("[data-timeout]").attr("data-timeout"))
19
+ window.assessmentTimer = new AssessmentTimer timeoutInterval, ->
20
+ window.location.href += "/timeout"
21
+
22
+ $(document).on "pjax:send", ->
23
+ window.assessmentTimer.restart()
24
+
@@ -0,0 +1,6 @@
1
+ $ ->
2
+ buttonsSelector = "[data-disable-on-click]"
3
+ $(document).on "click", buttonsSelector, (event) ->
4
+ $(buttonsSelector).attr disabled: true
5
+ $(this.form).submit()
6
+
@@ -0,0 +1,10 @@
1
+ #= require fastclick
2
+
3
+ $ -> setupFastClick()
4
+ $(document).on "pjax:end", -> setupFastClick()
5
+
6
+ setupFastClick = ->
7
+ return if <%= Rails.env.test? %>
8
+ $("label > *").css("pointer-events", "none") unless FastClick.notNeeded(document.body)
9
+ FastClick.attach document.body
10
+
@@ -0,0 +1,8 @@
1
+ $ ->
2
+ $(document).on "change", "#questions :radio", ->
3
+ questionCount = $("fieldset").length
4
+ answeredQuestionCount = $("fieldset").has(":radio:checked").length
5
+ if questionCount == answeredQuestionCount
6
+ $("#questions .skip").hide()
7
+ $("#questions .submit").css display: "inline-block"
8
+
@@ -0,0 +1,3 @@
1
+ $("[data-restart]").click ->
2
+ $(this).prepend "<input type='hidden' name='assessment[restart]' value='1' />"
3
+
@@ -0,0 +1,9 @@
1
+ #= require study_engine/response_validation
2
+ #= require study_engine/restart_assessment_button
3
+ #= require study_engine/disable_buttons_after_click
4
+ #= require study_engine/fire_click_event_immediately_on_mobile
5
+ #= require study_engine/assessment_notifications
6
+ #= require study_engine/assessment_timeout
7
+ #= require study_engine/study_id_picker
8
+ #= require study_engine/admin_notes
9
+
@@ -0,0 +1,28 @@
1
+ $ ->
2
+ $("[data-study-id-picker]").studyIDPicker()
3
+
4
+ $.fn.studyIDPicker = ->
5
+ $(this).each ->
6
+ new StudyIDPicker $(this), JSON.parse($(this).attr("data-study-id-picker"))
7
+
8
+ class StudyIDPicker
9
+ constructor: (@$el, @studyIDMap) ->
10
+ @$studies = @$el.find("select").eq(0)
11
+ @$sites = @$el.find("select").eq(1)
12
+ @$ids = @$el.find("select").eq(2)
13
+
14
+ @$studies.change => @change()
15
+ @$sites.change => @change()
16
+
17
+ change: ->
18
+ key = "" + @$studies.val() + @$sites.val()
19
+ ids = @idsForKey(key)
20
+ @$ids.html @optionsFromIds(ids)
21
+
22
+ idsForKey: (key) ->
23
+ @studyIDMap[key] || []
24
+
25
+ optionsFromIds: (ids) ->
26
+ options = ids.map (id) -> "<option value='#{id}'>#{id}</option>"
27
+ "<option>----</option>" + options.join("\n")
28
+
@@ -0,0 +1 @@
1
+ @import "study_engine/*"
@@ -0,0 +1,52 @@
1
+ // Fonts
2
+
3
+ @import font-awesome-sprockets
4
+ @import font-awesome
5
+
6
+ // Variables
7
+
8
+ $primaryColor: #1492d6
9
+ $secondaryColor: $primaryColor - #333
10
+ $tertiaryColor: #E2770F
11
+
12
+ $green: #398927
13
+ $red: #a7001f
14
+ $yellow: #e5c105
15
+
16
+ $default: "Helvetica Neue", Helvetica, Arial, sans-serif
17
+ $font: $default
18
+
19
+ // Spriting
20
+
21
+ @import "study_engine/sprite/*.png"
22
+ @include all-sprite-sprites
23
+
24
+ // Global Mixins
25
+
26
+ @mixin constant-width( $width )
27
+ width: $width
28
+ min-width: $width
29
+ max-width: $width
30
+
31
+ @mixin constant-height( $height )
32
+ height: $height
33
+ min-height: $height
34
+ max-height: $height
35
+
36
+ @mixin variable-height( $h1: 300px, $h2: 800px)
37
+ height: $h1
38
+ min-height: $h1
39
+ max-height: $h2
40
+
41
+ // Imports
42
+
43
+ @import "mixins/*"
44
+ @import "base/*"
45
+
46
+ @import "components/*"
47
+ //@import "components/-chart/*"
48
+ @import "components/-fields/*"
49
+ //@import "components/-form/*"
50
+ @import "components/-nav/*"
51
+ @import "components/-table/*"
52
+
@@ -0,0 +1,8 @@
1
+ .study-id
2
+ .study, .site, .id
3
+ font-size: 5.0em
4
+ .field
5
+ &:after
6
+ font-size: 2.5em
7
+ .method
8
+ font-size: 0.9em
@@ -0,0 +1,36 @@
1
+ .wrapper
2
+ width: 100%
3
+ header
4
+ height: 40px
5
+ line-height: 40px
6
+
7
+ .metrc-logo
8
+ width: 43px
9
+ height: 40px
10
+ background: transparent image-url("study_engine/sprite/metrc-sm.png")
11
+ .title-wrapper
12
+ padding-top: 5px
13
+ .title
14
+ font-size: 2.6em
15
+ margin-top: 2px
16
+ .tagline
17
+ display: none
18
+
19
+ .nav
20
+ a
21
+ line-height: 40px
22
+ section
23
+ padding: 20px 60px
24
+ fieldset
25
+ padding: 0px 20px
26
+ hr
27
+ margin: 15px 0
28
+
29
+ .paired-bank
30
+ .custom-label
31
+ min-width: 100%
32
+
33
+ .resume, .restart
34
+ font-size: 1.4em
35
+ & + .start
36
+ font-size: 1.4em
@@ -0,0 +1,101 @@
1
+ @charset "UTF-8"
2
+ @import "constant"
3
+
4
+ //
5
+
6
+ *
7
+ box-sizing: border-box
8
+ position: relative
9
+ margin: 0
10
+ padding: 0
11
+
12
+ html
13
+ height: 100%
14
+
15
+ body
16
+ background: #f4f4f4
17
+ position: relative
18
+ min-height: 100%
19
+
20
+ .wrapper
21
+ width: 1280px
22
+ margin: auto
23
+
24
+ header
25
+ background: #2a3036
26
+ background: linear-gradient( #2a3036, #1a1a1a )
27
+ box-shadow: #e1e1e3 0 0 3px 0
28
+ position: relative
29
+ height: 80px
30
+ line-height: 80px
31
+
32
+ .title-wrapper
33
+ float: left
34
+ padding: 20px 0 0 0
35
+ .metrc-logo
36
+ float: left
37
+ @extend .sprite-metrc
38
+ width: 83px
39
+ height: 80px
40
+ margin: 0 3px 0 55px
41
+ .title, .tagline
42
+ float: left
43
+ margin: 0
44
+ line-height: 1.0em
45
+ .title
46
+ color: #fcfcfc
47
+ .tagline
48
+ color: #ccc
49
+ clear: both
50
+ font-size: 1.4em
51
+
52
+ section
53
+ padding: 40px 60px
54
+ background: #fff
55
+ box-shadow: #e1e1e3 0 0 3px 0
56
+ border-bottom-radius: 3px
57
+ min-height: 440px
58
+ position: relative
59
+
60
+ // REMOVE FROM THIS STYLESHEET
61
+
62
+ .notification
63
+ position: absolute
64
+ top: 0
65
+ left: 0
66
+ right: 0
67
+ background: $primaryColor
68
+ background-image: linear-gradient( darken( $primaryColor, 6% ), $primaryColor )
69
+ color: #fff
70
+ font: bold 1.2em $default
71
+ line-height: 1.8em
72
+ width: 100%
73
+ text-align: center
74
+ z-index: 2
75
+ padding: 0 20px
76
+ &.alert
77
+ background: #D80707
78
+ background-image: linear-gradient( darken( #D80707, 6% ), #D80707 )
79
+
80
+ #questions
81
+ .submit
82
+ display: none
83
+
84
+ //
85
+
86
+ footer
87
+ padding: 25px 30px 0
88
+ p
89
+ text-align: right
90
+ font-size: 1.2em
91
+ color: #a7a9aa
92
+
93
+ //
94
+
95
+ @media screen and (max-device-width: 1024px), (max-width: 1024px)
96
+ @import "tablet"
97
+
98
+ @media screen and (max-device-width: 800px), (max-width: 800px)
99
+ @import "mobile"
100
+
101
+
@@ -0,0 +1,131 @@
1
+ // PLACEHOLDERS
2
+
3
+ %inline-label
4
+ display: inline-block
5
+ color: #404040
6
+ font: 200 1.0rem $default
7
+ vertical-align: top
8
+ font-size: 2.1em
9
+
10
+ .inline-label
11
+ @extend %inline-label
12
+
13
+ // GENERIC FORM CLASSES
14
+
15
+ .hidden
16
+ display: none
17
+ .not-visible
18
+ visibility: hidden
19
+
20
+ //
21
+
22
+ fieldset
23
+ border: none
24
+
25
+ legend
26
+ font: 700 1.4em $default
27
+ text-transform: uppercase
28
+ color: $primaryColor
29
+ margin-left: -20px
30
+
31
+ .field
32
+ width: 100%
33
+ float: left
34
+ clear: both
35
+ margin: 3px 0 30px
36
+ padding: 0 20px 0 0
37
+
38
+ %generic-input
39
+ width: 100%
40
+ line-height: 2.5em
41
+ font-size: 1.6em
42
+ padding: 0 0 0 10px
43
+ border-radius: 2px
44
+ background: #f9f9f9
45
+ box-shadow: darken( #f9f9f9, 10% ) 0 1px 6px 0 inset
46
+ border: 1px solid darken( #f9f9f9, 15% )
47
+
48
+ &:focus
49
+ outline-color: $primaryColor
50
+ &::-webkit-input-placeholder
51
+ color: transparent
52
+ &:-moz-placeholder
53
+ color: transparent
54
+ &::-moz-placeholder
55
+ color: transparent
56
+ &:-ms-input-placeholder
57
+ color: transparent
58
+
59
+ // BASIC FORM STYLING
60
+
61
+ label
62
+ color: #444
63
+ display: block
64
+ font: 700 1.6em $default
65
+ & + span, & + p
66
+ display: inline-block
67
+ margin: 0 0 0 6px
68
+ font-size: 1.4em
69
+ line-height: 1.2em
70
+ em
71
+ color: #666
72
+
73
+ input, select
74
+ font: 400 1.3em $default
75
+ & + label
76
+ @extend %inline-label
77
+ &.text, &.number, &.email, &.phone, &.date, &.password
78
+ @extend %generic-input
79
+ .checkbox, .radio
80
+ & + label, & + span
81
+ font-weight: 200
82
+ margin-right: 15px
83
+ margin-left: 10px
84
+ .file
85
+ display: inline-block
86
+ max-width: 50%
87
+ padding: 8px 0 0
88
+ font-size: 1.4em
89
+ vertical-align: top
90
+ .color
91
+ background: #2f2f2f
92
+ border: none
93
+ cursor: pointer
94
+
95
+ select
96
+ width: 100%
97
+ margin: 8px 0 0
98
+
99
+ textarea
100
+ font: 200 1.4em $default
101
+ line-height: 1.6em
102
+ padding: 6px
103
+ +constant-width( 100% )
104
+ +variable-height( 160px, 260px)
105
+ border: 1px solid darken( #f9f9f9, 15% )
106
+ border-radius: 2px
107
+ &:focus
108
+ outline-color: $primaryColor
109
+ &::-webkit-input-placeholder
110
+ color: transparent
111
+ &:-moz-placeholder
112
+ color: transparent
113
+ &::-moz-placeholder
114
+ color: transparent
115
+ &:-ms-input-placeholder
116
+ color: transparent
117
+
118
+ // Errors
119
+
120
+ .field_with_errors
121
+ display: inline
122
+ label
123
+ font-weight: 300
124
+ input
125
+ border-color: $yellow
126
+ box-shadow: $yellow 0 0 4px 0
127
+ background: lighten($yellow, 50%)
128
+ & + label
129
+ @extend %inline-label
130
+ margin: 0 15px 0 0
131
+