Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature Display only issues in "open" status projects #55

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def index
@show_project_badge = @selected_project_id == -1 || @selected_project_id != -1 && show_sub_tasks
@use_drag_and_drop = Setting.plugin_dashboard['enable_drag_and_drop']
@display_minimized_closed_issue_cards = Setting.plugin_dashboard['display_closed_statuses'] ? Setting.plugin_dashboard['display_minimized_closed_issue_cards'] : false
@display_open_projects_only = Setting.plugin_dashboard['display_open_projects_only'] ? Setting.plugin_dashboard['display_open_projects_only'] : false
@statuses = get_statuses
@projects = get_projects
@issues = get_issues(@selected_project_id, show_sub_tasks)
Expand Down Expand Up @@ -47,14 +48,18 @@ def get_statuses
def get_projects
data = {-1 => {
:name => l(:label_all),
:color => '#4ec7ff'
:color => '#4ec7ff',
:status => 0
}}

Project.visible.each do |item|
projcets = Setting.plugin_dashboard['display_open_projects_only'] ? Project.visible.where(:projects => {:status => 1}) : Project.visible

projcets.each do |item|
data[item.id] = {
:name => item.name,
:color => Setting.plugin_dashboard["project_color_" + item.id.to_s]
}
:color => Setting.plugin_dashboard["project_color_" + item.id.to_s],
:status => item.status
}
end
data
end
Expand All @@ -78,9 +83,11 @@ def get_issues(project_id, with_sub_tasks)
project = Project.find(project_id)
add_children_ids(id_array, project)
end

items = id_array.empty? ? Issue.visible : Issue.visible.where(:projects => {:id => id_array})


items = id_array.empty? ? Issue.visible: Issue.visible.where(:projects => {:id => id_array})

items = Setting.plugin_dashboard['display_open_projects_only'] ? items.where(:projects => {:status => 1}) : items

unless Setting.plugin_dashboard['display_closed_statuses']
items = items.open
end
Expand Down
6 changes: 6 additions & 0 deletions app/views/settings/_dashboard_settings.erb
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,11 @@
<%= check_box_tag "settings[display_child_projects_tasks]", false, @settings['display_child_projects_tasks'] %>
</td>
</tr>
<tr>
<td> <%=l :settings_display_open_projects_only %> </th>
<td>
<%= check_box_tag "settings[display_open_projects_only]", false, @settings['display_open_projects_only'] %>
</td>
</tr>
</tbody>
</table>
7 changes: 4 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ en:
settings_header_statuses: "Statuses colors"
settings_header_projects: "Projects colors"
settings_header_other: "Other"
settings_use_drop_down_menu: 'Use drop-down menu for the project choosing'
settings_use_drop_down_menu: "Use drop-down menu for the project choosing"
settings_display_closed_statuses: 'Display "closed" statuses'
settings_display_child_projects_tasks: 'Display child projects tasks'
settings_display_child_projects_tasks: "Display child projects tasks"
settings_display_open_projects_only: 'Display only projects with status "open"'
settings_display_minimized_closed_issue_cards: 'Display minimized "closed" issue cards'
settings_enable_drag_and_drop: '"Drag and drop" status changing'
settings_generate_colors: "Generate colors"
executor_not_set: "Not set"
label_all: "All"
label_all: "All"
13 changes: 7 additions & 6 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ fr:
settings_header_statuses: "Couleurs des status"
settings_header_projects: "Couleurs des projets"
settings_header_other: "Autre"
settings_use_drop_down_menu: 'Utiliser le menu déroulant pour choisir le projet'
settings_display_closed_statuses: 'Afficher le status « closed »'
settings_display_child_projects_tasks: 'Afficher les tâches de sous-projets'
settings_display_minimized_closed_issue_cards: 'Afficher les cartes « closed » en minimisé'
settings_enable_drag_and_drop: 'Changer de status par glisser-déposer'
settings_use_drop_down_menu: "Utiliser le menu déroulant pour choisir le projet"
settings_display_closed_statuses: "Afficher le status « closed »"
settings_display_child_projects_tasks: "Afficher les tâches de sous-projets"
settings_display_open_projects_only: "Afficher uniquement les projets avec le statut « ouvert »"
settings_display_minimized_closed_issue_cards: "Afficher les cartes « closed » en minimisé"
settings_enable_drag_and_drop: "Changer de status par glisser-déposer"
settings_generate_colors: "Générer les couleurs"
executor_not_set: "Pas encore défini"
label_all: "Tous"
label_all: "Tous"
9 changes: 5 additions & 4 deletions config/locales/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ hr:
settings_header_statuses: "Boje statusa"
settings_header_projects: "Boje projekata"
settings_header_other: "Ostale postavke"
settings_use_drop_down_menu: 'Koristi padajući izbornik za odabir projekata'
settings_display_closed_statuses: 'Prikaži zatvorene predmete'
settings_display_child_projects_tasks: 'Prikaži ugniježdene predmete'
settings_display_minimized_closed_issue_cards: 'Prikaži zatvorene predmete minimizirane'
settings_use_drop_down_menu: "Koristi padajući izbornik za odabir projekata"
settings_display_closed_statuses: "Prikaži zatvorene predmete"
settings_display_child_projects_tasks: "Prikaži ugniježdene predmete"
settings_display_open_projects_only: 'Prikaži samo projekte sa statusom "otvoreno"'
settings_display_minimized_closed_issue_cards: "Prikaži zatvorene predmete minimizirane"
settings_enable_drag_and_drop: 'Dozvoli "Drag and drop" izmjenu statusa'
settings_generate_colors: "Generiraj boje"
executor_not_set: "Nije postavljen"
Expand Down
7 changes: 4 additions & 3 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ pl:
settings_header_statuses: "Kolory statusów"
settings_header_projects: "Kolory projektów"
settings_header_other: "Inne"
settings_use_drop_down_menu: 'Użycie menu typu drop-down do wyboru projektów'
settings_use_drop_down_menu: "Użycie menu typu drop-down do wyboru projektów"
settings_display_closed_statuses: 'Pokaż statusy z atrybutem "closed"'
settings_display_child_projects_tasks: 'Wyświetlaj zadania projektów podrzędnych'
settings_display_child_projects_tasks: "Wyświetlaj zadania projektów podrzędnych"
settings_display_open_projects_only: 'Wyświetlaj tylko projekty ze statusem "otwarte"'
settings_display_minimized_closed_issue_cards: 'Wyświetlaj karty zadań z atrybutem "closed" zminimalizowane'
settings_enable_drag_and_drop: 'Zmiana statusu poprzez "Drag and drop"'
settings_generate_colors: "Wygeneruj kolory"
executor_not_set: "Nie przydzielono"
label_all: "Wszystkie"
label_all: "Wszystkie"
7 changes: 4 additions & 3 deletions config/locales/pt_BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ pt_BR:
settings_header_statuses: "Cores das Situações"
settings_header_projects: "Cores dos Projetos"
settings_header_other: "Outro"
settings_use_drop_down_menu: 'Use um menu drop-down para escolha de projeto'
settings_use_drop_down_menu: "Use um menu drop-down para escolha de projeto"
settings_display_closed_statuses: 'Mostrar tarefas com situação "FECHADO"'
settings_display_child_projects_tasks: 'Mostrar tarefas filhas dos projetos'
settings_display_minimized_closed_issue_cards: 'Mostrar minizados os cartões de tarefas fechadas'
settings_display_child_projects_tasks: "Mostrar tarefas filhas dos projetos"
settings_display_open_projects_only: 'Exibir apenas projetos com status "aberto"'
settings_display_minimized_closed_issue_cards: "Mostrar minizados os cartões de tarefas fechadas"
settings_enable_drag_and_drop: 'Mudar situação com "Drag and drop"'
settings_generate_colors: "Gerar as cores"
executor_not_set: "Não definido"
Expand Down
7 changes: 4 additions & 3 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ ru:
settings_header_statuses: "Цвета статусов"
settings_header_projects: "Цвета проектов"
settings_header_other: "Разное"
settings_use_drop_down_menu: 'Использовать выпадающий список для выбора проекта'
settings_use_drop_down_menu: "Использовать выпадающий список для выбора проекта"
settings_display_closed_statuses: 'Отображать "закрытые" статусы'
settings_display_child_projects_tasks: 'Отображать задачи дочерних проектов'
settings_display_child_projects_tasks: "Отображать задачи дочерних проектов"
settings_display_open_projects_only: "Отображать только проекты со статусом «открыто»"
settings_display_minimized_closed_issue_cards: 'Отображать свернутые карточки "закрытых" задач'
settings_enable_drag_and_drop: '"Drag and drop" изменение статуса'
settings_generate_colors: "Сгенерировать цвета"
executor_not_set: "Не установлен"
label_all: "Все"
label_all: "Все"
7 changes: 4 additions & 3 deletions config/locales/sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ sv:
settings_header_statuses: "Statusfärger"
settings_header_projects: "Projektfärger"
settings_header_other: "Övrigt"
settings_use_drop_down_menu: 'Använd drop-down-meny för att välja projekt'
settings_use_drop_down_menu: "Använd drop-down-meny för att välja projekt"
settings_display_closed_statuses: 'Visa "stängda"'
settings_display_child_projects_tasks: 'Visa underprojekts uppgifter'
settings_display_child_projects_tasks: "Visa underprojekts uppgifter"
settings_display_open_projects_only: 'Visa endast projekt med status "öppen"'
settings_display_minimized_closed_issue_cards: 'Visa "stängda" kort minimerade'
settings_enable_drag_and_drop: '"Drag-och-Släpp" status-hantering'
settings_generate_colors: "Skapa färger"
executor_not_set: "Inte konfigurerat"
label_all: "Alla"
label_all: "Alla"
7 changes: 4 additions & 3 deletions config/locales/ua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ ua:
settings_header_statuses: "Кольори статусів"
settings_header_projects: "Кольори проектів"
settings_header_other: "Різне"
settings_use_drop_down_menu: 'Використовувати випадаючий список для вибору проекту'
settings_use_drop_down_menu: "Використовувати випадаючий список для вибору проекту"
settings_display_closed_statuses: 'Відображати "зачинені" статуси'
settings_display_child_projects_tasks: 'Відображати завдання дочірніх проектів'
settings_display_child_projects_tasks: "Відображати завдання дочірніх проектів"
settings_display_open_projects_only: 'Відображати лише проекти зі статусом "відкрито"'
settings_display_minimized_closed_issue_cards: 'Відображати згорнуті картки "закритих" завдань'
settings_enable_drag_and_drop: '"Drag and drop" зміна статусу'
settings_generate_colors: "Згенерувати кольори"
executor_not_set: "Не встановлений"
label_all: "Все"
label_all: "Все"