-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from OneBusAway/survey
WIP - Survey Features
- Loading branch information
Showing
87 changed files
with
1,207 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class Containers::EmptyStateComponent < ViewComponent::Base | ||
def initialize(title:, description:) | ||
def initialize(title:, description:, icon: nil) | ||
super() | ||
@title = title | ||
@description = description | ||
@icon = icon | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="text-right space-x-2"> | ||
<%= link_to "Cancel", :back, class: "oba-btn" %> | ||
<%= @form.submit class: 'oba-btn--primary' %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
class Forms::ButtonBarComponent < ViewComponent::Base | ||
def initialize(form) | ||
super() | ||
@form = form | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="bg-red-50 border border-red-200 rounded-md p-2"> | ||
<h3 class="h3">Errors</h3> | ||
<ul class="list-disc list-inside pl-4"> | ||
<% @errors.each do |error| %> | ||
<li><%= error %></li> | ||
<% end %> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
class Forms::ErrorsComponent < ViewComponent::Base | ||
def initialize(errors:) | ||
super() | ||
@errors = errors | ||
end | ||
|
||
def render? | ||
@errors.any? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<%= link_to @link, class: 'link text-sm font-medium' do %> | ||
<div class="flex"> | ||
<div class="flex-none self-center"> | ||
<svg xmlns="http://www.w3.org/2000/svg" class="w-4" viewBox="0 0 24 24"> | ||
<path d="M20 11H7.41l5.3-5.29a1 1 0 0 0-1.42-1.42l-7 7a1 1 0 0 0 0 1.42l7 7a1 1 0 0 0 1.42-1.42L7.41 13H20a1 1 0 0 0 0-2z"/> | ||
</svg> | ||
</div> | ||
<div> | ||
<%= @title %> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class Navigation::BackLinkComponent < ViewComponent::Base | ||
def initialize(title:, link:) | ||
super() | ||
@title = title | ||
@link = link | ||
end | ||
end |
33 changes: 33 additions & 0 deletions
33
app/components/questions/options_builder_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<div data-controller="options-builder"> | ||
<div class="flex gap-x-2 mt-4 mb-2"> | ||
<h3 class="h3">Options:</h3> | ||
|
||
<div class="flex-1"> | ||
<button | ||
type="button" | ||
class="oba-btn--sm oba-btn--primary" | ||
data-action="click->options-builder#addField"> | ||
Add Option | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<div | ||
class="p-2 border bg-slate-50 space-y-4" | ||
data-options-builder-target="fields"> | ||
</div> | ||
|
||
<template data-options-builder-target="template"> | ||
<div class="flex gap-x-2"> | ||
<label class="block text-sm font-medium leading-6 text-gray-900 self-center">Option:</label> | ||
<div class="flex-1"> | ||
<%= text_field_tag( | ||
"question[content_attributes][options][]", | ||
"", | ||
id: nil, | ||
class: "block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-brand sm:text-sm sm:leading-6" | ||
) %> | ||
</div> | ||
</div> | ||
</template> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class Questions::OptionsBuilderComponent < ViewComponent::Base | ||
end |
Oops, something went wrong.