mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-07-08 06:32:46 +00:00
more
This commit is contained in:
parent
409367588a
commit
c62efa4819
@ -1,5 +1,6 @@
|
|||||||
import Component from "@glimmer/component";
|
import Component from "@glimmer/component";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
|
import { and, eq } from "truth-helpers";
|
||||||
import concatClass from "discourse/helpers/concat-class";
|
import concatClass from "discourse/helpers/concat-class";
|
||||||
|
|
||||||
const ROWS = 7;
|
const ROWS = 7;
|
||||||
@ -7,6 +8,8 @@ const COLS = 53;
|
|||||||
|
|
||||||
export default class ActivityCalendar extends Component {
|
export default class ActivityCalendar extends Component {
|
||||||
get rowsArray() {
|
get rowsArray() {
|
||||||
|
console.log(this.args.report.data);
|
||||||
|
|
||||||
const data = this.args.report.data;
|
const data = this.args.report.data;
|
||||||
let rowsArray = [];
|
let rowsArray = [];
|
||||||
|
|
||||||
@ -38,12 +41,31 @@ export default class ActivityCalendar extends Component {
|
|||||||
<template>
|
<template>
|
||||||
<div class="rewind-report-page -activity-calendar">
|
<div class="rewind-report-page -activity-calendar">
|
||||||
<div class="rewind-card">
|
<div class="rewind-card">
|
||||||
|
<h3>Activity Calendar</h3>
|
||||||
<table class="rewind-calendar">
|
<table class="rewind-calendar">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="activity-header-cell">Jan</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">Feb</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">Mar</td>
|
||||||
|
<td colspan="5" class="activity-header-cell">Apr</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">May</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">Jun</td>
|
||||||
|
<td colspan="5" class="activity-header-cell">Jul</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">Aug</td>
|
||||||
|
<td colspan="5" class="activity-header-cell">Sep</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">Oct</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">Nov</td>
|
||||||
|
<td colspan="4" class="activity-header-cell">Dec</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
{{#each this.rowsArray as |row|}}
|
{{#each this.rowsArray as |row|}}
|
||||||
<tr>
|
<tr>
|
||||||
{{#each row as |cell|}}
|
{{#each row as |cell|}}
|
||||||
<td
|
<td
|
||||||
data-date={{cell.date}}
|
data-date={{cell.date}}
|
||||||
|
title={{cell.date}}
|
||||||
class={{concatClass
|
class={{concatClass
|
||||||
"rewind-calendar-cell"
|
"rewind-calendar-cell"
|
||||||
(this.computeClass cell.post_count)
|
(this.computeClass cell.post_count)
|
||||||
@ -52,6 +74,7 @@ export default class ActivityCalendar extends Component {
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -42,8 +42,10 @@ export default class Reactions extends Component {
|
|||||||
<div class="rewind-reactions-chart">
|
<div class="rewind-reactions-chart">
|
||||||
{{#each-in @report.data.post_used_reactions as |emojiName count|}}
|
{{#each-in @report.data.post_used_reactions as |emojiName count|}}
|
||||||
<div class="rewind-reactions-row">
|
<div class="rewind-reactions-row">
|
||||||
<span>{{replaceEmoji (concat ":" emojiName ":")}}</span>
|
<span class="emoji">{{replaceEmoji
|
||||||
<span>{{this.computePercentage count}}</span>
|
(concat ":" emojiName ":")
|
||||||
|
}}</span>
|
||||||
|
<span class="percentage">{{this.computePercentage count}}</span>
|
||||||
<div
|
<div
|
||||||
class="rewind-reactions-bar"
|
class="rewind-reactions-bar"
|
||||||
style={{this.computePercentageStyle count}}
|
style={{this.computePercentageStyle count}}
|
||||||
@ -51,7 +53,8 @@ export default class Reactions extends Component {
|
|||||||
</div>
|
</div>
|
||||||
{{/each-in}}
|
{{/each-in}}
|
||||||
|
|
||||||
<span class="rewind-total-reactions">Total number of reactions:
|
<span class="rewind-total-reactions">Percentage of total number of
|
||||||
|
reactions:
|
||||||
{{this.totalPostUsedReactions}}</span>
|
{{this.totalPostUsedReactions}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.activity-header-cell {
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: normal;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
.rewind-calendar-cell {
|
.rewind-calendar-cell {
|
||||||
height: 10px;
|
height: 10px;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
|
@ -4,3 +4,8 @@
|
|||||||
@import "post-received-reactions";
|
@import "post-received-reactions";
|
||||||
@import "post-used-reactions";
|
@import "post-used-reactions";
|
||||||
@import "activity-calendar";
|
@import "activity-calendar";
|
||||||
|
|
||||||
|
.rewind h3 {
|
||||||
|
font-size: var(--font-down-1);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
@ -1,20 +1,49 @@
|
|||||||
.rewind-report-page.-post-used-reactions {
|
.rewind-report-page.-post-used-reactions {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
|
width: 50%;
|
||||||
|
|
||||||
|
.rewind-card {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.rewind-reactions-chart {
|
.rewind-reactions-chart {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1em;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rewind-reactions-row {
|
.rewind-reactions-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 1px solid var(--primary-low);
|
||||||
|
padding: 0.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.emoji {
|
||||||
|
height: 25px;
|
||||||
|
width: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.percentage {
|
||||||
|
font-weight: normal;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rewind-reactions-bar {
|
.rewind-reactions-bar {
|
||||||
background: var(--tertiary);
|
background: var(--tertiary-600);
|
||||||
height: 50px;
|
border: 1px solid rgba(var(--primary-rgb), 0.2);
|
||||||
|
height: 25px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rewind-total-reactions {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user