summaryrefslogtreecommitdiff
path: root/app/views/dashboard
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-08-28 16:24:48 +0100
committerLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-01 14:35:34 +0100
commit922b38a0bea8c5b8610120dfb5ea168db713f3e3 (patch)
tree3acd8626b10ab6b2072426dcce30b51b1a884be9 /app/views/dashboard
parentf157a9e5144fde90dc31add4006b9132e1489aa1 (diff)
downloadgitlab-ce-922b38a0bea8c5b8610120dfb5ea168db713f3e3.tar.gz
Removed inline JS and improved dropdown labels
Diffstat (limited to 'app/views/dashboard')
-rw-r--r--app/views/dashboard/todos/index.html.haml53
1 files changed, 4 insertions, 49 deletions
diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml
index 4a8536315a5..70dd4db6aaf 100644
--- a/app/views/dashboard/todos/index.html.haml
+++ b/app/views/dashboard/todos/index.html.haml
@@ -40,13 +40,13 @@
.filter-item.inline
- if params[:type].present?
= hidden_field_tag(:type, params[:type])
- = dropdown_tag(params[:type] || 'Type', options: { toggle_class: 'js-type-search js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-type js-filter-submit',
- data: { data: todo_types_options, selected: params[:type], field_name: 'type', default_label: 'Type' } })
+ = dropdown_tag(todo_types_dropdown_label(params[:type], 'Type'), options: { toggle_class: 'js-type-search js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-type js-filter-submit',
+ data: { data: todo_types_options } })
.filter-item.inline.actions-filter
- if params[:action_id].present?
= hidden_field_tag(:action_id, params[:action_id])
- = dropdown_tag(params[:action_id] || 'Action', options: { toggle_class: 'js-action-search js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-action js-filter-submit',
- data: { data: todo_actions_options, selected: params[:action_id], field_name: 'action_id', default_label: 'Action' } })
+ = dropdown_tag(todo_actions_dropdown_label(params[:action_id], 'Action'), options: { toggle_class: 'js-action-search js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-action js-filter-submit',
+ data: { data: todo_actions_options }})
.pull-right
.dropdown.inline.prepend-left-10
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
@@ -80,48 +80,3 @@
= paginate @todos, theme: "gitlab"
- else
.nothing-here-block You're all done!
-
-:javascript
- new UsersSelect();
-
- $projectDropdown = $('.js-project-search');
- $projectDropdown.glDropdown({
- filterable: true,
- selectable: true,
- fieldName: 'project_id',
- data: $projectDropdown.data('data'),
- clicked: function() {
- if ($projectDropdown.hasClass('js-filter-submit')) {
- return $projectDropdown.closest('form').submit();
- }
- }
- });
-
- $typeDropdown = $('.js-type-search');
- $typeDropdown.glDropdown({
- selectable: true,
- fieldName: 'type_id',
- data: $typeDropdown.data('data'),
- clicked: function() {
- if ($typeDropdown.hasClass('js-filter-submit')) {
- return $typeDropdown.closest('form').submit();
- }
- }
- });
-
- $actionDropdown = $('.js-action-search');
- $actionDropdown.glDropdown({
- selectable: true,
- fieldName: 'action_id',
- data: $actionDropdown.data('data'),
- clicked: function() {
- if ($actionDropdown.hasClass('js-filter-submit')) {
- return $actionDropdown.closest('form').submit();
- }
- }
- });
-
- $('form.filter-form').on('submit', function (event) {
- event.preventDefault();
- Turbolinks.visit(this.action + '&' + $(this).serialize());
- });