diff --git a/.gitignore b/.gitignore index 385cdce2e..794b1672e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ template1.html scrap.py scraplab.py *~ -content.html \ No newline at end of file +content.html +submission*.html \ No newline at end of file diff --git a/README.txt b/README.txt index 94344d753..719ef1444 100644 --- a/README.txt +++ b/README.txt @@ -99,4 +99,3 @@ Go to Command Terminal $ make theme=blue-icon * Now, open ui/build/index.html in the browser to test the template. - diff --git a/changelog.org b/changelog.org new file mode 100644 index 000000000..19c74cb2c --- /dev/null +++ b/changelog.org @@ -0,0 +1,21 @@ +#+NAME: Changelog + +* <2020-07-03 Fri> + + - Author :: Ojas Mohril + - Changes :: + - Updated makefile =patch-analytics= command to use + =scripts/patch-analytics.sh= instead of the script + from [[https://github.com/virtual-labs/vlabs-analytics][vlabs-analytics]]. + - This script is taken from the [[https://github.com/virtual-labs/vlabs-analytics][vlabs-analytics]] repo but updated + to ignore =content*.html= files. Justification for why this is + needed can be found in [[https://github.com/virtual-labs/problem-solving-iiith/issues/1213][this]] issue. (In brief, content*.html + files are not really html and break when touched by the + analytics code.) + - As a result of this change, the submission files will no longer + have analytics snippet and these page views will not be tracked. + - Removed all committed submission*.html files and added the + pattern to gitignore. These are radomly generated files and + should not be added to version control. + - As the broken content files were comitted at some point on the + master, the working files had to extracted from [[https://github.com/virtual-labs/problem-solving-iiith/commit/591c7f3c91d260a9a0ef12385c62be3b63577e44][this]] commit. diff --git a/scripts/gtm-patcher.py b/scripts/gtm-patcher.py new file mode 100755 index 000000000..fe86b64c1 --- /dev/null +++ b/scripts/gtm-patcher.py @@ -0,0 +1,110 @@ +#!/usr/bin/python + +from bs4 import BeautifulSoup, Tag, Comment +import sys + +headSnippet = """(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': +new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], +j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= +'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); +})(window,document,'script','dataLayer','GTM-W59SWTR');""" + +iframeSrc = "https://www.googletagmanager.com/ns.html?id=GTM-W59SWTR" + + +insert_head = "" +def patch_php(filepath): + # print(filepath) + try: + if(1): + f1 = open(filepath,"r") + lines = f1.readlines() + string_inserted = '' + for line in lines: + if(" + - +
@@ -34,13 +32,14 @@
@@ -56,16 +55,16 @@ @@ -79,7 +78,7 @@
-
+

@@ -87,13 +86,15 @@ -
-

Computer Science & Engineering

+
+ +

Computer Science & Engineering

@@ -110,68 +111,55 @@

Problem Solving Lab

- +
- - + + @@ -222,4 +210,5 @@

}); - + + diff --git a/src/lab/Feedback.html b/src/lab/Feedback.html index e44f78ccb..7a5681fec 100644 --- a/src/lab/Feedback.html +++ b/src/lab/Feedback.html @@ -1,32 +1,30 @@ - - - - - - - - - + + + + + + + Welcome to Virtual Labs - A MHRD Govt of india Initiative - + - - + + - + - + - +
@@ -34,13 +32,14 @@
@@ -48,7 +47,7 @@ @@ -79,7 +78,7 @@
-
+ -
+ -
-

Follow us

- - - - - -
-
- + +
+

- - + + @@ -219,4 +229,6 @@

}); - + + + diff --git a/src/lab/Introduction.html b/src/lab/Introduction.html index 58b943249..c0d27d761 100644 --- a/src/lab/Introduction.html +++ b/src/lab/Introduction.html @@ -1,32 +1,30 @@ - - - - - - - - - + + + + + + + Welcome to Virtual Labs - A MHRD Govt of india Initiative - + - - + + - + - + - +
@@ -34,13 +32,14 @@
@@ -56,16 +55,16 @@ @@ -79,7 +78,7 @@
-
+

@@ -87,13 +86,15 @@ -
-

Computer Science & Engineering

+
+ +

Computer Science & Engineering

@@ -113,68 +114,56 @@

Problem Solving Lab

- +
- - + + @@ -225,4 +214,6 @@

}); - + + + diff --git a/src/lab/List of experiments.html b/src/lab/List of experiments.html index 086545ebb..51e503259 100644 --- a/src/lab/List of experiments.html +++ b/src/lab/List of experiments.html @@ -1,32 +1,30 @@ - - - + - - - - - + + + + + Welcome to Virtual Labs - A MHRD Govt of india Initiative - + - - + + - + - + - +
@@ -34,13 +32,14 @@
@@ -48,7 +47,7 @@ @@ -79,7 +78,7 @@
-
+ - - + + @@ -263,4 +253,6 @@

}); - + + + diff --git a/src/lab/Prerequisites.html b/src/lab/Prerequisites.html index 081b4c112..53d5c8cd4 100644 --- a/src/lab/Prerequisites.html +++ b/src/lab/Prerequisites.html @@ -1,32 +1,30 @@ - - - - - - - - - + + + + + + + Welcome to Virtual Labs - A MHRD Govt of india Initiative - + - - + + - + - + - +
@@ -34,13 +32,14 @@
@@ -48,7 +47,7 @@ @@ -79,7 +78,7 @@
-
+

@@ -87,24 +86,26 @@ - @@ -115,67 +116,55 @@

Problem Solving Lab

- +
- - + + @@ -226,4 +215,6 @@

}); - + + + diff --git a/src/lab/Target Audience.html b/src/lab/Target Audience.html index 91251e578..2732bf084 100644 --- a/src/lab/Target Audience.html +++ b/src/lab/Target Audience.html @@ -1,32 +1,30 @@ - - - - - - - - - + + + + + + + Welcome to Virtual Labs - A MHRD Govt of india Initiative - + - - + + - + - + - +
@@ -34,13 +32,14 @@
@@ -48,7 +47,7 @@ @@ -79,7 +78,7 @@
-
+

@@ -87,13 +86,15 @@ -
-

Computer Science & Engineering

+
+ +

Computer Science & Engineering

@@ -111,68 +112,56 @@

Problem Solving Lab

- +
- - + + @@ -223,4 +212,6 @@

}); - + + + diff --git a/src/lab/default.html b/src/lab/default.html index fe98c3bff..fc64f8072 100644 --- a/src/lab/default.html +++ b/src/lab/default.html @@ -1,13 +1,8 @@ - - - - - - + UI Manual - +
@@ -16,13 +11,13 @@
-