From 6fed9e42a0bf66902eab12d328d00ef4cb6618da Mon Sep 17 00:00:00 2001 From: colorfulberry Date: Thu, 20 Aug 2020 09:16:00 +0800 Subject: [PATCH] feat; improve the dataset list pages and i18n for the directory --- options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-CN.ini | 1 + templates/repo/datasets/dataset_list.tmpl | 6 +- web_src/less/_repository.less | 99 +++++++++++------------ 4 files changed, 50 insertions(+), 57 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c2fafc324..a47da02d6 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -647,6 +647,7 @@ private = private public = public back = back copy_url=copy download url +directory=check directory of the datasets visibility = visibility visibility_description = Only the owner or the organization members if they have rights, will be able to see it. visibility_helper = Make Dataset Private diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 6529c3699..4b3444b70 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -648,6 +648,7 @@ public=公有 dir=目录 back=返回 copy_url=复制下载链接 +directory=查看数据集目录结构 visibility=可见性 visibility_description=只有组织所有人或拥有权利的组织成员才能看到。 visibility_helper=将数据集设为私有 diff --git a/templates/repo/datasets/dataset_list.tmpl b/templates/repo/datasets/dataset_list.tmpl index f1257062d..5910a9537 100755 --- a/templates/repo/datasets/dataset_list.tmpl +++ b/templates/repo/datasets/dataset_list.tmpl @@ -2,7 +2,7 @@ {{range .Attachments}}
-
+
{{svg "octicon-cloud-download" 16}} {{.Name}} @@ -18,8 +18,8 @@ {{svg "octicon-file" 16}}
-
- {{$.i18n.Tr "dataset.dir"}} + {{if $.Permission.CanWrite $.UnitTypeDatasets}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 47b020d4e..10c234bb9 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1,6 +1,5 @@ .repository { - - padding-top: 15px; + // padding-top: 15px; .repo-header { .ui.compact.menu { @@ -154,7 +153,7 @@ &.labels { .label-filter .menu .info { display: inline-block; - padding: .5rem .25rem; + padding: 0.5rem 0.25rem; border-bottom: 1px solid #cccccc; font-size: 12px; width: 100%; @@ -171,7 +170,7 @@ } .text { - margin-left: .9em; + margin-left: 0.9em; } .menu { @@ -227,7 +226,7 @@ padding: 0 5px; &:first-child { - border-radius: .28571429rem 0 0 .28571429rem; + border-radius: 0.28571429rem 0 0 0.28571429rem; } } @@ -259,7 +258,6 @@ } .repo-path { - .section, .divider { display: inline; @@ -377,11 +375,11 @@ } .small.icon { - font-size: .75em; + font-size: 0.75em; } .tiny.icon { - font-size: .5em; + font-size: 0.5em; } .file-actions { @@ -464,7 +462,7 @@ input { vertical-align: middle; - box-shadow: rgba(0, 0, 0, .0745098) 0 1px 2px inset; + box-shadow: rgba(0, 0, 0, 0.0745098) 0 1px 2px inset; width: inherit; padding: 7px 8px; margin-right: 5px; @@ -504,8 +502,8 @@ display: inline-block; padding: 3px 6px; font: 12px @monospaced-fonts, monospace; - color: rgba(0, 0, 0, .65); - background-color: rgba(209, 227, 237, .45); + color: rgba(0, 0, 0, 0.65); + background-color: rgba(209, 227, 237, 0.45); border-radius: 3px; } @@ -582,7 +580,6 @@ overflow-x: auto; } } - } } @@ -596,7 +593,7 @@ margin-bottom: 5px; .ui.input { - font-size: .5em; + font-size: 0.5em; vertical-align: top; width: 50%; min-width: 600px; @@ -660,7 +657,6 @@ } .review-item { - .avatar, .type-icon { float: none; @@ -675,7 +671,7 @@ } .text { - margin: .3em 0 .5em .5em; + margin: 0.3em 0 0.5em 0.5em; } .type-icon { @@ -684,7 +680,7 @@ } .divider { - margin: .5rem 0; + margin: 0.5rem 0; } .review-content { @@ -696,7 +692,7 @@ .comment-list { &:not(.prevent-before-timeline):before { display: block; - content: ""; + content: ''; position: absolute; margin-top: 12px; margin-bottom: 14px; @@ -714,9 +710,10 @@ margin-left: 40px; padding-left: 16px; - &:before { //ciara + &:before { + //ciara display: block; - content: ""; + content: ''; position: absolute; margin-top: 12px; margin-bottom: 14px; @@ -810,13 +807,12 @@ } .comment { - .tag { color: #767676; margin-top: 3px; padding: 2px 5px; font-size: 12px; - border: 1px solid rgba(0, 0, 0, .1); + border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 3px; &.review { margin-left: 5px; @@ -888,10 +884,10 @@ } .actions a { - color: rgba(0, 0, 0, .4); + color: rgba(0, 0, 0, 0.4); &:hover { - color: rgba(0, 0, 0, .8); + color: rgba(0, 0, 0, 0.8); } } } @@ -998,7 +994,8 @@ padding-left: 15px; & > .svg:not(.issue-symbol) { - text-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff; + text-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, + 0 -2px #fff; } & > .svg.issue-symbol { @@ -1037,7 +1034,7 @@ } .detail { - font-size: .9rem; + font-size: 0.9rem; margin-top: 5px; margin-left: 35px; @@ -1134,9 +1131,8 @@ } .orglabel { - opacity: .7; + opacity: 0.7; } - } .milestone.list { @@ -1315,7 +1311,7 @@ } &.ui.basic.striped.table tbody tr:nth-child(2n) { - background-color: rgba(0, 0, 0, .02) !important; + background-color: rgba(0, 0, 0, 0.02) !important; } } @@ -1434,7 +1430,7 @@ > div:after { clear: both; - content: ""; + content: ''; display: block; } @@ -1590,14 +1586,12 @@ } .code-diff-split { - table, tbody { width: 100%; } tbody tr { - // light gray for empty lines before / after commit &.add-code td:nth-child(1), &.add-code td:nth-child(2), @@ -1650,7 +1644,6 @@ } .diff-stats { - clear: both; margin-bottom: 5px; max-height: 400px; @@ -1697,7 +1690,7 @@ } .clone.button:first-child { - border-radius: .28571429rem 0 0 .28571429rem; + border-radius: 0.28571429rem 0 0 0.28571429rem; } .ui.action.small.input { @@ -1825,7 +1818,6 @@ } .field { - button, input { @media only screen and (max-width: 438px) { @@ -2158,7 +2150,7 @@ } &.active { - background: rgba(0, 0, 0, .05); + background: rgba(0, 0, 0, 0.05); } } } @@ -2172,12 +2164,12 @@ min-width: 15em; > .header { - margin: .75rem 0 .5rem; + margin: 0.75rem 0 0.5rem; } > .item { float: left; - padding: .5rem .5rem !important; + padding: 0.5rem 0.5rem !important; font-size: 1.5em; width: 45px; left: 13px; @@ -2206,7 +2198,7 @@ &.disabled { cursor: default; - opacity: .5; + opacity: 0.5; } } @@ -2221,7 +2213,7 @@ .select-reaction { float: left; - padding: .6em; + padding: 0.6em; line-height: 21px; &:not(.active) a { @@ -2462,11 +2454,11 @@ border-radius: 4px; .dz-button { - color: rgba(0, 0, 0, .6); + color: rgba(0, 0, 0, 0.6); } &:hover .dz-button { - color: rgba(0, 0, 0, .8); + color: rgba(0, 0, 0, 0.8); } .dz-error-message { @@ -2481,7 +2473,7 @@ > .header, .segment { - box-shadow: 0 1px 2px 0 rgba(34, 36, 38, .15); + box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15); } } @@ -2503,7 +2495,7 @@ > .svg + .content { display: table-cell; - padding: 0 0 0 .5em; + padding: 0 0 0 0.5em; vertical-align: top; } @@ -2590,13 +2582,12 @@ } #avatar-arrow { - &:before, &:after { right: 100%; top: 20px; border: solid transparent; - content: " "; + content: ' '; height: 0; width: 0; position: absolute; @@ -2642,7 +2633,7 @@ display: table-cell; &.tiny { - height: .5em; + height: 0.5em; } } } @@ -2799,18 +2790,18 @@ tbody.commit-list { } .repo-buttons .disabled-repo-button .label { - opacity: .5; + opacity: 0.5; } .repo-buttons .disabled-repo-button a.button { - opacity: .5; + opacity: 0.5; cursor: not-allowed; } .repo-buttons .disabled-repo-button a.button:hover { background: none !important; - color: rgba(0, 0, 0, .6) !important; - box-shadow: 0 0 0 1px rgba(34, 36, 38, .15) inset !important; + color: rgba(0, 0, 0, 0.6) !important; + box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.15) inset !important; } .repo-buttons .ui.labeled.button > .label { @@ -2857,12 +2848,12 @@ td.blob-excerpt { margin-top: 1em; } -.diff-file-box[data-folded="true"] .diff-file-body { +.diff-file-box[data-folded='true'] .diff-file-body { display: none; } -.diff-file-box[data-folded="true"] .diff-file-header { - border-radius: .28571429rem !important; +.diff-file-box[data-folded='true'] .diff-file-header { + border-radius: 0.28571429rem !important; } /* prevent page shaking on language bar click */ @@ -2872,7 +2863,7 @@ td.blob-excerpt { } .ui.form .right .ui.button { - margin-left: .25em; + margin-left: 0.25em; margin-right: 0; }