Page: Compare 2 commits

This commit is contained in:
Unknwon 2014-10-10 21:40:51 -04:00
parent 54930c001d
commit b2632dec09
19 changed files with 379 additions and 145 deletions

View file

@ -271,6 +271,10 @@ img.avatar-100 {
.pagination li {
display: inline;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.markdown {
background-color: white;
font-size: 16px;
@ -1487,6 +1491,106 @@ The register and sign-in page style
font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace;
font-size: 14px;
}
.diff-head-box {
margin-top: 10px;
}
.diff-head-box .panel-body {
padding: 10px 15px 5px 10px;
}
.diff-head-box .author img {
margin-top: -7px;
}
.diff-detail-box {
margin: 15px 0;
line-height: 30px;
}
.diff-detail-box ol {
clear: both;
padding-left: 0;
margin-bottom: 28px;
}
.diff-detail-box ol li {
list-style: none;
padding-bottom: 4px;
margin-bottom: 4px;
border-bottom: 1px dashed #DDD;
padding-left: 6px;
}
.diff-detail-box span.status {
display: inline-block;
width: 12px;
height: 12px;
margin-right: 8px;
vertical-align: middle;
}
.diff-detail-box span.status.modify {
background-color: #f0db88;
}
.diff-detail-box span.status.add {
background-color: #b4e2b4;
}
.diff-detail-box span.status.del {
background-color: #e9aeae;
}
.diff-detail-box span.status.rename {
background-color: #dad8ff;
}
.diff-box .count {
margin-right: 12px;
}
.diff-box .count .bar {
background-color: #e75316;
height: 12px;
width: 40px;
display: inline-block;
margin: 2px 4px 0 4px;
vertical-align: text-top;
}
.diff-box .count .bar .add {
background-color: #77c64a;
height: 12px;
}
.diff-box .file {
color: #888;
}
.diff-box .panel-header {
font-size: 14px;
}
.diff-file-box .code-diff tbody tr:hover td,
.diff-file-box .code-diff tbody tr:hover pre {
background-color: #FFF8D2 !important;
border-color: #F0DB88 !important;
}
.diff-file-box .file-body.file-code .lines-num-old {
border-right: 1px solid #DDD;
}
.file-content .file-body.file-code .lines-num {
text-align: right;
color: #999;
background: #fafafa;
width: 1%;
}
.diff-file-box .code-diff tbody tr.tag-code td,
.diff-file-box .code-diff tbody tr.tag-code pre {
background-color: #E0E0E0 !important;
border-color: #ADADAD !important;
}
.diff-file-box .code-diff tbody tr.del-code td,
.diff-file-box .code-diff tbody tr.del-code pre {
background-color: #ffe2dd !important;
border-color: #e9aeae !important;
}
.diff-file-box .code-diff tbody tr.add-code td,
.diff-file-box .code-diff tbody tr.add-code pre {
background-color: #d1ffd6 !important;
border-color: #b4e2b4 !important;
}
.compare-head-box {
margin-top: 10px;
}
.compare-head-box .compare {
padding: 0 15px 15px 15px;
}
#admin-wrapper,
#setting-wrapper {
padding-bottom: 100px;

View file

@ -713,6 +713,14 @@ ul.menu-radius > li:last-child > a {
border-bottom-left-radius: .3em;
border-bottom-right-radius: .3em;
}
.panel.panel-info {
border-color: #85c5e5;
}
.panel.panel-info > .panel-header {
color: #31708f;
background-color: #d9edf7;
border-color: #85c5e5;
}
.panel.panel-warning {
border-color: #F0C36D;
}

View file

@ -299,6 +299,9 @@ function initCore() {
e.preventDefault();
$.magnificPopup.close();
});
// Collapse.
$('.collapse').hide();
}
function initUserSetting() {
@ -698,6 +701,37 @@ function initProfile() {
});
}
function initTimeSwitch() {
// Time switch.
$(".time-since[title]").on("click", function () {
var $this = $(this);
var title = $this.attr("title");
var text = $this.text();
$this.text(title);
$this.attr("title", text);
});
}
function initDiff() {
$('.diff-detail-box>a').click(function () {
$($(this).data('target')).slideToggle(100);
})
var $counter = $('.diff-counter');
if ($counter.length < 1) {
return;
}
$counter.each(function (i, item) {
var $item = $(item);
var addLine = $item.find('span[data-line].add').data("line");
var delLine = $item.find('span[data-line].del').data("line");
var addPercent = parseFloat(addLine) / (parseFloat(addLine) + parseFloat(delLine)) * 100;
$item.find(".bar .add").css("width", addPercent + "%");
});
}
$(document).ready(function () {
Gogs.AppSubUrl = $('head').data('suburl') || '';
initCore();
@ -737,6 +771,10 @@ $(document).ready(function () {
if ($('#user-profile-page').length) {
initProfile();
}
if ($('#diff-page').length) {
initTimeSwitch();
initDiff();
}
$('#dashboard-sidebar-menu').tabs();
$('#pull-issue-preview').markdown_preview(".issue-add-comment");

File diff suppressed because one or more lines are too long

View file

@ -291,4 +291,8 @@ clear: both;
li {
display: inline;
}
}
.list-unstyled {
padding-left: 0;
list-style: none;
}

View file

@ -494,37 +494,138 @@
}
}
.repo-user-list-block {
position: relative;
top: 5px;
position: relative;
top: 5px;
}
.setting-list {
width: 100%;
list-style: none;
width: 100%;
list-style: none;
}
#commits-list {
padding-top: 20px;
h4{
line-height: 30px;
margin-bottom: 0;
}
padding-top: 20px;
h4{
line-height: 30px;
margin-bottom: 0;
}
}
.commit-list {
th {
background-color: #FFF;
line-height: 28px !important;
}
.date {
width: 120px;
}
.author {
padding-left: 20px;
min-width: 180px;
img {
margin-top: -4px;
th {
background-color: #FFF;
line-height: 28px !important;
}
.date {
width: 120px;
}
.author {
padding-left: 20px;
min-width: 180px;
img {
margin-top: -4px;
}
}
.sha a {
font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace;
font-size: 14px;
}
}
.diff-head-box {
margin-top: 10px;
.panel-body {
padding: 10px 15px 5px 10px;
}
.author {
img {
margin-top: -7px;
}
}
}
.diff-detail-box {
margin: 15px 0;
line-height: 30px;
ol {
clear: both;
padding-left: 0;
margin-bottom: 28px;
li {
list-style: none;
padding-bottom: 4px;
margin-bottom: 4px;
border-bottom: 1px dashed #DDD;
padding-left: 6px;
}
}
span.status{
display: inline-block;
width: 12px;
height: 12px;
margin-right: 8px;
vertical-align: middle;
&.modify {
background-color: #f0db88;
}
&.add {
background-color: #b4e2b4;
}
&.del {
background-color: #e9aeae;
}
&.rename {
background-color: #dad8ff;
}
}
}
.diff-box {
.count {
margin-right: 12px;
.bar {
background-color: #e75316;
height: 12px;
width: 40px;
display: inline-block;
margin: 2px 4px 0 4px;
vertical-align: text-top;
.add {
background-color: #77c64a;
height: 12px;
}
}
}
.file {
color: #888;
}
.panel-header {
font-size: 14px;
}
}
.diff-file-box .code-diff tbody tr:hover td, .diff-file-box .code-diff tbody tr:hover pre {
background-color: #FFF8D2 !important;
border-color: #F0DB88 !important;
}
.diff-file-box .file-body.file-code .lines-num-old {
border-right: 1px solid #DDD;
}
.file-content .file-body.file-code .lines-num {
text-align: right;
color: #999;
background: #fafafa;
width: 1%;
}
.diff-file-box .code-diff tbody tr.tag-code td, .diff-file-box .code-diff tbody tr.tag-code pre {
background-color: #E0E0E0 !important;
border-color: #ADADAD !important;
}
.diff-file-box .code-diff tbody tr.del-code td, .diff-file-box .code-diff tbody tr.del-code pre {
background-color: #ffe2dd !important;
border-color: #e9aeae !important;
}
.diff-file-box .code-diff tbody tr.add-code td, .diff-file-box .code-diff tbody tr.add-code pre {
background-color: #d1ffd6 !important;
border-color: #b4e2b4 !important;
}
.compare-head-box {
margin-top: 10px;
.compare {
padding: 0 15px 15px 15px;
}
}
.sha a {
font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace;
font-size: 14px;
}
}

View file

@ -36,6 +36,14 @@
border-bottom-right-radius: .3em;
}
}
&.panel-info {
border-color: #85c5e5;
> .panel-header {
color: #31708f;
background-color: #d9edf7;
border-color: #85c5e5;
}
}
&.panel-warning {
border-color: #F0C36D;
> .panel-header {