summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2020-02-11 11:34:17 +0200
committerGitHub <noreply@github.com>2020-02-11 11:34:17 +0200
commitad2642a8aac9facb217a8471df1d3e00f1214e92 (patch)
treeea198b2b3130d22bb60886b6ba0a1df352f160ff /web_src
parent37892be63580e40ced80e041ff2e7dabb2e80866 (diff)
downloadgitea-ad2642a8aac9facb217a8471df1d3e00f1214e92.tar.gz
gitea-ad2642a8aac9facb217a8471df1d3e00f1214e92.zip
Language statistics bar for repositories (#8037)
* Implementation for calculating language statistics Impement saving code language statistics to database Implement rendering langauge stats Add primary laguage to show in repository list Implement repository stats indexer queue Add indexer test Refactor to use queue module * Do not timeout for queues
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/index.js8
-rw-r--r--web_src/less/_base.less10
-rw-r--r--web_src/less/_repository.less20
-rw-r--r--web_src/less/themes/theme-arc-green.less6
4 files changed, 43 insertions, 1 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 128779c153..c84a2c8991 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1127,6 +1127,14 @@ function initRepository() {
}
});
}
+
+ // Language stats
+ if ($('.language-stats').length > 0) {
+ $('.language-stats').on('click', (e) => {
+ e.preventDefault();
+ $('.language-stats-details, .repository-menu').slideToggle();
+ });
+ }
}
function initMigration() {
diff --git a/web_src/less/_base.less b/web_src/less/_base.less
index 9d7ed0de2c..d1851d5d88 100644
--- a/web_src/less/_base.less
+++ b/web_src/less/_base.less
@@ -1182,3 +1182,13 @@ i.icon.centerlock {
.ui.popup .ui.label {
margin-bottom: 0.4em;
}
+
+.color-icon {
+ padding-right: 0.7em;
+ padding-left: 0.5em;
+ margin-right: 0.5em;
+ margin-left: 0.5em;
+ display: inline;
+ border: 1px solid #ccc;
+ border-radius: 500em;
+}
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less
index 3ac86b9875..872ea876a0 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -1920,6 +1920,10 @@
}
}
+ span.ui {
+ color: black;
+ }
+
&.active {
background: rgba(0, 0, 0, 0.05);
}
@@ -1998,6 +2002,22 @@
flex: auto;
}
}
+
+ .segment.language-stats {
+ padding: 0;
+ height: 0.6em;
+ display: flex;
+ white-space: nowrap;
+ width: 100%;
+
+ .bar {
+ white-space: nowrap;
+ border: 0;
+ padding: 0;
+ margin: 0;
+ height: 0.6em;
+ }
+ }
}
// End of .repository
diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less
index cea67fe92d..bd8033e302 100644
--- a/web_src/less/themes/theme-arc-green.less
+++ b/web_src/less/themes/theme-arc-green.less
@@ -65,8 +65,12 @@
color: #7f7f7f;
}
-.repository .ui.segment.sub-menu .list .item a {
+.repository .ui.segment.sub-menu .list .item {
color: #dbdbdb;
+ a,
+ span.ui {
+ color: #dbdbdb;
+ }
}
.ui.horizontal.segments > .segment {