forked from fran-worley/gemgem-sinatra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing HAML template trailblazer/formular#63 (comment)
- Loading branch information
Showing
10 changed files
with
175 additions
and
175 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
.row | ||
.col-12.offset-sm-3 | ||
%h1.display-3.text-xs-center New Post! | ||
|
||
= vertical_form(model.contract, url) do |f| | ||
- capture_haml do | ||
.row | ||
.col-6 | ||
= f.input_group :title, label: "Title" do |input| | ||
- capture_haml do | ||
=input.group_addon('<input type="checkbox" value="1"/>') | ||
=input.control | ||
.col-6 | ||
= f.input :url_slug, label: "URL Slug" | ||
|
||
= f.input_group :url_slug, label: "URL", left_addon: 'http://', right_addon: '.com' | ||
|
||
= f.select :select_roles, label: "Roles", collection: roles_array | ||
|
||
= f.inline_radio :select_roles, label: "Inline radios", collection: [[1, "Yes"], [2, "No"], [3, "I really don't know"]] | ||
|
||
= f.inline_checkbox :select_roles, label: "Inline checkboxes", collection: options_array | ||
|
||
= f.input :content, type: 'file', label: "File" | ||
|
||
|
||
%hr | ||
%h4 Checkboxes in columns! | ||
.row | ||
.col-sm-4 | ||
= f.checkbox :select_roles, label: "Column 1", collection: options_array | ||
.col-sm-4 | ||
= f.checkbox :select_roles, label: "Column 2", collection: options_array | ||
.col-sm-4 | ||
= f.checkbox :select_roles, label: "Column 3", collection: options_array | ||
%hr | ||
|
||
= f.textarea :content, placeholder: "And your story...", rows: 9 | ||
|
||
= f.checkbox :is_public, label: "Public?", value: "1" | ||
|
||
%hr | ||
%h4 Custom Controls | ||
|
||
= f.custom_file :content, label: 'Custom File' | ||
|
||
= f.custom_select :select_roles, label: "Custom Select", collection: roles_array | ||
|
||
= f.custom_radio :select_roles, label: "Custom Inline radios", collection: options_array | ||
|
||
= f.custom_checkbox :select_roles, label: "Custom Inline checkbox", collection: options_array | ||
|
||
= f.custom_stacked_radio :select_roles, label: "Custom Stacked radios", collection: options_array | ||
|
||
= f.custom_stacked_checkbox :select_roles, label: "Custom Stacked checkbox", collection: options_array | ||
|
||
= f.submit content: "Submit!", class: ['btn-lg'] | ||
|
||
%hr | ||
.row | ||
.col-12.offset-sm-3 | ||
%h1.display-3.text-xs-center Inline Form | ||
|
||
= inline_form(model.contract, url) do |f| | ||
- capture_haml do | ||
= f.input :title | ||
= f.input :url_slug, label: 'url slug', placeholder: "URL slug", label_options: { class: ["sr-only"] } | ||
= f.submit(content: "Submit!") | ||
|
||
%hr | ||
|
||
= inline_form(model.contract, url) do |f| | ||
- capture_haml do | ||
= f.custom_file :content, label: 'Attachment' | ||
= f.submit(content: "Submit!") | ||
|
||
|
||
%hr | ||
.row | ||
.col-12.offset-sm-3 | ||
%h1.display-3.text-xs-center Horizontal Form | ||
|
||
= horizontal_form(model.contract, url) do |f| | ||
- capture_haml do | ||
= f.input_group :title, label: "Title" do |input| | ||
- capture_haml do | ||
= input.control | ||
= input.group_btn("<a class='btn btn-secondary' href='#'>Suprise Me</a>") | ||
|
||
= f.input :url_slug, label: 'URL' | ||
|
||
= f.textarea :content, label: 'Content', placeholder: "And your story...", rows: 9 | ||
|
||
= f.inline_checkbox :select_roles, label: "Inline checkboxes", collection: options_array | ||
|
||
= f.radio :select_roles, label: "Stacked radios", collection: options_array | ||
|
||
= f.select :select_roles, label: 'Role', collection: roles_array | ||
|
||
= f.custom_file :content, label: 'Custom File' | ||
|
||
= f.custom_select :select_roles, label: "Custom Select", collection: roles_array | ||
|
||
= f.custom_radio :select_roles, label: "Custom Inline radios", collection: options_array | ||
|
||
= f.custom_checkbox :select_roles, label: "Custom Inline checkbox", collection: options_array | ||
|
||
= f.custom_stacked_radio :select_roles, label: "Custom Stacked radios", collection: options_array | ||
|
||
= f.custom_stacked_checkbox :select_roles, label: "Custom Stacked checkbox", collection: options_array | ||
|
||
= f.submit content: "Submit!", class: ['btn-lg'] |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
.page-header | ||
%h1 | ||
%a.btn.btn-info{href: "/posts/#{model.id}/edit", style: "margin-right:10px;"} Edit | ||
= title | ||
|
||
.content | ||
= content |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
!!! | ||
%html.no-js{:lang => "en"} | ||
%head | ||
%meta{:charset => "utf-8"}/ | ||
%meta{:content => "width=device-width, initial-scale=1, shrink-to-fit=no", :name => "viewport"}/ | ||
%meta{:content => "ie=edge", "http-equiv" => "x-ua-compatible"}/ | ||
%title Sinatra Sings Gemgem | Welcome | ||
%link{:crossorigin => "anonymous", :href => "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css", :integrity => "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO", :rel => "stylesheet"}/ | ||
%link{:href => "/app.css", :rel => "stylesheet"}/ | ||
%body | ||
.navbar.navbar-dark.bg-inverse.navbar-fixed-top | ||
.container-fluid | ||
%a.navbar-brand{:href => "#"} Trailblazer | ||
%ul.nav.navbar-nav.pull-xs-right | ||
/ <li class="menu-text">Blog</li> | ||
%li.nav-item | ||
%a.nav-link{:href => "/posts/new"} New Post | ||
%li.nav-item | ||
%a.nav-link{:href => "/posts"} All | ||
.container-fluid | ||
.jumbotron | ||
.text-xs-center | ||
%h1.display-1 Sinatra and Trailblazer | ||
%p Our blog about high-level architecture and awesome software. | ||
.col-sm-6.col-sm-offset-3 | ||
= yield | ||
%script{:crossorigin => "anonymous", :integrity => "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo", :src => "https://code.jquery.com/jquery-3.3.1.slim.min.js"} | ||
%script{:crossorigin => "anonymous", :integrity => "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49", :src => "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"} | ||
%script{:crossorigin => "anonymous", :integrity => "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy", :src => "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"} |
Oops, something went wrong.
38843a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.