summaryrefslogtreecommitdiffstats
path: root/public/less
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-08-06 07:43:22 +0300
committerJonas Franz <info@jonasfranz.software>2018-08-06 06:43:21 +0200
commit6e64f9db8eb889f9cc7e8c9576b2f9c89750927e (patch)
treed76b927295a1d2f69ea73a78e83d9264ce1510f2 /public/less
parent9c354a539ab498ebfdebf7395cf17f95f8b24ac8 (diff)
downloadgitea-6e64f9db8eb889f9cc7e8c9576b2f9c89750927e.tar.gz
gitea-6e64f9db8eb889f9cc7e8c9576b2f9c89750927e.zip
Pull request review/approval and comment on code (#3748)
* Initial ui components for pull request review * Add Review Add IssueComment types Signed-off-by: Jonas Franz <info@jonasfranz.software> (cherry picked from commit 2b4daab) Signed-off-by: Jonas Franz <info@jonasfranz.software> * Replace ReviewComment with Content Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add load functions Add ReviewID to findComments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add create review comment implementation Add migration for review Other small changes Signed-off-by: Jonas Franz <info@jonasfranz.software> * Simplified create and find functions for review Signed-off-by: Jonas Franz <info@jonasfranz.software> * Moved "Pending" to first position Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add GetCurrentReview to simplify fetching current review Signed-off-by: Jonas Franz <info@jonasfranz.software> * Preview for listing comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Move new comment form to its own file Signed-off-by: Jonas Franz <info@jonasfranz.software> * Implement Review form Show Review comments on comment stream Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for single comments Showing buttons in context Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add pending tag to pending review comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add unit tests for Review Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fetch all review ids at once Add unit tests Signed-off-by: Jonas Franz <info@jonasfranz.software> * gofmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Improved comment rendering in "Files" view by adding Comments to DiffLine Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for invalidating comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Switched back to code.gitea.io/git Signed-off-by: Jonas Franz <info@jonasfranz.software> * Moved review migration from v64 to v65 Signed-off-by: Jonas Franz <info@jonasfranz.software> * Rebuild css Signed-off-by: Jonas Franz <info@jonasfranz.software> * gofmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Improve translations Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix unit tests by updating fixtures and updating outdated test Signed-off-by: Jonas Franz <info@jonasfranz.software> * Comments will be shown at the right place now Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for deleting CodeComments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix problems caused by files in subdirectories Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for showing code comments of reviews in conversation Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for "Show/Hide outdated" Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update code.gitea.io/git Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for new webhooks Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update comparison Signed-off-by: Jonas Franz <info@jonasfranz.software> * Resolve conflicts Signed-off-by: Jonas Franz <info@jonasfranz.software> * Minor UI improvements * update code.gitea.io/git * Fix ui bug reported by @lunny causing wrong position of add button Add functionality to "Cancel" button Add scale effects to add button Hide "Cancel" button for existing comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Prepare solving conflicts Signed-off-by: Jonas Franz <info@jonasfranz.software> * Show add button only if no comments already exist for the line Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add missing vendor files Signed-off-by: Jonas Franz <info@jonasfranz.software> * Check if reviewer is nil Signed-off-by: Jonas Franz <info@jonasfranz.software> * Show forms only to users who are logged in Signed-off-by: Jonas Franz <info@jonasfranz.software> * Revert "Show forms only to users who are logged in" This reverts commit c083682 Signed-off-by: Jonas Franz <info@jonasfranz.software> * Save patch in comment Render patch for code comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add link to comment in code Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add reply form to comment list Show forms only to signed in users Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add 'Reply' as translatable Add CODE_COMMENT_LINES setting Signed-off-by: Jonas Franz <info@jonasfranz.software> * gofmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix problems introduced by checking for singed in user Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add v70 Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update generated stylesheet Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix preview Beginn with new review comment patch system Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add new algo to generate diff for line range Remove old algo used for cutting big diffs (it was very buggy) * Add documentation and example for CutDiffAroundLine * Fix example of CutDiffAroundLine * Fix some comment UI rendering bugs * Add code comment edit mode * Send notifications / actions to users until review gets published Fix diff generation bug Fix wrong hashtag * Fix vet errors * Send notifications also for single comments * Fix some notification bugs, fix link * Fix: add comment icon is only shown on code lines * Add lint comment * Add unit tests for git diff * Add more error messages * Regenerated css Signed-off-by: Jonas Franz <info@jonasfranz.software> * fmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Regenerated CSS with latest less version Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix test by updating comment type to new ID Signed-off-by: Jonas Franz <info@jonasfranz.software> * Introducing CodeComments as type for map[string]map[int64][]*Comment Other minor code improvements Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix data-tab issues Signed-off-by: Jonas Franz <info@jonasfranz.software> * Remove unnecessary change Signed-off-by: Jonas Franz <info@jonasfranz.software> * refactored checkForInvalidation Signed-off-by: Jonas Franz <info@jonasfranz.software> * Append comments instead of setting Signed-off-by: Jonas Franz <info@jonasfranz.software> * Use HeadRepo instead of BaseRepo Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update migration Signed-off-by: Jonas Franz <info@jonasfranz.de> * Regenerated CSS Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add copyright Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update index.css Signed-off-by: Jonas Franz <info@jonasfranz.software>
Diffstat (limited to 'public/less')
-rw-r--r--public/less/_base.less10
-rw-r--r--public/less/_repository.less72
-rw-r--r--public/less/_review.less103
-rw-r--r--public/less/index.less1
4 files changed, 161 insertions, 25 deletions
diff --git a/public/less/_base.less b/public/less/_base.less
index 6327ebf61f..b2734872c1 100644
--- a/public/less/_base.less
+++ b/public/less/_base.less
@@ -371,7 +371,11 @@ pre, code {
}
}
+.file-comment {
+ font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace;
+ color: rgba(0,0,0,.87);
+}
.overflow.menu {
.items {
@@ -443,6 +447,12 @@ footer {
.hide {
display: none;
+ &.show-outdated {
+ display: none !important;
+ }
+ &.hide-outdated {
+ display: none !important;
+ }
}
.center {
text-align: center;
diff --git a/public/less/_repository.less b/public/less/_repository.less
index c222eef160..8ac4b9fc5a 100644
--- a/public/less/_repository.less
+++ b/public/less/_repository.less
@@ -705,6 +705,21 @@
margin-right: -1px;
font-size: 25px;
}
+ &.octicon-comment {
+ margin-top: 4px;
+ margin-left: -35px;
+ font-size: 24px;
+ }
+ &.octicon-eye {
+ margin-top: 3px;
+ margin-left: -35px;
+ margin-right: 0px;
+ font-size: 22px;
+ }
+ &.octicon-x {
+ margin-left: -33px;
+ font-size: 25px;
+ }
}
.detail {
font-size: 0.9rem;
@@ -883,38 +898,44 @@
width: 140px;
}
}
- td.sha .sha.label {
- margin: 0;
- }
+ td.sha .sha.label {
+ margin: 0;
+ }
&.ui.basic.striped.table tbody tr:nth-child(2n) {
background-color: rgba(0, 0, 0, .02)!important;
}
}
- #commits-table td.sha .sha.label, #repo-files-table .sha.label{
- &.isSigned{
- border: 1px solid #BBB;
- .detail.icon{
- background: #FAFAFA;
- margin: -6px -10px -4px 0px;
- padding: 5px 3px 5px 6px;
- border-left: 1px solid #BBB;
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- }
- }
- &.isSigned.isVerified{
- border: 1px solid #21BA45;
- background: #21BA4518;
- .detail.icon{
- border-left: 1px solid #21BA4580;
- }
- }
+ #commits-table td.sha .sha.label, #repo-files-table .sha.label{
+ &.isSigned{
+ border: 1px solid #BBB;
+ .detail.icon{
+ background: #FAFAFA;
+ margin: -6px -10px -4px 0px;
+ padding: 5px 3px 5px 6px;
+ border-left: 1px solid #BBB;
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ }
+ }
+ &.isSigned.isVerified{
+ border: 1px solid #21BA45;
+ background: #21BA4518;
+ .detail.icon{
+ border-left: 1px solid #21BA4580;
+ }
}
+ }
.diff-detail-box {
- margin: 15px 0;
+ padding: 7px 0;
+ background: #fff;
line-height: 30px;
+ >div:after{
+ clear: both;
+ content: "";
+ display: block;
+ }
ol {
clear: both;
padding-left: 0;
@@ -947,8 +968,9 @@
background-color: #dad8ff;
}
}
- .ui.right {
- margin-bottom: 15px;
+ .detail-files {
+ background: #fff;
+ margin: 0px;
}
}
.diff-box .header {
diff --git a/public/less/_review.less b/public/less/_review.less
new file mode 100644
index 0000000000..a1b2e1932f
--- /dev/null
+++ b/public/less/_review.less
@@ -0,0 +1,103 @@
+.ui.button.add-code-comment {
+ font-size: 14px;
+ height: 16px;
+ padding: 2px 0 0;
+ position: relative;
+ width: 16px;
+ z-index: 5;
+ float: left;
+ margin: -2px -10px -2px -20px;
+ opacity: 0;
+ transition: transform 0.1s ease-in-out;
+ transform: scale(1, 1);
+
+ &:hover {
+ transform: scale(1.2, 1.2);
+ }
+}
+
+.focus-lines-new .ui.button.add-code-comment.add-code-comment-right,
+.focus-lines-old .ui.button.add-code-comment.add-code-comment-left {
+ opacity: 1;
+}
+
+.comment-code-cloud {
+ padding: 4px;
+ margin: 0 auto;
+ position: relative;
+ border: 1px solid #f1f1f1;
+ margin-top: 13px;
+ margin-right: 10px;
+ margin-bottom: 5px;
+
+ &:before {
+ content: " ";
+ width: 0;
+ height: 0;
+ border-left: 13px solid transparent;
+ border-right: 13px solid transparent;
+ border-bottom: 13px solid #f1f1f1;
+ left: 20px;
+ position: absolute;
+ top: -13px;
+ }
+
+ .attached.tab {
+ border: none;
+ padding: 0;
+ margin: 0;
+
+ &.markdown {
+ padding: 1em;
+ min-height: 168px;
+ }
+ }
+
+ .right.menu.options .item {
+ padding: 0.85714286em 0.442857em;
+ cursor: pointer;
+ }
+
+ .ui.form textarea {
+ border: 0px;
+ }
+
+ .ui.attached.tabular.menu {
+ background: #f7f7f7;
+ border: 1px solid #d4d4d5;
+ padding-top: 5px;
+ padding-left: 5px;
+ margin-top: 0px;
+ }
+
+ .footer {
+ border-top: 1px solid #f1f1f1;
+ margin-top: 10px;
+
+ .markdown-info {
+ display: inline-block;
+ margin: 5px 0;
+ font-size: 12px;
+ color: rgba(0,0,0,.6)
+ }
+
+ .ui.right.floated {
+ padding-top: 6px;
+ }
+
+ &:after{
+ clear: both;
+ content: "";
+ display: block;
+ }
+ }
+
+ .comment-form-reply {
+ margin: 0.5em !important;
+ }
+}
+
+.file-comment {
+ font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace;
+ color: rgba(0,0,0,.87);
+}
diff --git a/public/less/index.less b/public/less/index.less
index 9bca53c44c..0ffd6c9be6 100644
--- a/public/less/index.less
+++ b/public/less/index.less
@@ -12,3 +12,4 @@
@import "_dashboard";
@import "_admin";
@import "_explore";
+@import "_review";