diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 45c6beb..8c93fee 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,4 +7,12 @@ module ApplicationHelper end link_to(name, '#', id: "add_#{association.to_s.singularize}" , class: "add_fields", data: {id: id, fields: fields.gsub("\n", "")}) end + + def link_to_dashboard + content_tag :p do + content_tag :a, href: root_path, class: 'btn btn-default', title: 'Back to dashboard' do + content_tag :span, '', class: 'glyphicon glyphicon-home' + end + end + end end diff --git a/app/views/bikes/new.html.haml b/app/views/bikes/new.html.haml index eb652a9..663fb90 100644 --- a/app/views/bikes/new.html.haml +++ b/app/views/bikes/new.html.haml @@ -1,5 +1,5 @@ -%a{ class: "btn btn-default btn-lg", href: root_path} - %span{ class:"icon-home"} += link_to_dashboard + %h2 Add Bike %p diff --git a/app/views/bikes/show.html.haml b/app/views/bikes/show.html.haml index ca71f7d..32dd4ce 100644 --- a/app/views/bikes/show.html.haml +++ b/app/views/bikes/show.html.haml @@ -2,8 +2,8 @@ %p %a{class: "btn btn-lg btn-block btn-info", href: new_bike_path} Add Another Bike? -%a{ class: "btn btn-default btn-lg", href: root_path} - %span{ class:"icon-home"} += link_to_dashboard + %h2 #{@bike.shop_id}: #{@bike.bike_brand} %h2 #{@bike.model} diff --git a/app/views/task_lists/edit.haml b/app/views/task_lists/edit.haml index bc5a409..ff65425 100644 --- a/app/views/task_lists/edit.haml +++ b/app/views/task_lists/edit.haml @@ -1,5 +1,5 @@ -%a{ class: "btn btn-default btn-lg", href: root_path} - %span{ class:"icon-home"} += link_to_dashboard + %h2 Task List %h3 %a{ href: bike_path(@task_list.item)}#{@task_list.item.shop_id} #{@task_list.item.bike_brand} diff --git a/app/views/time_entries/index.haml b/app/views/time_entries/index.haml index 1875d17..2587783 100644 --- a/app/views/time_entries/index.haml +++ b/app/views/time_entries/index.haml @@ -1,5 +1,5 @@ -%a{ class: "btn btn-default btn-lg", href: root_path} - %span{ class:"icon-home"} += link_to_dashboard + %h2 Your Timesheet %dl.dl-horizontal diff --git a/app/views/time_entries/new.haml b/app/views/time_entries/new.haml index 49a4eeb..d7e95b3 100644 --- a/app/views/time_entries/new.haml +++ b/app/views/time_entries/new.haml @@ -1,42 +1,50 @@ -%a{ class: "btn btn-default btn-lg", href: root_path} - %span{ class:"icon-home"} -%h2 Add Time Entry - -%p - .control-group - .controls - %input{id: "date_id", placeholder: "Date", type: "text", class: "datepicker input-small" } - .help-block - .control-group - .controls{ class: "bootstrap-timepicker"} - %label Start - %input{id: "start_time_id", placeholder: "Time ID", type: "text", class: "input-small" } - .hidden{ id: "start_date" } - .help-block - .control-group - .controls - %label End - %input{id: "end_time_id", placeholder: "Time ID", type: "text", class: "input-small" } - .hidden{ id: "end_date" } - .help-block - .control-group - .controls - .btn-group{ "data-toggle" => "buttons-radio"} - %label{ class: "btn btn-default"} - %input{ type: "radio", name: "action_id", value: 1} Volunteer - %label{ class: "btn btn-default"} - %input{ type: "radio", name: "action_id", value: 2} Personal - %label{ class: "btn btn-default"} - %input{ type: "radio", name: "action_id", value: 3} Staff - .hidden{ id: "log_action_id" } - .help-block - .control-group - .controls - %label - = select_tag(:bike_id, options_for_select(@bikes)) - .control-group - .controls - %textarea{id: "description_id", placeholder: "Work description", class: "input-lg" } - .control-group - .controls - %input{id: "add_time_entry_submit", value: "Add Time Entry", type: "button", class: "btn btn-lg btn-block btn-primary", "data-url" => "#{api_create_time_entry_path}", "data-forward" => "#{"."}"} += link_to_dashboard + +%h1 Add Time Entry + +.row + .col-xs-12.col-sm-6.col-lg-4 + %fieldset + .form-group.form-inline + = text_field_tag '', '', id: 'date_id', placeholder: 'Date', class: 'form-control datepicker', size: 12 + .help-block + + .form-group.bootstrap-timepicker.form-inline + .form-group + %label.visible-xs Start time + = text_field_tag '', '', id: 'start_time_id', placeholder: 'Start time', class: 'form-control', size: 8 + .hidden#start_date + .help-block + + .form-group.hidden-xs + — + + .form-group + %label.visible-xs End time + = text_field_tag '', '', id: 'end_time_id', placeholder: 'End time', class: 'form-control', size: 8 + .hidden#end_date + .help-block + + .form-group + .btn-group{"data-toggle": 'buttons'} + %label{class: 'btn btn-default'} + = radio_button_tag 'action_id', 1, false, autocomplete: 'off' + Volunteer + %label{class: 'btn btn-default'} + = radio_button_tag 'action_id', 2, false, autocomplete: 'off' + Personal + %label{class: 'btn btn-default'} + = radio_button_tag 'action_id', 3, false, autocomplete: 'off' + Staff + .hidden#log_action_id + .help-block + + .form-group + = select_tag :bike_id, options_for_select(@bikes), class: 'form-control' + + .form-group + = text_area_tag '', '', id: 'description_id', placeholder: 'Work description', class: 'form-control', rows: 5 + + .control-group + .controls + = button_tag 'Add Time Entry', id: 'add_time_entry_submit', class: 'btn btn-primary', data: {url: "#{api_create_time_entry_path}", forward: "#{"."}"}