diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 0832a97..9c45e93 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -30,6 +30,7 @@ def getProjects(selected_project_id = -1) projects.push({ "id" => project.id, "name" => project.name, + "color" => Setting.plugin_dashboard["project_color_" + project.id.to_s], "selected" => selected }) end @@ -52,6 +53,9 @@ def getData(project_id = -1) "id" => issue.id, "subject" => issue.subject, "status_id" => issue.status.id, + "project" => issue.project.name, + "project_id" => issue.project.id, + "created_at" => issue.start_date, "author" => issue.author.name(User::USER_FORMATS[:firstname_lastname]), "executor" => executor }) diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index eb604a5..8cb88f2 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -21,6 +21,10 @@
<% status["issues"].each do |issue| %>
+
+ <%= issue["created_at"] %> +
<%= issue["project"] %>
+
<%= issue["subject"] %> <%= issue["author"] %> <% if issue["executor"] == '' || issue["executor"].nil? %> diff --git a/app/views/settings/_dashboard_settings.erb b/app/views/settings/_dashboard_settings.erb index 547cf81..892f978 100644 --- a/app/views/settings/_dashboard_settings.erb +++ b/app/views/settings/_dashboard_settings.erb @@ -1,10 +1,8 @@ - - - - + + <% IssueStatus.sorted().each do |status| %> <% if !status.is_closed %> <% property_name = "status_color_" + status.id.to_s %> @@ -15,6 +13,18 @@ <% end %> + <% end %> + + + <% Project.all.each do |project| %> + <% property_name = "project_color_" + project.id.to_s %> + + + <% end %>
<%=l :settings_header %> -
<%=l :settings_header_statuses %> +
<%=l :settings_header_projects %> +
<%= project.name %> + + +
\ No newline at end of file diff --git a/assets/stylesheets/style.css b/assets/stylesheets/style.css index 0011736..a2a859e 100644 --- a/assets/stylesheets/style.css +++ b/assets/stylesheets/style.css @@ -97,4 +97,22 @@ .select_project { margin-left: 10px; +} + +.issue_card_header { + display: flex; + padding-top: 5px; + align-items: center; + width: 100%; +} + +.issue_card_header_project { + margin-left: auto; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 8px; + padding-right: 8px; + margin-right: 10px; + border-radius: 15px; + color: white; } \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index d98ab61..ac7d6cf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,5 +1,6 @@ en: top_menu_item_title: "Dashboard" - settings_header: "Colors of the status column header" + settings_header_statuses: "Colors of the status column header" + settings_header_projects: "Project colors" executor_not_set: "Not set" label_all: "All" \ No newline at end of file diff --git a/config/locales/ru.yml b/config/locales/ru.yml index ca80dd5..a00fc54 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,5 +1,6 @@ ru: top_menu_item_title: "Панель задач" - settings_header: "Цвета заголовков колонок статусов" + settings_header_statuses: "Цвета заголовков колонок статусов" + settings_header_projects: "Цвета проектов" executor_not_set: "Не установлен" label_all: "Все" \ No newline at end of file diff --git a/init.rb b/init.rb index ceb8fa1..741e29f 100644 --- a/init.rb +++ b/init.rb @@ -2,7 +2,7 @@ name 'Dashboard' author "Akpaev E.A." description "Plugin adds an issues dashboard to the application" - version '1.0.3' + version '1.0.4' url 'https://github.com/akpaevj/Dashboard' author_url 'https://github.com/akpaevj' menu :top_menu, :dashboard, { controller: 'dashboard', action: 'index' }, caption: :top_menu_item_title, first: true