Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Fix form controls on attendance report.
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Jul 25, 2014
1 parent fb3a97b commit 7c3f5e6
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions app/views/administration/attendance/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,24 @@
.box.box-info.hidden-print
.box-heading
.box-body
.form-group
= label_tag :attended_at, t('attendance.date')
= date_field_tag :attended_at, @attended_at.to_s(:date), class: 'form-control'
- if @groups.any?
= form_tag administration_attendance_index_path, method: :get do
.form-group
= label_tag :group_name, t('attendance.group')
= select_tag :group_name, options_for_select(['']) + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), onchange: "location.href='?attended_at='+encodeURIComponent($('#attended_at').val())+'&group_id='+this.value", class: 'form-control'

%p
= form_tag administration_attendance_index_path, method: :get, class: 'form-inline' do
= hidden_field_tag :attended_at, @attended_at
= label_tag :person_name, t('attendance.search_person')
.input-group
= text_field_tag :person_name, params[:person_name], class: 'form-control'
%span.input-group-btn
- if params[:person_name]
= link_to administration_attendance_index_path(attended_at: @attended_at), class: 'btn btn-danger' do
= icon 'fa fa-times-circle'
= button_tag class: 'btn btn-info' do
= icon 'fa fa-search'
= label_tag :attended_at, t('attendance.date')
= date_field_tag :attended_at, @attended_at.to_s(:date), class: 'form-control', onchange: 'this.form.submit()'
- if @groups.any?
.form-group
= label_tag :group_id, t('attendance.group')
= select_tag :group_id, options_for_select(['']) + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), onchange: 'this.form.submit()', class: 'form-control'
.form-group
= label_tag :person_name, t('attendance.search_person')
.input-group
= text_field_tag :person_name, params[:person_name], class: 'form-control'
%span.input-group-btn
- if params[:person_name]
= link_to administration_attendance_index_path(attended_at: @attended_at, group_id: params[:group_id]), class: 'btn btn-danger' do
= icon 'fa fa-times-circle'
= button_tag class: 'btn btn-info' do
= icon 'fa fa-search'
- if @records.any?
%p
= link_to administration_attendance_index_path(format: 'csv', attended_at: @attended_at, group_id: params[:group_id], person_name: params[:person_name]), class: 'btn btn-info' do
Expand Down

0 comments on commit 7c3f5e6

Please sign in to comment.