Skip to content

Commit

Permalink
fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
akpaevj committed May 16, 2021
1 parent 29f7c29 commit f21f1d3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ root :to => 'welcome#index', :as => 'home'
root :to => 'dashboard#index', :as => 'home'
```

![Alt text](/screenshots/screen1.png)
![Alt text](/screenshots/screen2.png)
![Alt text](screenshots/screen1.png)
![Alt text](screenshots/screen2.png)
4 changes: 2 additions & 2 deletions app/views/dashboard/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
<div class="status_column_issues">
<% status["issues"].each do |issue| %>
<div dragable class="issue_card" data-id="<%= issue['id'] %>" onclick="goToIssue(<%= issue['id'] %>)">
<div draggable="true" class="issue_card" data-status="<%= status['id'] %>" data-id="<%= issue['id'] %>" onclick="goToIssue(<%= issue['id'] %>)">
<span class="issue_card_title"> <%= issue["subject"] %> </span>
<span class="issue_card_author"><i class="bi bi-person"></i> <%= issue["author"] %> </span>
<% if issue["executor"] == '' || issue["executor"].nil? %>
Expand All @@ -25,4 +25,4 @@
</div>
</div>
<% end %>
</div>
</div>
14 changes: 13 additions & 1 deletion assets/javascripts/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
function getUriWithoutDashboard() {
const reg = new RegExp('((?<=.+)\/dashboard$|\/$)');
let baseUri = location.pathname;

if (baseUri.match(reg)!= null) {
baseUri = baseUri.replace(reg, '');
}

return baseUri;
}

function goToIssue(id) {
location.pathname = `${location.pathname}/issues/${id}`;
const baseUri = getUriWithoutDashboard();
location.pathname = `${baseUri}/issues/${id}`;
}
4 changes: 2 additions & 2 deletions assets/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
display: flex;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
background-color: lightgreen;
background-color: rgb(169, 144, 238);
width: 100%;
height: 50px;
align-items: center;
Expand All @@ -40,7 +40,7 @@

.issue_card {
display: flex;
width: 95%;
width: 96%;
border-radius: 5px;
height: auto;
min-height: 50px;
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name 'Dashboard'
author "Akpaev E.A."
description "Plugin adds an issues dashboard to the application"
version '1.0.1'
version '1.0.2'
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
Expand Down

0 comments on commit f21f1d3

Please sign in to comment.