From 89d44f08e1e1a44c5d4536020e6e1f01b5f77ecc Mon Sep 17 00:00:00 2001 From: GrahamQuince Date: Thu, 26 Nov 2015 15:48:25 +0000 Subject: [PATCH 1/5] Site icon as image & Assignment list Two snippets: Site icon displays a site's icon as its image Assignment List lists out the assignments for a student without them accessing the app --- assignments-list/README.md | 2 + assignments-list/snippet.html | 128 ++++++++++++++++++++++++++++++++ site-icon-as-image/README.md | 4 + site-icon-as-image/snippet.html | 18 +++++ 4 files changed, 152 insertions(+) create mode 100644 assignments-list/README.md create mode 100644 assignments-list/snippet.html create mode 100644 site-icon-as-image/README.md create mode 100644 site-icon-as-image/snippet.html diff --git a/assignments-list/README.md b/assignments-list/README.md new file mode 100644 index 0000000..7860605 --- /dev/null +++ b/assignments-list/README.md @@ -0,0 +1,2 @@ +This snippet displays a list of open assignments for a student and display them in a table + diff --git a/assignments-list/snippet.html b/assignments-list/snippet.html new file mode 100644 index 0000000..c0014bc --- /dev/null +++ b/assignments-list/snippet.html @@ -0,0 +1,128 @@ + + + + diff --git a/site-icon-as-image/README.md b/site-icon-as-image/README.md new file mode 100644 index 0000000..b612f14 --- /dev/null +++ b/site-icon-as-image/README.md @@ -0,0 +1,4 @@ +Site Icon as Image + ++Drop this code into your site in an HTML widget ++As the site loads, it will display the icon \ No newline at end of file diff --git a/site-icon-as-image/snippet.html b/site-icon-as-image/snippet.html new file mode 100644 index 0000000..33c09d6 --- /dev/null +++ b/site-icon-as-image/snippet.html @@ -0,0 +1,18 @@ +
+ + From 15e5073635f974dd9f2b24cc461cc5687e8d8a08 Mon Sep 17 00:00:00 2001 From: GrahamQuince Date: Mon, 4 Apr 2016 10:02:18 +0100 Subject: [PATCH 2/5] Added correct code for assignments and improved site icon code based on feedback --- assignments-list/snippet.html | 168 +++++++++----------------------- site-icon-as-image/snippet.html | 24 +++-- 2 files changed, 63 insertions(+), 129 deletions(-) diff --git a/assignments-list/snippet.html b/assignments-list/snippet.html index c0014bc..18f29f3 100644 --- a/assignments-list/snippet.html +++ b/assignments-list/snippet.html @@ -1,128 +1,54 @@ - - - - + ); + } + ); + +}); + + +arguments[0].append($assignmentsList); + \ No newline at end of file diff --git a/site-icon-as-image/snippet.html b/site-icon-as-image/snippet.html index 33c09d6..0aeedd9 100644 --- a/site-icon-as-image/snippet.html +++ b/site-icon-as-image/snippet.html @@ -1,18 +1,26 @@ -
- + From 286ee3f98e2aafa62ec79763caf95018be6d1088 Mon Sep 17 00:00:00 2001 From: GrahamQuince Date: Tue, 5 Apr 2016 08:55:15 +0100 Subject: [PATCH 3/5] Updated based on feedback Site icon is commented, assignments list rewritten for student accessing latest assignments --- assignments-list/snippet.html | 25 ++++++++++++++----------- site-icon-as-image/snippet.html | 6 +++++- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/assignments-list/snippet.html b/assignments-list/snippet.html index 18f29f3..c63a929 100644 --- a/assignments-list/snippet.html +++ b/assignments-list/snippet.html @@ -15,29 +15,32 @@ 'Instructions'+ ''+ '' - ); + ), + user = FrogOS.getUser(); Frog.Model - .api('assignmentspupils.getmyassigned', { - status: 'open', - limit: 5, - offset: 0 + .api('assignmentreports.getData', { + filter: {status:"open"}, + limit:15, + offset:0, + options: {child_uuid:user.uuid}, + report_name:"student.assignments" }).done(function(assignmentResponse) { - console.log(assignmentResponse.data.assignments); - assignmentResponse.data.assignments.forEach(function(work, index) { + console.log(assignmentResponse.data); + assignmentResponse.data.forEach(function(work, index) { - var dueDate = new Date(work.assignment.end * 1000).toDateString(); + var dueDate = moment.unix(work.due_date).format("DD/MM/YY"); $assignmentsList .append($( ''+ ''+ - work.assignment.subject.name+ + work.subject_name+ ''+ - work.assignment.alias+ + work.assignment_name+ ''+ - work.assignment.message+ + work.instructions+ ''+ dueDate+ ''+ diff --git a/site-icon-as-image/snippet.html b/site-icon-as-image/snippet.html index 0aeedd9..9efc7f2 100644 --- a/site-icon-as-image/snippet.html +++ b/site-icon-as-image/snippet.html @@ -1,5 +1,7 @@ \ No newline at end of file + diff --git a/site-icon-as-image/snippet.html b/site-icon-as-image/snippet.html index 9efc7f2..aeff376 100644 --- a/site-icon-as-image/snippet.html +++ b/site-icon-as-image/snippet.html @@ -1,30 +1,28 @@ + From 3b57584aeadb4b54fad706d6e7373705244466f5 Mon Sep 17 00:00:00 2001 From: GrahamQuince Date: Thu, 14 Apr 2016 14:53:32 +0100 Subject: [PATCH 5/5] My teachers, tabbed buckets and site shared status Added some a third snipped based on a school's request --- my-teachers/README.md | 2 + my-teachers/snippet.html | 55 ++++++++++++++++++ site-shared-status/README.md | 4 ++ site-shared-status/snippet.html | 50 +++++++++++++++++ tabbed-buckets/README.md | 2 + tabbed-buckets/sniipet.html | 99 +++++++++++++++++++++++++++++++++ 6 files changed, 212 insertions(+) create mode 100644 my-teachers/README.md create mode 100644 my-teachers/snippet.html create mode 100644 site-shared-status/README.md create mode 100644 site-shared-status/snippet.html create mode 100644 tabbed-buckets/README.md create mode 100644 tabbed-buckets/sniipet.html diff --git a/my-teachers/README.md b/my-teachers/README.md new file mode 100644 index 0000000..651d7ad --- /dev/null +++ b/my-teachers/README.md @@ -0,0 +1,2 @@ +This snippet displays a list of teachers (technically group leaders) for a logged in user + diff --git a/my-teachers/snippet.html b/my-teachers/snippet.html new file mode 100644 index 0000000..2003478 --- /dev/null +++ b/my-teachers/snippet.html @@ -0,0 +1,55 @@ + + + diff --git a/site-shared-status/README.md b/site-shared-status/README.md new file mode 100644 index 0000000..09c00a5 --- /dev/null +++ b/site-shared-status/README.md @@ -0,0 +1,4 @@ +Site shared status + ++Drop this code into your site in an HTML widget ++As the site loads, it display using a padlock icon whether the site is private or not \ No newline at end of file diff --git a/site-shared-status/snippet.html b/site-shared-status/snippet.html new file mode 100644 index 0000000..4096325 --- /dev/null +++ b/site-shared-status/snippet.html @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/tabbed-buckets/README.md b/tabbed-buckets/README.md new file mode 100644 index 0000000..061ebb5 --- /dev/null +++ b/tabbed-buckets/README.md @@ -0,0 +1,2 @@ +This snippet hides all the buckets (page layout sections) except for the top bucket (bucket 1). It resets the width of each bucket to 100%, then allows to you switch between buckets using a set of buttons which look like tabs + diff --git a/tabbed-buckets/sniipet.html b/tabbed-buckets/sniipet.html new file mode 100644 index 0000000..21a562d --- /dev/null +++ b/tabbed-buckets/sniipet.html @@ -0,0 +1,99 @@ + + +
+
Bucket 2
+
Bucket 3
+
Bucket 4
+
Bucket 5
+
Bucket 6
+
Bucket 7
+
+ +