diff --git a/js/dir_app.js b/js/dir_app.js index 7ca187a..1dda855 100644 --- a/js/dir_app.js +++ b/js/dir_app.js @@ -2056,39 +2056,39 @@ const ActivityInfoReport2 = Vue.component('activityinforeport2', { watch: { }, template: `
- +
- + - + - - + - + - + - +
Title:{{ a.title }}{{ a.title }}
Date:{{ $root.$dj(a.starttime).format('YYYY MMM DD dd h:mma') }}{{ $root.$dj(a.starttime).format('YYYY MMM DD dd h:mma') }}
Mode / Location: + {{ mode_string(a) }} -
{{ a.location }}
-
{{ a.location_irl }}
+
{{ a.location }}
+
{{ a.location_irl }}
Description:
Hosts:{{ host }}{{ host }}
Attendees:{{ user }}{{ user }}
Survey Results:
@@ -2102,39 +2102,39 @@ const ActivityInfoReportTable = Vue.component('activityinforeport_table', { mode_string: function(a) { return _.findWhere(this.$root.modes_menu, { 'id': a.mode })['string'] }, }, template: `
- +
- + - + - - + - + - + - +
Title:{{ a.title }}{{ a.title }}
Date:{{ $root.$dj(a.starttime).format('YYYY MMM DD dd h:mma') }}{{ $root.$dj(a.starttime).format('YYYY MMM DD dd h:mma') }}
Mode / Location: + {{ mode_string(a) }} -
{{ a.location }}
-
{{ a.location_irl }}
+
{{ a.location }}
+
{{ a.location_irl }}
Description:
Hosts:{{ host }}{{ host }}
Attendees:{{ user }}{{ user }}
Survey Results:
@@ -2248,18 +2248,50 @@ const ActivityReport = Vue.component('activityreport', { var result = "" if (this.answers2[id]) { _.each( this.answers2[id], function (qlist) { - result += "" + qlist[0]['question'] + "
\n\n" + result += "
" + result += "" + qlist[0]['question'] + "
" + if (nums.length) { + var counts = [0,0,0,0,0,0] // index 1..5 + var sum = 0 + _.each(nums, function(v){ counts[v]+=1; sum+=v }) + var maxc = _.max(counts.slice(1)) || 1 + var avg = (sum/nums.length).toFixed(2) + // table-based bars with inline width; good for copy/paste + result += "" + for (var i=1;i<=5;i++) { + var c = counts[i] + var width = Math.round((c/maxc)*200) // px + result += "" + + "" + + "" + + "" + } + result += "
"+i+"" + + "
" + + "
" + + "
" + + ""+c+"" + + "
" + result += "
Responses: "+nums.length+", Average: "+avg+"
" + } else { + // fallback: list non-numeric answers + result += "
    " + _.each( qlist, function(qanswer) { + result += "
  • " + (qanswer['answer']||'') + "
  • \n" + }) + result += "
\n" + } + result += "
" }) return result } return "no survey results?" - var answers = _.find(this.activities, function(x) { return x.id == id } ) - return "Surveys" - return _.reduce( self.hosts_by_sesid[id], function(mem,val) { if (val.name) { return mem + val.name + ", " } return mem }, '') }, }, computed: { diff --git a/style.css b/style.css index 88f0297..0a6b3cb 100644 --- a/style.css +++ b/style.css @@ -40,4 +40,22 @@ ul { ol { list-style-type: decimal!important; list-style-position: inside!important; -} \ No newline at end of file +} + +/* Report page: prevent long URLs or tokens from causing horizontal scroll */ +.activityreport { + overflow-wrap: anywhere; + word-break: break-word; +} +.activityreport table, +.activityreport td, +.activityreport th, +.activityreport p, +.activityreport li, +.activityreport div, +.activityreport span, +.activityreport a, +.activityreport code { + overflow-wrap: anywhere; + word-break: break-word; +}