bookyt 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/16x16/add.png +0 -0
- data/app/assets/images/16x16/alert.png +0 -0
- data/app/assets/images/16x16/combolink.png +0 -0
- data/app/assets/images/16x16/copy.png +0 -0
- data/app/assets/images/16x16/delete.png +0 -0
- data/app/assets/images/16x16/edit.png +0 -0
- data/app/assets/images/16x16/filter.png +0 -0
- data/app/assets/images/16x16/index.png +0 -0
- data/app/assets/images/16x16/notice.png +0 -0
- data/app/assets/images/16x16/pdf.png +0 -0
- data/app/assets/images/16x16/print.png +0 -0
- data/app/assets/images/16x16/show.png +0 -0
- data/app/assets/images/22x22/arrow-right.png +0 -0
- data/app/assets/images/22x22/edit.png +0 -0
- data/app/assets/images/22x22/insert_booking.png +0 -0
- data/app/assets/images/22x22/remove.png +0 -0
- data/app/assets/images/32x32/edit.png +0 -0
- data/app/assets/images/32x32/remove.png +0 -0
- data/app/assets/images/48x48/accounting.png +0 -0
- data/app/assets/images/48x48/basic_claims_data.png +0 -0
- data/app/assets/images/48x48/contacts.png +0 -0
- data/app/assets/images/48x48/invoicing.png +0 -0
- data/app/assets/images/48x48/nav_users.png +0 -0
- data/app/assets/images/48x48/settings.png +0 -0
- data/app/assets/images/48x48/store.png +0 -0
- data/app/assets/images/button_bg.png +0 -0
- data/app/assets/images/crystal-icons/16x16/filter.png +0 -0
- data/app/assets/images/down.png +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/flavour-extended/48x48/invoice.png +0 -0
- data/app/assets/images/free-business-desktop-icons/48x48/business.png +0 -0
- data/app/assets/images/gnome-web-icons/48x48/Gnome-X-Office-Address-Book-48.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_759fcf_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_85_aeb9cf_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_55_aeb9cf_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_100_759fcf_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_100_f6f6f6_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_217bc0_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_6da8d5_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_d8e7f3_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f9bd01_256x240.png +0 -0
- data/app/assets/images/jquery/tooltip/black_arrow.png +0 -0
- data/app/assets/images/letter-logo.alpha.png +0 -0
- data/app/assets/images/letter-logo.big.png +0 -0
- data/app/assets/images/letter-logo.orig.png +0 -0
- data/app/assets/images/letter-logo.png +0 -0
- data/app/assets/images/loading.gif +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/application-pdf.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/document-preview.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/document-print.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/edit-copy.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/go-next.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/mail-mark-notjunk.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/status_unknown.png +0 -0
- data/app/assets/images/oxygen-icons/48x48/system-users.png +0 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/images/up.png +0 -0
- data/app/assets/javascripts/application.js +49 -0
- data/app/assets/javascripts/cyt.js +86 -0
- data/app/assets/javascripts/jquery-ui.js +11437 -0
- data/app/assets/javascripts/jquery.dirtyform.js +242 -0
- data/app/assets/javascripts/jquery.form.js +785 -0
- data/app/assets/javascripts/jquery.js +8936 -0
- data/app/assets/javascripts/jquery.meio.mask.js +683 -0
- data/app/assets/javascripts/jquery.remotipart.js +46 -0
- data/app/assets/javascripts/jquery.ui.combobox.js +77 -0
- data/app/assets/javascripts/jquery_ujs.js +316 -0
- data/app/assets/javascripts/nested_form.js +51 -0
- data/app/assets/javascripts/tooltip.js +343 -0
- data/app/assets/stylesheets/.gitkeep +0 -0
- data/app/assets/stylesheets/ie.scss +16 -0
- data/app/assets/stylesheets/ie6.scss +4 -0
- data/app/assets/stylesheets/partials/_base.sass +39 -0
- data/app/assets/stylesheets/partials/_content.sass +60 -0
- data/app/assets/stylesheets/partials/_jquery.sass +2 -0
- data/app/assets/stylesheets/partials/_layout.sass +21 -0
- data/app/assets/stylesheets/partials/_sidebar.sass +5 -0
- data/app/assets/stylesheets/partials/content/_accounting.sass +41 -0
- data/app/assets/stylesheets/partials/content/_ajax_indicator.sass +28 -0
- data/app/assets/stylesheets/partials/content/_app.sass +43 -0
- data/app/assets/stylesheets/partials/content/_combobox.sass +8 -0
- data/app/assets/stylesheets/partials/content/_cyt.sass +200 -0
- data/app/assets/stylesheets/partials/content/_fancy_buttons.sass +10 -0
- data/app/assets/stylesheets/partials/content/_flash_errors.sass +46 -0
- data/app/assets/stylesheets/partials/content/_form_view.sass +20 -0
- data/app/assets/stylesheets/partials/content/_icons.sass +35 -0
- data/app/assets/stylesheets/partials/content/_invoice.sass +6 -0
- data/app/assets/stylesheets/partials/content/_overview.sass +40 -0
- data/app/assets/stylesheets/partials/content/_pagination.sass +61 -0
- data/app/assets/stylesheets/partials/content/_person.sass +5 -0
- data/app/assets/stylesheets/partials/content/_scaffold.sass +67 -0
- data/app/assets/stylesheets/partials/content/_table_list.sass +26 -0
- data/app/assets/stylesheets/partials/content/formtastic/_formtastic.sass +201 -0
- data/app/assets/stylesheets/partials/content/formtastic/_formtastic_cyt.sass +90 -0
- data/app/assets/stylesheets/partials/formtastic/_custom_fields.sass +2 -0
- data/app/assets/stylesheets/partials/formtastic/_formtastic_base.sass +652 -0
- data/app/assets/stylesheets/partials/jquery/_jquery_ui.sass +1461 -0
- data/app/assets/stylesheets/partials/jquery/_tooltip.sass +21 -0
- data/app/assets/stylesheets/partials/layout/_header.sass +29 -0
- data/app/assets/stylesheets/partials/layout/_navigation.sass +2 -0
- data/app/assets/stylesheets/partials/layout/navigation/_main.sass +34 -0
- data/app/assets/stylesheets/partials/layout/navigation/_sidebar.sass +18 -0
- data/app/assets/stylesheets/partials/print/_app.sass +21 -0
- data/app/assets/stylesheets/partials/print/_layout.sass +24 -0
- data/app/assets/stylesheets/print.scss +5 -0
- data/app/assets/stylesheets/screen.scss +12 -0
- data/app/controllers/account_types_controller.rb +2 -0
- data/app/controllers/accounts_controller.rb +30 -0
- data/app/controllers/application_controller.rb +12 -0
- data/app/controllers/attachments_controller.rb +15 -0
- data/app/controllers/authorized_controller.rb +24 -0
- data/app/controllers/bank_accounts_controller.rb +2 -0
- data/app/controllers/booking_imports_controller.rb +2 -0
- data/app/controllers/booking_templates_controller.rb +8 -0
- data/app/controllers/bookings_controller.rb +64 -0
- data/app/controllers/charge_booking_templates_controller.rb +2 -0
- data/app/controllers/charge_rates_controller.rb +2 -0
- data/app/controllers/companies_controller.rb +8 -0
- data/app/controllers/credit_invoices_controller.rb +29 -0
- data/app/controllers/customers_controller.rb +12 -0
- data/app/controllers/debit_invoices_controller.rb +43 -0
- data/app/controllers/direct_bookings_controller.rb +17 -0
- data/app/controllers/employees_controller.rb +3 -0
- data/app/controllers/employments_controller.rb +2 -0
- data/app/controllers/invoices_controller.rb +21 -0
- data/app/controllers/notes_controller.rb +34 -0
- data/app/controllers/overview_controller.rb +6 -0
- data/app/controllers/people_controller.rb +13 -0
- data/app/controllers/salaries_controller.rb +46 -0
- data/app/controllers/tenants_controller.rb +39 -0
- data/app/controllers/users_controller.rb +26 -0
- data/app/helpers/application_helper.rb +52 -0
- data/app/helpers/booking_helper.rb +10 -0
- data/app/helpers/booking_template_helper.rb +17 -0
- data/app/helpers/charge_rate_helper.rb +5 -0
- data/app/helpers/invoice_helper.rb +9 -0
- data/app/helpers/vat_rate_helper.rb +10 -0
- data/app/inputs/combobox_input.rb +23 -0
- data/app/inputs/date_field_input.rb +5 -0
- data/app/inputs/hour_field_input.rb +5 -0
- data/app/models/ability.rb +34 -0
- data/app/models/attachment.rb +13 -0
- data/app/models/booking_import.rb +8 -0
- data/app/models/booking_import_observer.rb +7 -0
- data/app/models/booking_reference.rb +4 -0
- data/app/models/booking_template.rb +92 -0
- data/app/models/charge_booking_template.rb +57 -0
- data/app/models/charge_rate.rb +30 -0
- data/app/models/civil_status.rb +5 -0
- data/app/models/company.rb +5 -0
- data/app/models/credit_invoice.rb +32 -0
- data/app/models/customer.rb +4 -0
- data/app/models/debit_invoice.rb +24 -0
- data/app/models/employee.rb +6 -0
- data/app/models/employment.rb +28 -0
- data/app/models/invoice.rb +145 -0
- data/app/models/line_item.rb +22 -0
- data/app/models/note.rb +8 -0
- data/app/models/person.rb +65 -0
- data/app/models/product.rb +2 -0
- data/app/models/profit.rb +9 -0
- data/app/models/religion.rb +5 -0
- data/app/models/role.rb +9 -0
- data/app/models/salary.rb +93 -0
- data/app/models/tenant.rb +43 -0
- data/app/models/user.rb +44 -0
- data/app/models/vat_rate.rb +11 -0
- data/app/uploaders/attachment_uploader.rb +12 -0
- data/app/views/account_types/_account_type.html.haml +6 -0
- data/app/views/account_types/_form.html.haml +7 -0
- data/app/views/account_types/_list.html.haml +7 -0
- data/app/views/account_types/index.html.haml +6 -0
- data/app/views/account_types/show.html.haml +6 -0
- data/app/views/accounts/_account.html.haml +12 -0
- data/app/views/accounts/_booking_item.html.haml +15 -0
- data/app/views/accounts/_booking_list.html.haml +19 -0
- data/app/views/accounts/_booking_list_footer.html.haml +2 -0
- data/app/views/accounts/_booking_list_header.html.haml +8 -0
- data/app/views/accounts/_booking_list_paginate.html.haml +5 -0
- data/app/views/accounts/_booking_list_saldo.html.haml +8 -0
- data/app/views/accounts/_booking_list_turnover.html.haml +9 -0
- data/app/views/accounts/_carry_booking.html.haml +9 -0
- data/app/views/accounts/_form.html.haml +10 -0
- data/app/views/accounts/_list_footer.html.haml +2 -0
- data/app/views/accounts/_list_header.html.haml +5 -0
- data/app/views/accounts/index.html.haml +8 -0
- data/app/views/accounts/show.html.haml +10 -0
- data/app/views/application/_form.html.haml +7 -0
- data/app/views/application/_list.html.haml +15 -0
- data/app/views/application/_search_form.html.haml +5 -0
- data/app/views/application/_show.html.haml +2 -0
- data/app/views/application/create.js.erb +3 -0
- data/app/views/application/destroy.js.erb +2 -0
- data/app/views/application/edit.html.haml +5 -0
- data/app/views/application/edit.js.erb +3 -0
- data/app/views/application/index.html.haml +7 -0
- data/app/views/application/new.html.haml +5 -0
- data/app/views/application/new.js.erb +3 -0
- data/app/views/application/show.html.haml +5 -0
- data/app/views/application/update.js.erb +3 -0
- data/app/views/attachments/_attachment.html.haml +5 -0
- data/app/views/attachments/_form.html.haml +15 -0
- data/app/views/attachments/_list.html.haml +6 -0
- data/app/views/bank_accounts/_bank_account.html.haml +1 -0
- data/app/views/booking_imports/_booking_import.html.haml +5 -0
- data/app/views/booking_imports/_form.html.haml +6 -0
- data/app/views/booking_imports/_list.html.haml +7 -0
- data/app/views/booking_imports/create.js.erb +4 -0
- data/app/views/booking_imports/index.html.haml +6 -0
- data/app/views/booking_imports/show.html.haml +6 -0
- data/app/views/booking_templates/_booking_template.html.haml +16 -0
- data/app/views/booking_templates/_form.html.haml +12 -0
- data/app/views/booking_templates/_list.html.haml +10 -0
- data/app/views/booking_templates/index.html.haml +6 -0
- data/app/views/bookings/_booking.html.haml +17 -0
- data/app/views/bookings/_form.html.haml +14 -0
- data/app/views/bookings/_list.html.haml +11 -0
- data/app/views/bookings/_new_form.html.haml +8 -0
- data/app/views/bookings/_sidebar.html.haml +7 -0
- data/app/views/bookings/_simple_form.html.haml +12 -0
- data/app/views/bookings/index.html.haml +9 -0
- data/app/views/bookings/new.html.haml +8 -0
- data/app/views/bookings/select.html.haml +11 -0
- data/app/views/bookings/show.html.haml +27 -0
- data/app/views/bookings/simple_edit.html.haml +4 -0
- data/app/views/charge_booking_templates/_charge_booking_template.html.haml +15 -0
- data/app/views/charge_booking_templates/_form.html.haml +12 -0
- data/app/views/charge_booking_templates/_list.html.haml +10 -0
- data/app/views/charge_rates/_form.html.haml +14 -0
- data/app/views/companies/_company.html.haml +5 -0
- data/app/views/companies/_form.html.haml +8 -0
- data/app/views/companies/_list.html.haml +6 -0
- data/app/views/companies/index.html.haml +6 -0
- data/app/views/companies/show.html.haml +27 -0
- data/app/views/credit_invoices/_credit_invoice.html.haml +9 -0
- data/app/views/credit_invoices/_form.html.haml +41 -0
- data/app/views/credit_invoices/_list.html.haml +20 -0
- data/app/views/credit_invoices/index.html.haml +7 -0
- data/app/views/credit_invoices/show.html.haml +56 -0
- data/app/views/customers/_customer.html.haml +5 -0
- data/app/views/customers/_form.html.haml +8 -0
- data/app/views/customers/_list.html.haml +6 -0
- data/app/views/customers/index.html.haml +6 -0
- data/app/views/customers/show.html.haml +22 -0
- data/app/views/debit_invoices/_debit_invoice.html.haml +9 -0
- data/app/views/debit_invoices/_form.html.haml +38 -0
- data/app/views/debit_invoices/_invoice_body.html.haml +8 -0
- data/app/views/debit_invoices/_invoice_info.html.haml +10 -0
- data/app/views/debit_invoices/_invoice_parties.html.haml +9 -0
- data/app/views/debit_invoices/_list.html.haml +21 -0
- data/app/views/debit_invoices/index.html.haml +7 -0
- data/app/views/debit_invoices/letter.html.haml +9 -0
- data/app/views/debit_invoices/letter.pdf.prawn +57 -0
- data/app/views/debit_invoices/show.html.haml +56 -0
- data/app/views/devise/confirmations/new.html.haml +10 -0
- data/app/views/devise/mailer/confirmation_instructions.html.haml +6 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +10 -0
- data/app/views/devise/mailer/unlock_instructions.html.haml +8 -0
- data/app/views/devise/passwords/edit.html.haml +15 -0
- data/app/views/devise/passwords/new.html.haml +11 -0
- data/app/views/devise/sessions/new.html.haml +13 -0
- data/app/views/devise/shared/_links.haml +15 -0
- data/app/views/devise/unlocks/new.html.haml +11 -0
- data/app/views/direct_bookings/_form.html.haml +12 -0
- data/app/views/direct_bookings/_item.html.haml +17 -0
- data/app/views/direct_bookings/_list.html.haml +10 -0
- data/app/views/direct_bookings/_list_footer.html.haml +6 -0
- data/app/views/direct_bookings/_show.html.haml +3 -0
- data/app/views/direct_bookings/_show_all.html.haml +8 -0
- data/app/views/direct_bookings/list.js.erb +2 -0
- data/app/views/direct_bookings/new.js.erb +2 -0
- data/app/views/employees/_employee.html.haml +5 -0
- data/app/views/employees/_form.html.haml +19 -0
- data/app/views/employees/_list.html.haml +6 -0
- data/app/views/employees/index.html.haml +6 -0
- data/app/views/employees/show.html.haml +31 -0
- data/app/views/employments/_employment.html.haml +10 -0
- data/app/views/employments/_form.html.haml +24 -0
- data/app/views/employments/_list.html.haml +11 -0
- data/app/views/employments/_show.html.haml +9 -0
- data/app/views/employments/index.html.haml +5 -0
- data/app/views/invoices/_form.html.haml +13 -0
- data/app/views/invoices/_invoice.html.haml +7 -0
- data/app/views/invoices/_list.html.haml +20 -0
- data/app/views/invoices/_sidebar.html.haml +11 -0
- data/app/views/invoices/index.html.haml +17 -0
- data/app/views/invoices/show.html.haml +56 -0
- data/app/views/layouts/_flash_new.html.haml +1 -0
- data/app/views/layouts/_list_item_actions_for.html.haml +3 -0
- data/app/views/layouts/application.html.haml +46 -0
- data/app/views/line_items/_form.html.haml +6 -0
- data/app/views/line_items/_line_item.html.haml +7 -0
- data/app/views/line_items/_list_footer.html.haml +7 -0
- data/app/views/notes/_form.html.haml +10 -0
- data/app/views/notes/_list.html.haml +15 -0
- data/app/views/notes/index.html.haml +9 -0
- data/app/views/notes/show.html.haml +12 -0
- data/app/views/overview/index.html.haml +14 -0
- data/app/views/people/_form.html.haml +8 -0
- data/app/views/people/_list.html.haml +7 -0
- data/app/views/people/_person.html.haml +6 -0
- data/app/views/people/_show.html.haml +6 -0
- data/app/views/people/show.html.haml +21 -0
- data/app/views/persons/_civil.html.haml +5 -0
- data/app/views/persons/_show.html.haml +6 -0
- data/app/views/salaries/_form.html.haml +14 -0
- data/app/views/salaries/_list.html.haml +12 -0
- data/app/views/salaries/_salary.html.haml +10 -0
- data/app/views/salaries/_salary_certificate.html.haml +25 -0
- data/app/views/salaries/payslip.html.haml +40 -0
- data/app/views/salaries/show.html.haml +30 -0
- data/app/views/salaries/statistics.html.haml +6 -0
- data/app/views/tenants/_account.html.haml +7 -0
- data/app/views/tenants/_account_group_sheet.html.haml +8 -0
- data/app/views/tenants/_form.html.haml +17 -0
- data/app/views/tenants/_list.html.haml +7 -0
- data/app/views/tenants/_tenant.html.haml +7 -0
- data/app/views/tenants/balance_sheet.html.haml +43 -0
- data/app/views/tenants/index.html.haml +6 -0
- data/app/views/tenants/new.js.erb +1 -0
- data/app/views/tenants/profit_sheet.html.haml +26 -0
- data/app/views/tenants/show.html.haml +18 -0
- data/app/views/users/_demo.de-CH.html.haml +7 -0
- data/app/views/users/_demo.de.html.haml +7 -0
- data/app/views/users/_demo.html.haml +7 -0
- data/app/views/users/_form.html.haml +17 -0
- data/app/views/users/_list.html.haml +9 -0
- data/app/views/users/_show.html.haml +13 -0
- data/app/views/users/_user.html.haml +7 -0
- data/app/views/users/index.html.haml +6 -0
- data/app/views/users/new.js.erb +1 -0
- data/app/views/users/show.html.haml +14 -0
- data/lib/acts_as_csv.rb +113 -0
- data/lib/bookyt/engine.rb +18 -0
- data/lib/bookyt/version.rb +3 -0
- data/lib/float.rb +17 -0
- data/lib/pagination_list_link_renderer.rb +63 -0
- data/lib/parse_date.rb +27 -0
- data/lib/prawn/letter_document.rb +136 -0
- data/lib/raiffeisen_importer.rb +15 -0
- data/lib/recipes/bookyt.rb +15 -0
- data/lib/simple_navigation/renderer/list.rb +20 -0
- data/lib/simple_navigation/renderer/overview.rb +46 -0
- data/lib/sqlite3_extensions.rb +45 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/bookyt.rake +15 -0
- data/lib/tasks/cucumber.rake +53 -0
- data/lib/tasks/environment_seeds.rake +7 -0
- data/lib/tasks/users.rake +46 -0
- metadata +423 -0
@@ -0,0 +1,652 @@
|
|
1
|
+
//
|
2
|
+
// FORMTASTIC SASS
|
3
|
+
// Flexible styling for formtastic forms
|
4
|
+
// http://www.github.com/active-stylus/formtastic-sass
|
5
|
+
//
|
6
|
+
//--------------------------------------------------------
|
7
|
+
// STACKED FORMS
|
8
|
+
// Labels fill up the full width of the form
|
9
|
+
// Inputs are on new lines
|
10
|
+
//--------------------------------------------------------
|
11
|
+
//
|
12
|
+
// Arguments:
|
13
|
+
//
|
14
|
+
// +stack-form(full-width, input-width, submit-button-align)
|
15
|
+
//
|
16
|
+
// Example:
|
17
|
+
//
|
18
|
+
// form.formtastic
|
19
|
+
// +stack-form(300px,"full","right")
|
20
|
+
//
|
21
|
+
// Default Settings:
|
22
|
+
//
|
23
|
+
$stacked_fieldset: 100%
|
24
|
+
|
25
|
+
// Full width of the fieldset
|
26
|
+
//
|
27
|
+
$stacked_input: auto
|
28
|
+
|
29
|
+
// "auto" = automatic widths
|
30
|
+
// "full" = same width as form
|
31
|
+
// "960px" = custom width
|
32
|
+
//
|
33
|
+
$stacked_padding: 0
|
34
|
+
|
35
|
+
// Left padding on all labels and inputs
|
36
|
+
//
|
37
|
+
$stacked_button_align: buttons-left
|
38
|
+
|
39
|
+
// "buttons-left" = float submit button left
|
40
|
+
// "buttons-right" = float submit button right
|
41
|
+
// "buttons-full" = submit button matches input width
|
42
|
+
//
|
43
|
+
$stacked_select_width: select-auto
|
44
|
+
|
45
|
+
// "select-auto" = default width
|
46
|
+
// "select-full" = same as specified input width
|
47
|
+
//
|
48
|
+
//--------------------------------------------------------
|
49
|
+
// FLOATED FORMS
|
50
|
+
// Column layout with labels left of the inputs
|
51
|
+
// Comes in 2 flavors for text alignment of the labels
|
52
|
+
//--------------------------------------------------------
|
53
|
+
//
|
54
|
+
// Arguments:
|
55
|
+
//
|
56
|
+
// +float-form-left(total-width, label-width, input-width, label-padding-x, submit-align)
|
57
|
+
//
|
58
|
+
// Examples:
|
59
|
+
//
|
60
|
+
// form.lefty
|
61
|
+
// +float-form-left(800px,500px,200px,6px,"buttons-left")
|
62
|
+
//
|
63
|
+
// form.righty
|
64
|
+
// +float-form-right(800px,500px,200px,6px,"buttons-left")
|
65
|
+
//
|
66
|
+
//--------------------------------------------------------
|
67
|
+
// Default Settings:
|
68
|
+
// (do not mix units because calculations are made)
|
69
|
+
//
|
70
|
+
$floated_total_width: 100%
|
71
|
+
|
72
|
+
// Total Width of form
|
73
|
+
//
|
74
|
+
$floated_input_width: 70%
|
75
|
+
|
76
|
+
// Width of inputs
|
77
|
+
//
|
78
|
+
$floated_label_width: 20%
|
79
|
+
|
80
|
+
// Width of Label
|
81
|
+
//
|
82
|
+
$floated_label_padding_x: 0
|
83
|
+
|
84
|
+
// How far labels are spaced from inputs
|
85
|
+
//
|
86
|
+
$floated_button_align: buttons-left
|
87
|
+
|
88
|
+
// "buttons-left" = float submit button left
|
89
|
+
// "buttons-right" = float submit button right
|
90
|
+
// "buttons-full" = submit button matches input width
|
91
|
+
//
|
92
|
+
$floated_label_text_align: left
|
93
|
+
|
94
|
+
// "left"
|
95
|
+
// "right"
|
96
|
+
// "center"
|
97
|
+
//
|
98
|
+
$floated_select_width: select-auto
|
99
|
+
|
100
|
+
// "select-auto" = default width
|
101
|
+
// "select-full" = same as specified input width
|
102
|
+
//
|
103
|
+
//========================================================
|
104
|
+
// FORMTASTIC STYLING
|
105
|
+
// Note: Be careful when modifying widths and
|
106
|
+
// horizontal padding/margins as you can break layouts
|
107
|
+
//========================================================
|
108
|
+
=clearfix
|
109
|
+
*display: inline-block
|
110
|
+
&:after
|
111
|
+
content: " "
|
112
|
+
display: block
|
113
|
+
height: 0
|
114
|
+
clear: both
|
115
|
+
visibility: hidden
|
116
|
+
|
117
|
+
//
|
118
|
+
//
|
119
|
+
//
|
120
|
+
//--------------------------------------------------------
|
121
|
+
//========================================================
|
122
|
+
// Base stuff (do not edit unless you are smarter than me :p)
|
123
|
+
//========================================================
|
124
|
+
//--------------------------------------------------------
|
125
|
+
//
|
126
|
+
//
|
127
|
+
//
|
128
|
+
//--------------------------------------------------------
|
129
|
+
// Generic Mixins
|
130
|
+
//--------------------------------------------------------
|
131
|
+
=float-labels($width, $padding: 0, $direction: left)
|
132
|
+
width: $width - $padding
|
133
|
+
text-align: $direction
|
134
|
+
display: inline
|
135
|
+
float: left
|
136
|
+
clear: none
|
137
|
+
@if $padding == 0
|
138
|
+
padding: 0
|
139
|
+
@else
|
140
|
+
padding-#{$direction}: $padding
|
141
|
+
|
142
|
+
=block($block_float: clear)
|
143
|
+
display: block
|
144
|
+
@if $block_float == "clear"
|
145
|
+
clear: both
|
146
|
+
float: none
|
147
|
+
@else
|
148
|
+
float: $block_float
|
149
|
+
|
150
|
+
=inline($float: none, $clear: none)
|
151
|
+
display: inline
|
152
|
+
float: $float
|
153
|
+
clear: $clear
|
154
|
+
|
155
|
+
=reset-form
|
156
|
+
// Reset elements
|
157
|
+
ul, ol, legend, p
|
158
|
+
margin: 0
|
159
|
+
padding: 0
|
160
|
+
li
|
161
|
+
margin-left: 0px
|
162
|
+
margin-right: 0px
|
163
|
+
padding-left: 0px
|
164
|
+
padding-right: 0px
|
165
|
+
// Clearfix fieldsets
|
166
|
+
fieldset
|
167
|
+
display: block
|
168
|
+
+clearfix
|
169
|
+
// * fields
|
170
|
+
abbr, acronym
|
171
|
+
border: 0
|
172
|
+
font-variant: normal
|
173
|
+
font-weight: normal
|
174
|
+
// Reset list styles
|
175
|
+
ol, ul
|
176
|
+
list-style: none
|
177
|
+
// Clearfix label
|
178
|
+
label
|
179
|
+
display: block
|
180
|
+
+clearfix
|
181
|
+
// Align Inputs
|
182
|
+
input, textarea
|
183
|
+
vertical-align: middle
|
184
|
+
// Make Labels Clickable
|
185
|
+
.check_boxes, .radio
|
186
|
+
input
|
187
|
+
margin: 0
|
188
|
+
label
|
189
|
+
cursor: pointer
|
190
|
+
// Hide hidden fields
|
191
|
+
.hidden
|
192
|
+
display: none
|
193
|
+
// Date Time Selects shown inline
|
194
|
+
.date, .time, .datetime
|
195
|
+
li
|
196
|
+
float: left
|
197
|
+
width: auto
|
198
|
+
clear: none
|
199
|
+
label
|
200
|
+
display: none
|
201
|
+
width: auto
|
202
|
+
input
|
203
|
+
display: inline
|
204
|
+
margin: 0
|
205
|
+
padding: 0
|
206
|
+
// Error lists for each input
|
207
|
+
.errors
|
208
|
+
list-style: square
|
209
|
+
li
|
210
|
+
padding: 0
|
211
|
+
border: none
|
212
|
+
display: list-item
|
213
|
+
float: none
|
214
|
+
clear: both
|
215
|
+
.inputs
|
216
|
+
z-index: 99
|
217
|
+
// Float Submit Buttons
|
218
|
+
.buttons li
|
219
|
+
float: left
|
220
|
+
// Reset Nested Fieldset & Legends
|
221
|
+
li
|
222
|
+
+clearfix
|
223
|
+
display: block
|
224
|
+
fieldset
|
225
|
+
border: none
|
226
|
+
position: relative
|
227
|
+
margin-top: 0px
|
228
|
+
legend
|
229
|
+
display: block
|
230
|
+
margin-bottom: 0
|
231
|
+
.label
|
232
|
+
display: block
|
233
|
+
clear: both
|
234
|
+
background: transparent
|
235
|
+
// Reset lists for checkboxes and radio buttons
|
236
|
+
ol
|
237
|
+
float: left
|
238
|
+
margin: 0
|
239
|
+
li
|
240
|
+
padding: 0
|
241
|
+
border: 0
|
242
|
+
display: inline
|
243
|
+
|
244
|
+
//
|
245
|
+
//--------------------------------------------------------
|
246
|
+
// Form Stack
|
247
|
+
//--------------------------------------------------------
|
248
|
+
//
|
249
|
+
=stack-form($stacked_fieldset, $stacked_input, $stacked_padding, $stacked_button_align, $stacked_select_width)
|
250
|
+
+reset-form
|
251
|
+
fieldset
|
252
|
+
width: $stacked_fieldset
|
253
|
+
ol
|
254
|
+
padding-left: $stacked_padding
|
255
|
+
input
|
256
|
+
clear: both
|
257
|
+
float: none
|
258
|
+
li
|
259
|
+
+block
|
260
|
+
width: $stacked_fieldset
|
261
|
+
ol
|
262
|
+
padding: 0
|
263
|
+
li
|
264
|
+
clear: none
|
265
|
+
width: auto
|
266
|
+
fieldset
|
267
|
+
legend, legend .label
|
268
|
+
display: block
|
269
|
+
clear: both
|
270
|
+
.label
|
271
|
+
position: relative
|
272
|
+
label, input
|
273
|
+
width: auto
|
274
|
+
.date, .time, .datetime
|
275
|
+
ol
|
276
|
+
width: $stacked_fieldset
|
277
|
+
li
|
278
|
+
display: inline
|
279
|
+
clear: none
|
280
|
+
float: left
|
281
|
+
padding-right: $stacked_padding / 2
|
282
|
+
.checkbox, .radio
|
283
|
+
li
|
284
|
+
display: block
|
285
|
+
input
|
286
|
+
border: none
|
287
|
+
label
|
288
|
+
+block
|
289
|
+
width: $stacked_input
|
290
|
+
input, textarea
|
291
|
+
@if $stacked_input == "full"
|
292
|
+
width: $stacked_fieldset - $stacked_padding
|
293
|
+
@else
|
294
|
+
width: $stacked_input
|
295
|
+
select
|
296
|
+
@if $stacked_select_width == "select-auto"
|
297
|
+
width: auto
|
298
|
+
@else
|
299
|
+
width: $stacked_input
|
300
|
+
.errors li
|
301
|
+
display: list-item
|
302
|
+
.buttons
|
303
|
+
ol
|
304
|
+
padding-left: $stacked_padding
|
305
|
+
padding-right: $stacked_padding
|
306
|
+
li
|
307
|
+
@if $stacked_button_align == "buttons-left"
|
308
|
+
float: left
|
309
|
+
@if $stacked_button_align == "buttons-right"
|
310
|
+
float: right
|
311
|
+
width: auto
|
312
|
+
clear: none
|
313
|
+
display: inline
|
314
|
+
input
|
315
|
+
@if $stacked_button_align == "buttons-full"
|
316
|
+
width: $stacked_fieldset
|
317
|
+
@else
|
318
|
+
width: auto
|
319
|
+
#errorExplanation
|
320
|
+
width: $stacked_fieldset - $stacked_padding
|
321
|
+
.label
|
322
|
+
// Legend Left Margin Hack for IE
|
323
|
+
#left: -0.5em
|
324
|
+
#position: relative
|
325
|
+
|
326
|
+
//
|
327
|
+
//--------------------------------------------------------
|
328
|
+
// Float Form Core
|
329
|
+
//--------------------------------------------------------
|
330
|
+
//
|
331
|
+
=float-form($floated_total_width, $floated_label_width, $floated_input_width, $floated_label_padding_x, $floated_button_align, $floated_label_text_align, $floated_select_width)
|
332
|
+
+reset-form
|
333
|
+
fieldset
|
334
|
+
width: $floated_total_width
|
335
|
+
label
|
336
|
+
float: left
|
337
|
+
width: $floated_label_width - $floated_label_padding_x
|
338
|
+
text-align: $floated_label_text_align
|
339
|
+
padding-#{$floated_label_text_align}: $floated_label_padding_x
|
340
|
+
li
|
341
|
+
ol
|
342
|
+
padding: 0 $floated_total_width - ($floated_input_width + $floated_label_width) 0 $floated_label_width
|
343
|
+
fieldset
|
344
|
+
legend, legend .label
|
345
|
+
display: block
|
346
|
+
legend
|
347
|
+
+float-labels($floated_label_width, $floated_label_padding_x, $floated_label_text_align)
|
348
|
+
width: $floated_total_width - $floated_label_padding_x
|
349
|
+
.label
|
350
|
+
position: absolute
|
351
|
+
width: $floated_label_width - $floated_label_padding_x
|
352
|
+
top: 0px
|
353
|
+
@if $floated_label_text_align == "right"
|
354
|
+
left: 0
|
355
|
+
@else
|
356
|
+
left: $floated_label_padding_x
|
357
|
+
label
|
358
|
+
padding-left: 0
|
359
|
+
label, input
|
360
|
+
width: auto
|
361
|
+
display: inline
|
362
|
+
clear: none
|
363
|
+
text-align: left
|
364
|
+
select
|
365
|
+
padding: 0
|
366
|
+
clear: both
|
367
|
+
display: block
|
368
|
+
.inline-hints, .inline-errors, .errors
|
369
|
+
margin: 0 0 0 $floated_label_width
|
370
|
+
input, textarea
|
371
|
+
width: $floated_input_width
|
372
|
+
select
|
373
|
+
@if $floated_select_width == "select-auto"
|
374
|
+
width: auto
|
375
|
+
@else
|
376
|
+
width: $floated_input_width
|
377
|
+
.checkbox, .radio
|
378
|
+
li
|
379
|
+
display: block
|
380
|
+
clear: both
|
381
|
+
input
|
382
|
+
border: none
|
383
|
+
.buttons
|
384
|
+
padding-left: $floated_label_width
|
385
|
+
width: $floated_total_width - $floated_label_width
|
386
|
+
input
|
387
|
+
width: auto
|
388
|
+
ol
|
389
|
+
@if $floated_button_align == "buttons-right"
|
390
|
+
padding-right: $floated_label_padding_x
|
391
|
+
li
|
392
|
+
width: auto
|
393
|
+
@if $floated_button_align == "buttons-right"
|
394
|
+
float: right
|
395
|
+
@else
|
396
|
+
float: left
|
397
|
+
@if $floated_button_align == "full-buttons"
|
398
|
+
input
|
399
|
+
width: $floated_input_width
|
400
|
+
@else
|
401
|
+
display: inline
|
402
|
+
#errorExplanation
|
403
|
+
margin-left: $floated_label_width
|
404
|
+
width: $floated_input_width
|
405
|
+
|
406
|
+
//
|
407
|
+
//--------------------------------------------------------
|
408
|
+
// Float Form Left/Right
|
409
|
+
//--------------------------------------------------------
|
410
|
+
//
|
411
|
+
=float-form-left($floated_total_width, $floated_label_width, $floated_input_width, $floated_label_padding_x, $floated_button_align)
|
412
|
+
+float-form($floated_total_width, $floated_label_width, $floated_input_width, $floated_label_padding_x, $floated_button_align, "left")
|
413
|
+
|
414
|
+
=float-form-right($floated_total_width, $floated_label_width, $floated_input_width, $floated_label_padding_x, $floated_button_align)
|
415
|
+
+float-form($floated_total_width, $floated_label_width, $floated_input_width, $floated_label_padding_x, $floated_button_align, "right")
|
416
|
+
|
417
|
+
//
|
418
|
+
//--------------------------------------------------------
|
419
|
+
// Float Inputs
|
420
|
+
//--------------------------------------------------------
|
421
|
+
//
|
422
|
+
=float-inputs($margin_right: 10px, $line_height: 150%)
|
423
|
+
.radio, .check_boxes
|
424
|
+
ol
|
425
|
+
+inline("left")
|
426
|
+
li
|
427
|
+
width: auto
|
428
|
+
+inline("left", "none")
|
429
|
+
input
|
430
|
+
float: none
|
431
|
+
display: inline
|
432
|
+
label
|
433
|
+
display: block
|
434
|
+
clear: none
|
435
|
+
width: auto
|
436
|
+
padding-left: 0
|
437
|
+
line-height: $line_height
|
438
|
+
margin-right: $margin_right
|
439
|
+
|
440
|
+
//
|
441
|
+
=float-inputs-for($dom_target, $margin_right: 10px, $line_height: 150%)
|
442
|
+
#{$dom_target}
|
443
|
+
+float-inputs-core($margin_right, $line_height)
|
444
|
+
|
445
|
+
//
|
446
|
+
//--------------------------------------------------------
|
447
|
+
// Grid Inputs
|
448
|
+
//--------------------------------------------------------
|
449
|
+
//
|
450
|
+
=grid-inputs($width: 100px, $line_height: 150%)
|
451
|
+
.radio, .check_boxes
|
452
|
+
ol
|
453
|
+
+inline("left")
|
454
|
+
li
|
455
|
+
+inline("left", "none")
|
456
|
+
width: $width
|
457
|
+
label
|
458
|
+
+inline("left", "none")
|
459
|
+
width: auto
|
460
|
+
line-height: $line_height
|
461
|
+
|
462
|
+
=grid-inputs-for($dom_target, $width: 100px, $line_height: 150%)
|
463
|
+
#{$dom_target}
|
464
|
+
+grid-inputs-core($width, $line_height)
|
465
|
+
|
466
|
+
//--------------------------------------------------------
|
467
|
+
// Labels
|
468
|
+
//--------------------------------------------------------
|
469
|
+
=bold-labels($select: all)
|
470
|
+
li
|
471
|
+
@if $select == "all"
|
472
|
+
label, legend span.label
|
473
|
+
font-weight: bold
|
474
|
+
li
|
475
|
+
label
|
476
|
+
font-weight: normal
|
477
|
+
@if $select == "required"
|
478
|
+
&.required
|
479
|
+
label, .label
|
480
|
+
font-weight: bold
|
481
|
+
li
|
482
|
+
label
|
483
|
+
font-weight: normal
|
484
|
+
|
485
|
+
//---------------------------------------------------
|
486
|
+
// Original Mixin (deprecated!)
|
487
|
+
//
|
488
|
+
$form_layout: float
|
489
|
+
|
490
|
+
// Set the general layout of the form
|
491
|
+
// "float" will use two column layout with labels on the left
|
492
|
+
// "clear" will have labels above the inputs
|
493
|
+
|
494
|
+
//
|
495
|
+
$total_width: 100%
|
496
|
+
|
497
|
+
// Set width of entire fieldset
|
498
|
+
//
|
499
|
+
// Set label widths and hint/error left margins
|
500
|
+
$label_width: 24%
|
501
|
+
|
502
|
+
//
|
503
|
+
$input_width: 70%
|
504
|
+
|
505
|
+
// Set width of inputs, textareas and selects
|
506
|
+
//
|
507
|
+
$label_pad: 2%
|
508
|
+
|
509
|
+
// Set horizontal padding for labels
|
510
|
+
|
511
|
+
//
|
512
|
+
$label_float: left
|
513
|
+
|
514
|
+
// Set alignment of labels
|
515
|
+
// "clear" puts labels above inputs
|
516
|
+
// "left" floats labels left and aligns text left
|
517
|
+
// "right" floats labels left and aligns text right
|
518
|
+
|
519
|
+
//
|
520
|
+
// Set widths of all inputs, textareas and selects (all aligned)
|
521
|
+
// False will preserve auto width
|
522
|
+
$full_width_inputs: true
|
523
|
+
|
524
|
+
//
|
525
|
+
// Set float direction of form buttons ("right" or "left")
|
526
|
+
$button_float: left
|
527
|
+
|
528
|
+
// Installation ------------------------------------------
|
529
|
+
//
|
530
|
+
//$ sudo gem install haml
|
531
|
+
//$ cd rails app
|
532
|
+
//$ haml --rails (or merb/sinatra/etc)
|
533
|
+
//
|
534
|
+
// Set up master Sass file and include it in your html
|
535
|
+
// Save this file as _base.sass and include it in master sass like so:
|
536
|
+
//
|
537
|
+
// @import base.sass
|
538
|
+
//
|
539
|
+
// Usage -------------------------------------------------
|
540
|
+
//
|
541
|
+
// form.formtastic
|
542
|
+
// +formtastic-float
|
543
|
+
//
|
544
|
+
// This will provide forms of columns with label floated left
|
545
|
+
// For label on top of inputs you can use
|
546
|
+
//
|
547
|
+
// form.formtastic
|
548
|
+
// +formtastic-block
|
549
|
+
//
|
550
|
+
// Customize ---------------------------------------------
|
551
|
+
//
|
552
|
+
// form.formtastic
|
553
|
+
// +formtastic(410px,100px,300px,12px,"right",true)
|
554
|
+
//
|
555
|
+
// Note: When using pixel values be sure to pad total width by 10px
|
556
|
+
// Still looking for a way to make this cleaner
|
557
|
+
//--------------------------------------------------------
|
558
|
+
=formtastic($total_width, $label_width, $input_width, $label_pad, $label_float, $button_float, $full_width_inputs)
|
559
|
+
fieldset
|
560
|
+
width: $total_width
|
561
|
+
ol li
|
562
|
+
label
|
563
|
+
@if $label_float == "clear"
|
564
|
+
display: block
|
565
|
+
clear: both
|
566
|
+
float: none
|
567
|
+
@else
|
568
|
+
float: left
|
569
|
+
width: $label_width - $label_pad
|
570
|
+
@if $label_float == "left"
|
571
|
+
padding-left: $label_pad
|
572
|
+
text-align: left
|
573
|
+
@else
|
574
|
+
text-align: right
|
575
|
+
fieldset
|
576
|
+
legend
|
577
|
+
@if $label_float == "clear"
|
578
|
+
display: block
|
579
|
+
clear: both
|
580
|
+
float: none
|
581
|
+
span.label
|
582
|
+
display: block
|
583
|
+
clear: both
|
584
|
+
float: none
|
585
|
+
@else
|
586
|
+
width: $label_width - $label_pad
|
587
|
+
@if $label_float == "left"
|
588
|
+
padding-left: $label_pad
|
589
|
+
@else
|
590
|
+
padding-right: $label_pad
|
591
|
+
text-align: right
|
592
|
+
span.label
|
593
|
+
position: absolute
|
594
|
+
width: $label_width - $label_pad
|
595
|
+
ol
|
596
|
+
@if $label_float == "clear"
|
597
|
+
padding: 0
|
598
|
+
@else
|
599
|
+
padding: 0 $total_width - ($input_width + $label_width) 0 $label_width
|
600
|
+
@if $label_float == "clear"
|
601
|
+
&.string input, &.password input, &.numeric input, &.text textarea, select
|
602
|
+
width: $input_width
|
603
|
+
@else
|
604
|
+
p.inline-hints, p.inline-errors, ul.errors
|
605
|
+
margin: 0 0 0 $label_width
|
606
|
+
@if $full_width_inputs
|
607
|
+
&.string input, &.password input, &.numeric input, &.text textarea, select
|
608
|
+
width: $input_width
|
609
|
+
&.boolean label
|
610
|
+
padding-left: $label_width
|
611
|
+
fieldset
|
612
|
+
&.buttons
|
613
|
+
@if $label_float == "clear"
|
614
|
+
width: $total_width
|
615
|
+
@else
|
616
|
+
padding-left: $label_width
|
617
|
+
width: $input_width
|
618
|
+
@if $button_float == "left"
|
619
|
+
ol
|
620
|
+
li
|
621
|
+
display: inline
|
622
|
+
width: auto
|
623
|
+
float: left
|
624
|
+
@if $button_float == "right"
|
625
|
+
ol
|
626
|
+
padding-left: 0
|
627
|
+
@if $label_float == "clear"
|
628
|
+
width: $input_width
|
629
|
+
li
|
630
|
+
float: right
|
631
|
+
width: auto
|
632
|
+
@if $label_float != "clear"
|
633
|
+
padding-left: $label_pad
|
634
|
+
|
635
|
+
//--------------------------------------------------------
|
636
|
+
// Formtastic Errors on top (aligned with label)
|
637
|
+
//
|
638
|
+
// Create formtastic.rb in config/initializers and add this:
|
639
|
+
// Formtastic::SemanticFormBuilder.inline_order = [:errors, :input, :hints]
|
640
|
+
// Best used with right-aligned labels
|
641
|
+
// +formtastic(100%,20%,70%,4%,"right")
|
642
|
+
//--------------------------------------------------------
|
643
|
+
=formtastic-errors-on-top($label_vertical_margin: 21px)
|
644
|
+
ol li.error
|
645
|
+
p.inline-errors
|
646
|
+
margin-top: 0px
|
647
|
+
label, span.label
|
648
|
+
margin-top: unquote("-#{$label_vertical_margin}")
|
649
|
+
padding-bottom: 18px
|
650
|
+
fieldset label
|
651
|
+
margin-top: 0
|
652
|
+
padding-bottom: 0
|