From e4189ee690de9e45e15712e699c574a7e9dc1a8a Mon Sep 17 00:00:00 2001 From: Josep Llaneras Date: Fri, 28 Oct 2016 22:50:54 +0200 Subject: Remove author --- app/controllers/dashboard/todos_controller.rb | 4 ---- app/helpers/todos_helper.rb | 11 ----------- app/views/dashboard/todos/index.html.haml | 4 ++-- config/no_todos_messages.yml | 15 ++++----------- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb index ca65f75daac..d425d0f9014 100644 --- a/app/controllers/dashboard/todos_controller.rb +++ b/app/controllers/dashboard/todos_controller.rb @@ -4,10 +4,6 @@ class Dashboard::TodosController < Dashboard::ApplicationController def index @sort = params[:sort] @todos = @todos.page(params[:page]) - - if @todos.empty? && current_user.todos.any? - @no_todos_message = Gitlab.config.gitlab.no_todos_messages.sample - end end def destroy diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index b7ca48ffa08..09c69786791 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -138,20 +138,9 @@ module TodosHelper end end - def no_todos_message - message, author = @no_todos_message.values_at('message', 'author') - - if author - message += " -- " + author - end - - message - end - private def show_todo_state?(todo) (todo.target.is_a?(MergeRequest) || todo.target.is_a?(Issue)) && ['closed', 'merged'].include?(todo.target.state) end - end diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml index 773645707d3..24811fc7a51 100644 --- a/app/views/dashboard/todos/index.html.haml +++ b/app/views/dashboard/todos/index.html.haml @@ -84,7 +84,7 @@ = render "shared/empty_states/todos_all_done.svg" - if todos_filter_empty? %h4.text-center - = no_todos_message + = Gitlab.config.gitlab.no_todos_messages.sample %p.text-center Are you looking for things to do? Take a look at = succeed "," do @@ -108,4 +108,4 @@ @mention in a comment, this will trigger a new item in your todo list, automatically. %p - You will always know what to work on next. + You will always know what to work on next. \ No newline at end of file diff --git a/config/no_todos_messages.yml b/config/no_todos_messages.yml index 92182d100e8..5aea70e4386 100644 --- a/config/no_todos_messages.yml +++ b/config/no_todos_messages.yml @@ -1,16 +1,9 @@ -# When the Todos list on the user's dashboard is empty, one of the messages below shows up randomly. +# When the Todos list on the user's dashboard becomes empty, one of the messages below shows up randomly. # # If you come up with a fun one, please feel free to contribute it to GitLab! # https://about.gitlab.com/contributing/ --- -- - message: "Good job! Looks like you don't have any todos left." -- - message: "You're all done!" -- - message: "Coffee really tastes better without any todos left." - author: "Josep Llaneras" -- - message: "Isn't an empty To Do list beautiful?" - author: "Josep Llaneras" +- Good job! Looks like you don't have any todos left. +- Coffee really tastes better without any todos left. +- Isn't an empty To Do list beautiful? \ No newline at end of file -- cgit v1.2.1