Эх сурвалжийг харах

Merge pull request #1141 from sharelatex/hb-v2-institutional-hub

v2 Institutional Hub

GitOrigin-RevId: ff01ccf659a2369284a22deb79ca45433ca1a2e8
Hugh O'Brien 8 жил өмнө
parent
commit
b3a957b8d8

+ 1 - 0
services/web/app/coffee/models/Institution.coffee

@@ -16,6 +16,7 @@ InstitutionSchema.method 'fetchV1Data', (callback = (error, institution)->) ->
 		this.name = parsedBody?.name
 		this.countryCode = parsedBody?.country_code
 		this.departments = parsedBody?.departments
+		this.portalSlug = parsedBody?.portal_slug
 		callback(null, this)
 
 mongoose.model 'Institution', InstitutionSchema

+ 3 - 0
services/web/public/stylesheets/_ol_style_includes.less

@@ -4,3 +4,6 @@
 @import "app/templates-v2.less";
 @import "app/login-register.less";
 @import "app/review-features-page.less";
+@import "app/institution-hub.less";
+@import "app/admin-hub.less";
+@import "components/overbox.less";

+ 95 - 0
services/web/public/stylesheets/app/admin-hub.less

@@ -0,0 +1,95 @@
+.circle(@size, @background_color) {
+  display: inline-block;
+  background-color: @background_color;
+  border-radius: 50%;
+  width: @size;
+  height: @size;
+  text-align: center;
+  padding-top: @size/6.4;
+  img {
+    height: @size - @size/3.2;
+  }
+}
+
+.hub-header {
+    h2 {
+        display: inline-block;
+    }
+    a {
+        color: @ol-dark-green;
+    }
+    i {
+        font-size: 30px;
+    }
+    .dropdown {
+        margin-right: 10px;
+    }
+}
+.admin-item {
+  position: relative;
+  margin-bottom: 60px;
+  .section-title {
+      text-transform: capitalize;
+  }
+  .alert-danger {
+      color: @ol-red;
+  }
+}
+.hidden-chart-section {
+  display: none;
+}
+.hub-circle {
+  .circle(160px, @accent-color-secondary);
+  padding-top: 50px;
+  color: white;
+}
+.hub-circle-number {
+  display: block;
+  font-size: 36px;
+  font-weight: 900;
+  line-height: 1;
+}
+.hub-big-number {
+  float: left;
+  font-size: 32px;
+  font-weight: 900;
+  line-height: 40px;
+  color: @accent-color-secondary;
+}
+.hub-big-number, .hub-number-label {
+  display: block;
+}
+.hub-metric-link {
+  position: absolute;
+  top: 9px;
+  right: 0;
+  a {
+      color: @accent-color-secondary;
+  }
+  i {
+      margin-right: 5px;
+  }
+}
+.custom-donut-container {
+  svg {
+    max-width: 700px;
+    margin: auto;
+  }
+  .chart-center-text {
+    font-family: @font-family-sans-serif;
+    font-size: 40px;
+    font-weight: bold;
+    fill: @accent-color-secondary;
+    text-anchor: middle;
+  }
+
+  .nv-legend-text {
+    font-family: @font-family-sans-serif; 
+    font-size: 14px;
+  }
+}
+.chart-no-center-text {
+  .chart-center-text {
+    display: none;
+  }
+}

+ 35 - 0
services/web/public/stylesheets/app/institution-hub.less

@@ -0,0 +1,35 @@
+#institution-hub {
+  .section_header {
+    .dropdown {
+      margin-right: 10px;
+    }
+  }
+
+  #usage {
+    .recent-activity {
+      .overbox {
+        font-size: 16px;
+      }
+      .hub-big-number, .hub-number-label, .worked-on {
+        display: block;
+        width: 50%;
+      }
+      .hub-big-number {
+        padding-right: 10px;
+        text-align: right;
+      }
+      .hub-number-label, .worked-on {
+        float: right;
+      }
+      .hub-number-label {
+        &:nth-child(odd) {
+          margin-top: 16px;
+        }
+      }
+      .worked-on {
+        color: @text-small-color;
+        font-style: italic;
+      }
+    }
+  }
+}

+ 1 - 1
services/web/public/stylesheets/components/nvd3_override.less

@@ -12,5 +12,5 @@
 }
 
 svg.nvd3-iddle {
-  @extend svg.nvd3-svg;
+  &:extend(svg.nvd3-svg);
 }

+ 11 - 0
services/web/public/stylesheets/components/overbox.less

@@ -0,0 +1,11 @@
+/* overbox: white box with shadow borders */
+.overbox {
+  margin: 0;
+  padding: 40px 20px;
+  background: @white;
+  border: 1px solid @gray-light;
+
+  &.overbox-small {
+    padding: 10px;
+  }
+}