Skip to content

Report-preview #82

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

Open
wants to merge 1 commit into
base: master
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
44 changes: 44 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,90 @@ body {
* {
box-sizing: border-box;
}

.datepicker {
margin-bottom: 5px !important;
}

.tabs .tab a:hover,
.tabs .tab a.active {
background-color: transparent;
color: #3f51b5;
}

.tabs {
background-color: transparent;
}

.tabs .tab a {
color: #3f51b5;
}

.tabs .indicator {
background-color: #3f51b5;
}

.switch label input[type="checkbox"]:checked + .lever {
background-color: #3f51b5;
}

.switch label input[type="checkbox"]:checked + .lever:after {
background-color: #fcfcfc;
left: 24px;
}

[type="checkbox"].filled-in:checked + label:after {
border: 2px solid #3f51b5;
background-color: #3f51b5;
}

.btn:hover,
.btn-large:hover {
background-color: #3f51b5;
}

a {
color: #3f51b5;
}

.btn,
.btn-large {
background-color: #3f51b5;
}

li {
list-style-type: disc !important;
margin-left: 1rem;
}

/* Add these styles for the preview functionality */
.scrum-preview {
max-height: 400px;
overflow-y: auto;
padding: 10px;
border: 1px solid #e0e0e0;
border-radius: 4px;
background-color: #f9f9f9;
margin-bottom: 10px;
font-family: monospace;
white-space: pre-wrap;
}

.modal {
max-height: 80% !important;
width: 90% !important;
}

#copyPreview {
margin-right: 10px;
}

.label-open {
color: #2e7d32;
font-weight: bold;
}

.label-closed {
color: #c62828;
font-weight: bold;
}
65 changes: 50 additions & 15 deletions src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<link rel="stylesheet" type="text/css" href="index.css">
<script src="./scripts/fontawesome.js"></script>
<style type="text/css">
html,body{
width: 350px !important;
height: 600px !important;
max-height: 600px !important;
overflow-y: scroll;
}
</style>
html,body {
width: 350px !important;
height: 600px !important;
max-height: 600px !important;
overflow-y: scroll;
}
</style>
</head>
<body>
<div class="container">
Expand All @@ -33,6 +33,7 @@ <h6 class="center">
</label>
</div>
</div>

<div class="row">
<div class="col s12">
<ul class="tabs">
Expand All @@ -41,6 +42,7 @@ <h6 class="center">
</ul>
</div>
</div>

<div class="row">
<div class="input-field col s12">
<input placeholder="Your Project Name" id="projectName" type="text">
Expand All @@ -58,7 +60,6 @@ <h6 class="center">
<div class="input-field col s6">
<div>Starting Date:</div>
<input id="startingDate" type="date" class="datepicker" placeholder=" ">

</div>
<div class="input-field col s6">
<div>Ending Date</div>
Expand All @@ -74,28 +75,62 @@ <h6 class="center">
<label for="userReason">What is stopping you from doing your work?</label>
</div>
<div class="col s12">

<h5>Note:</h5>
<h6>
<ul>
<li>The PRs fetched are according to the date last reviewed by anyone. So if you reviewed a PR 10 days back, and someone reviewed it 2 days back, it will appear in your last week's activity. See <a target="_blank" href="https://github.com/fossasia/scrum_helper/issues/20">this issue</a>.
</li>
<li>By using the extension you understand that there might be discrepancies in the SCRUM generated. You are advised to edit the SCRUM afterwards to remove any discrepancies.
</li>
<li>The PRs fetched are according to the date last reviewed by anyone. So if you reviewed a PR 10 days back, and someone reviewed it 2 days back, it will appear in your last week's activity. See <a target="_blank" href="https://github.com/fossasia/scrum_helper/issues/20">this issue</a>.</li>
<li>By using the extension you understand that there might be discrepancies in the SCRUM generated. You are advised to edit the SCRUM afterwards to remove any discrepancies.</li>
</ul>
</h6>
</div>
</div>

<!-- Preview Button -->
<div class="row center">
<button id="previewScrum" class="btn waves-effect waves-light">
<i class="fa fa-eye left"></i>Preview Scrum Report
</button>
</div>

<!-- Modal -->
<div id="previewModal" class="modal">
<div class="modal-content">
<h4>Scrum Report Preview</h4>
<div id="previewContent" class="scrum-preview"></div>
</div>
<div class="modal-footer">
<button class="modal-close waves-effect waves-light btn">Close</button>
<button id="copyPreview" class="waves-effect waves-light btn">
<i class="fa fa-clipboard left"></i>Copy to Clipboard
</button>
</div>
</div>

<hr />
<footer>
<div class="center">
<a target="_blank" href="https://github.com/fossasia/scrum_helper"><h6><i class="fa fa-github" aria-hidden="true"></i> view code</h6></a>
<a target="_blank" href="https://github.com/fossasia/scrum_helper">
<h6><i class="fa fa-github" aria-hidden="true"></i> view code</h6>
</a>
</div>
</footer>
</div>

<script src="scripts/jquery-3.2.1.min.js"></script>
<script type="text/javascript" type="text/javascript" src="materialize/js/materialize.min.js"></script>
<script src="materialize/js/materialize.min.js"></script>
<script src="scripts/main.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var elems = document.querySelectorAll('.modal');
M.Modal.init(elems);
});

document.getElementById("copyPreview").addEventListener("click", function () {
const content = document.getElementById("previewContent").innerText;
navigator.clipboard.writeText(content).then(() => {
M.toast({ html: 'Copied to clipboard!' });
});
});
</script>
</body>
</html>
Loading