Skip to content

Commit f21f1d3

Browse files
committed
fixes #2
1 parent 29f7c29 commit f21f1d3

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ root :to => 'welcome#index', :as => 'home'
1717
root :to => 'dashboard#index', :as => 'home'
1818
```
1919

20-
![Alt text](/screenshots/screen1.png)
21-
![Alt text](/screenshots/screen2.png)
20+
![Alt text](screenshots/screen1.png)
21+
![Alt text](screenshots/screen2.png)

app/views/dashboard/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</div>
1313
<div class="status_column_issues">
1414
<% status["issues"].each do |issue| %>
15-
<div dragable class="issue_card" data-id="<%= issue['id'] %>" onclick="goToIssue(<%= issue['id'] %>)">
15+
<div draggable="true" class="issue_card" data-status="<%= status['id'] %>" data-id="<%= issue['id'] %>" onclick="goToIssue(<%= issue['id'] %>)">
1616
<span class="issue_card_title"> <%= issue["subject"] %> </span>
1717
<span class="issue_card_author"><i class="bi bi-person"></i> <%= issue["author"] %> </span>
1818
<% if issue["executor"] == '' || issue["executor"].nil? %>
@@ -25,4 +25,4 @@
2525
</div>
2626
</div>
2727
<% end %>
28-
</div>
28+
</div>

assets/javascripts/script.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
function getUriWithoutDashboard() {
2+
const reg = new RegExp('((?<=.+)\/dashboard$|\/$)');
3+
let baseUri = location.pathname;
4+
5+
if (baseUri.match(reg)!= null) {
6+
baseUri = baseUri.replace(reg, '');
7+
}
8+
9+
return baseUri;
10+
}
11+
112
function goToIssue(id) {
2-
location.pathname = `${location.pathname}/issues/${id}`;
13+
const baseUri = getUriWithoutDashboard();
14+
location.pathname = `${baseUri}/issues/${id}`;
315
}

assets/stylesheets/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
display: flex;
2020
border-top-left-radius: 5px;
2121
border-top-right-radius: 5px;
22-
background-color: lightgreen;
22+
background-color: rgb(169, 144, 238);
2323
width: 100%;
2424
height: 50px;
2525
align-items: center;
@@ -40,7 +40,7 @@
4040

4141
.issue_card {
4242
display: flex;
43-
width: 95%;
43+
width: 96%;
4444
border-radius: 5px;
4545
height: auto;
4646
min-height: 50px;

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name 'Dashboard'
33
author "Akpaev E.A."
44
description "Plugin adds an issues dashboard to the application"
5-
version '1.0.1'
5+
version '1.0.2'
66
url 'https://github.com/akpaevj/Dashboard'
77
author_url 'https://github.com/akpaevj'
88
menu :top_menu, :dashboard, { controller: 'dashboard', action: 'index' }, caption: :top_menu_item_title, first: true

0 commit comments

Comments
 (0)