diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2016-08-28 01:45:01 +0300 |
---|---|---|
committer | Luke Bennett <lukeeeebennettplus@gmail.com> | 2016-09-01 16:35:34 +0300 |
commit | beff8b9bd077fea4bbcb09881396b57ba07f568e (patch) | |
tree | 7cf048714d16f75c3fafc9b5343f97fd76430038 /app/views/dashboard/todos/index.html.haml | |
parent | 433d8a10c1d1259a61e59a8368db08d7d6b58c62 (diff) |
Swapped out author dropdown and started on swapping out project dropdown
Diffstat (limited to 'app/views/dashboard/todos/index.html.haml')
-rw-r--r-- | app/views/dashboard/todos/index.html.haml | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml index 6bcc37042ea..42dc1fd0118 100644 --- a/app/views/dashboard/todos/index.html.haml +++ b/app/views/dashboard/todos/index.html.haml @@ -28,20 +28,23 @@ .row-content-block.second-block = form_tag todos_filter_path(without: [:project_id, :author_id, :type, :action_id]), method: :get, class: 'filter-form' do .filter-item.inline - = select_tag('project_id', todo_projects_options, - class: 'select2 trigger-submit', include_blank: true, - data: {placeholder: 'Project'}) + - if params[:project_id].present? + = hidden_field_tag(:project_id, params[:project_id]) + = dropdown_tag(project_dropdown_label(params[:project_id], 'Project'), options: { toggle_class: 'js-project-search js-filter-submit', title: 'Filter by project', filter: true, filterInput: 'input#search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit', + placeholder: 'Search projects', data: { data: todo_projects_options, selected: params[:project_id], field_name: 'project_id', default_label: 'Project' } }) .filter-item.inline - = users_select_tag(:author_id, selected: params[:author_id], - placeholder: 'Author', class: 'trigger-submit', any_user: "Any Author", first_user: true, current_user: true) + - if params[:author_id].present? + = hidden_field_tag(:author_id, params[:author_id]) + = dropdown_tag(user_dropdown_label(params[:author_id], 'Author'), options: { toggle_class: 'js-user-search js-filter-submit js-author-search', title: 'Filter by author', filter: true, filterInput: 'input#search', dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author js-filter-submit', + placeholder: 'Search authors', data: { any_user: 'Any Author', first_user: (current_user.username if current_user), current_user: true, project_id: (@project.id if @project), selected: params[:author_id], field_name: 'author_id', default_label: 'Author' } }) .filter-item.inline - = select_tag('type', todo_types_options, - class: 'select2 trigger-submit', include_blank: true, - data: {placeholder: 'Type'}) + -# = select_tag('type', todo_types_options, + -# class: 'select2 trigger-submit', include_blank: true, + -# data: {placeholder: 'Type'}) .filter-item.inline.actions-filter - = select_tag('action_id', todo_actions_options, - class: 'select2 trigger-submit', include_blank: true, - data: {placeholder: 'Action'}) + -# = select_tag('action_id', todo_actions_options, + -# class: 'select2 trigger-submit', include_blank: true, + -# data: {placeholder: 'Action'}) .pull-right .dropdown.inline.prepend-left-10 @@ -80,6 +83,14 @@ :javascript new UsersSelect(); + $projectDropdown = $('.js-project-search'); + $projectDropdown.glDropdown({ + filterable: true, + selectable: true, + fieldName: 'project_id', + data: $projectDropdown.data('data') + }); + $('form.filter-form').on('submit', function (event) { event.preventDefault(); Turbolinks.visit(this.action + '&' + $(this).serialize()); |