From 3d52e139b13ad077286f2f9f46b7e98f43ad9564 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Sat, 20 Feb 2016 11:59:59 -0200 Subject: Rename Tasks to Todos --- app/views/dashboard/tasks/_task.html.haml | 21 ----------- app/views/dashboard/tasks/index.html.haml | 58 ------------------------------- app/views/dashboard/todos/_todo.html.haml | 21 +++++++++++ app/views/dashboard/todos/index.html.haml | 58 +++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 app/views/dashboard/tasks/_task.html.haml delete mode 100644 app/views/dashboard/tasks/index.html.haml create mode 100644 app/views/dashboard/todos/_todo.html.haml create mode 100644 app/views/dashboard/todos/index.html.haml (limited to 'app/views/dashboard') diff --git a/app/views/dashboard/tasks/_task.html.haml b/app/views/dashboard/tasks/_task.html.haml deleted file mode 100644 index 164a53dd928..00000000000 --- a/app/views/dashboard/tasks/_task.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -%li{class: "task task-#{task.done? ? 'done' : 'pending'}", id: dom_id(task) } - .task-item{class: 'task-block'} - = image_tag avatar_icon(task.author_email, 40), class: 'avatar s40', alt:'' - - .task-title - %span.author_name - = link_to_author task - %span.task_label - = task_action_name(task) - = task_target_link_html(task) - - · #{time_ago_with_tooltip(task.created_at)} - - - if task.pending? - .task-actions.pull-right - = link_to 'Done', [:dashboard, task], method: :delete, class: 'btn' - - .task-body - .task-note - .md - = event_note(task.body, project: task.project) diff --git a/app/views/dashboard/tasks/index.html.haml b/app/views/dashboard/tasks/index.html.haml deleted file mode 100644 index 4b6e3d83e62..00000000000 --- a/app/views/dashboard/tasks/index.html.haml +++ /dev/null @@ -1,58 +0,0 @@ -- page_title "Tasks" -- header_title "Tasks", dashboard_tasks_path - -.top-area - %ul.nav-links - %li{class: ('active' if params[:state].blank? || params[:state] == 'pending')} - = link_to page_filter_path(state: 'pending') do - %span - Tasks - %span{class: 'badge'} - = tasks_pending_count - %li{class: ('active' if params[:state] == 'done')} - = link_to page_filter_path(state: 'done') do - %span - Done - %span{class: 'badge'} - = tasks_done_count - -.tasks-filters - .gray-content-block.second-block - = form_tag page_filter_path(without: [:assignee_id, :milestone_title, :label_name, :scope, :sort]), method: :get, class: 'filter-form' do - .filter-item.inline - = select_tag('project_id', task_projects_options, - class: 'select2 trigger-submit', include_blank: true, - data: {placeholder: '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) - .filter-item.inline - = select_tag('type', task_types_options, - class: 'select2 trigger-submit', include_blank: true, - data: {placeholder: 'Type'}) - .filter-item.inline.actions-filter - = select_tag('action_id', task_actions_options, - class: 'select2 trigger-submit', include_blank: true, - data: {placeholder: 'Action'}) - -.prepend-top-default - - if @tasks.any? - - @tasks.group_by(&:project).each do |group| - .panel.panel-default.panel-small - - project = group[0] - .panel-heading - = link_to project.name_with_namespace, namespace_project_path(project.namespace, project) - - %ul.well-list.tasks-list - = render group[1] - = paginate @tasks, theme: "gitlab" - - else - .nothing-here-block No tasks to show - -:javascript - new UsersSelect(); - - $('form.filter-form').on('submit', function (event) { - event.preventDefault(); - Turbolinks.visit(this.action + '&' + $(this).serialize()); - }); diff --git a/app/views/dashboard/todos/_todo.html.haml b/app/views/dashboard/todos/_todo.html.haml new file mode 100644 index 00000000000..7de703e304f --- /dev/null +++ b/app/views/dashboard/todos/_todo.html.haml @@ -0,0 +1,21 @@ +%li{class: "todo todo-#{todo.done? ? 'done' : 'pending'}", id: dom_id(todo) } + .todo-item{class: 'todo-block'} + = image_tag avatar_icon(todo.author_email, 40), class: 'avatar s40', alt:'' + + .todo-title + %span.author_name + = link_to_author todo + %span.todo_label + = todo_action_name(todo) + = todo_target_link_html(todo) + + · #{time_ago_with_tooltip(todo.created_at)} + + - if todo.pending? + .todo-actions.pull-right + = link_to 'Done', [:dashboard, todo], method: :delete, class: 'btn' + + .todo-body + .todo-note + .md + = event_note(todo.body, project: todo.project) diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml new file mode 100644 index 00000000000..a91f8f24f8c --- /dev/null +++ b/app/views/dashboard/todos/index.html.haml @@ -0,0 +1,58 @@ +- page_title "Todos" +- header_title "Todos", dashboard_todos_path + +.top-area + %ul.nav-links + %li{class: ('active' if params[:state].blank? || params[:state] == 'pending')} + = link_to page_filter_path(state: 'pending') do + %span + Todos + %span{class: 'badge'} + = todos_pending_count + %li{class: ('active' if params[:state] == 'done')} + = link_to page_filter_path(state: 'done') do + %span + Done + %span{class: 'badge'} + = todos_done_count + +.todos-filters + .gray-content-block.second-block + = form_tag page_filter_path(without: [:assignee_id, :milestone_title, :label_name, :scope, :sort]), 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'}) + .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) + .filter-item.inline + = 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'}) + +.prepend-top-default + - if @todos.any? + - @todos.group_by(&:project).each do |group| + .panel.panel-default.panel-small + - project = group[0] + .panel-heading + = link_to project.name_with_namespace, namespace_project_path(project.namespace, project) + + %ul.well-list.todos-list + = render group[1] + = paginate @todos, theme: "gitlab" + - else + .nothing-here-block No todos to show + +:javascript + new UsersSelect(); + + $('form.filter-form').on('submit', function (event) { + event.preventDefault(); + Turbolinks.visit(this.action + '&' + $(this).serialize()); + }); -- cgit v1.2.1