accurator/commit

Check and corrected form logic.

authorChris Dijkshoorn
Mon Apr 4 09:24:56 2016 +0200
committerChris Dijkshoorn
Mon Apr 4 09:24:56 2016 +0200
commit0538a4a4d3ce0aea3176b51cc121c7b928eecdb5
tree4a4f0b6bf2068a334321647fa11268906b1f911f
parentf704b6b665d4423691f5024ecff5d450c64da25a
Diff style: patch stat
diff --git a/rdf/ui/labels.ttl b/rdf/ui/labels.ttl
index ebf664d..972ebdc 100644
--- a/rdf/ui/labels.ttl
+++ b/rdf/ui/labels.ttl
@@ -63,7 +63,7 @@ aui:item a auis:UI ;
 	aui:navbarBtnRecommend "Recommended works"@en ;
 	aui:navbarBtnSearch "Search"@en ;
 	aui:itemHdrFirst "Your first tag!"@en ;
-	aui:itemTxtFirst "Start dragging a bounding box around the object you want to describe. Multiple fields can be filled in, try to be as precise as possible. To proceed to a next object, either click on next image, get new recommendations or search for specific topics."@en .
+	aui:itemTxtFirst "Start dragging a bounding box around the object you want to describe. Multiple fields can be filled in, try to be as precise as possible. To proceed to a next object, either click on next image, get recommended works or search for specific topics."@en .
 
 aui:title rdfs:subPropertyOf auis:uiLabel .
 aui:itemBtnPrevious rdfs:subPropertyOf auis:uiLabel .
@@ -244,11 +244,9 @@ aui:navbarLblProfile rdfs:subPropertyOf auis:uiLabel .
 aui:form a auis:UI ;
 	dcterms:title "Accurator additional info UI"@en  ;
 	aui:formPageTitle "Info"@en ;
-	aui:formHdrInternetUsage "Internet usage"@en ;
-	aui:formHdrPersonalInfo "Personal info"@en ;
-	aui:formHdrSlogan "Tell us about yourself"@en ;
-	aui:formHdrSubSlogan "it would help us a lot if you would provide us with the following information"@en ;
-	aui:formBtnAdd "Add Additional Info"@en ;
+	aui:formHdrInternetUsage "Help us do research by providing us with the following information about your internet usage"@en ;
+	aui:formHdrPersonalInfo "Help us do research by providing us with the following information"@en ;
+	aui:formBtnAdd "Save info"@en ;
 	aui:formBtnSkip "or skip this step"@en ;
 	aui:formLblBirthDate "Date of birth"@en ;
 	aui:formLblGender "Gender"@en ;
@@ -286,8 +284,6 @@ aui:form a auis:UI ;
 aui:formPageTitle rdfs:subPropertyOf auis:uiLabel .
 aui:formHdrInternetUsage rdfs:subPropertyOf auis:uiLabel .
 aui:formHdrPersonalInfo rdfs:subPropertyOf auis:uiLabel .
-aui:formHdrSlogan rdfs:subPropertyOf auis:uiLabel .
-aui:formHdrSubSlogan rdfs:subPropertyOf auis:uiLabel .
 aui:formBtnAdd rdfs:subPropertyOf auis:uiLabel .
 aui:formBtnSkip rdfs:subPropertyOf auis:uiLabel .
 aui:formLblBirthDate rdfs:subPropertyOf auis:uiLabel .
diff --git a/rdf/ui/labels_nl.ttl b/rdf/ui/labels_nl.ttl
index 024b021..e3e6212 100644
--- a/rdf/ui/labels_nl.ttl
+++ b/rdf/ui/labels_nl.ttl
@@ -41,7 +41,7 @@ aui:item a auis:UI ;
 	aui:navbarBtnRecommend "Aanbevolen werken"@nl ;
 	aui:navbarBtnSearch "Zoek"@nl ;
 	aui:itemHdrFirst "De eerste keer informatie toevoegen!"@nl ;
-	aui:itemTxtFirst "Begin met het tekenen van een  kader om informatie toe te voegen. U krijgt hierop verschillende velden om in te vullen, probeer hierbij zo precies mogelijk te zijn. Om naar een volgende afbeeldingen te gaan kunt u op volgende klikken, zoeken of nieuwe aanbevelingen bekijken."@nl .
+	aui:itemTxtFirst "Begin met het tekenen van een  kader om informatie toe te voegen. U krijgt hierop verschillende velden om in te vullen, probeer hierbij zo precies mogelijk te zijn. Om naar een volgende afbeeldingen te gaan kunt u op volgende klikken, zoeken of aanbevolen werken bekijken."@nl .
 
 ##### Expertise Screen #####
 
@@ -141,10 +141,8 @@ aui:userDropdown a auis:UI ;
 
 aui:form a auis:UI ;
 	aui:formPageTitle "Informatie"@nl ;
-	aui:formHdrInternetUsage "Internet gebruik"@nl ;
-	aui:formHdrPersonalInfo "Persoonlijke informatie"@nl ;
-	aui:formHdrSlogan "Vertel iets over uzelf"@nl ;
-	aui:formHdrSubSlogan "het zou ons veel helpen als u de volgende informatie verstrekt"@nl ;
+	aui:formHdrInternetUsage "Help ons onderzoek door het invullen van onderstaande informatie over uw internet gebruik"@nl ;
+	aui:formHdrPersonalInfo "Help ons onderzoek door het invullen van onderstaande informatie"@nl ;
 	aui:formBtnAdd "Bevestig"@nl ;
 	aui:formBtnSkip "of sla deze stap over"@nl ;
 	aui:formLblBirthDate "Geboortedatum"@nl ;
diff --git a/web/js/components/form.js b/web/js/components/form.js
index f0b9fc0..b29b6da 100644
--- a/web/js/components/form.js
+++ b/web/js/components/form.js
@@ -245,18 +245,18 @@ Form.prototype.socialBoxes = function(labels) {
         {'id':'facebook', 'label':labels.formChkFacebook},
         {'id':'linkedIn', 'label':labels.formChkLinkedIn},
         {'id':'twitter', 'label':labels.formChkTwitter},
-        {'id':'none', 'label':labels.formChkOther},
+        {'id':'other', 'label':labels.formChkOther},
         {'id':'none', 'label':labels.formChkNone}
     ];
 }
 
 Form.prototype.tagBoxes = function(labels) {
     return boxes = [
-        {'id':'flickr', 'label':labels.formChkTagFlickr},
-        {'id':'delicious', 'label':labels.formChkTagDelicious},
-        {'id':'facebook', 'label':labels.formChkTagFacebook},
-        {'id':'other', 'label':labels.formChkTagOther},
-        {'id':'none', 'label':labels.formChkTagNone}
+        {'id':'tagFlickr', 'label':labels.formChkTagFlickr},
+        {'id':'tagDelicious', 'label':labels.formChkTagDelicious},
+        {'id':'tagFacebook', 'label':labels.formChkTagFacebook},
+        {'id':'tagOther', 'label':labels.formChkTagOther},
+        {'id':'tagNone', 'label':labels.formChkTagNone}
     ];
 }
 
@@ -264,7 +264,6 @@ Form.prototype.processFormFields = function() {
     var info = {};
 
     for (var i=0; i<this.formGroups.length; i++) {
-        console.log(this.formGroups[i]);
         var id = this.formGroups[i].id;
         var value = this.formGroups[i].getValue();
 
@@ -281,9 +280,9 @@ Form.prototype.processFormFields = function() {
 Form.prototype.addFormEvents = function(labels) {
     var _form = this;
 
-	$(this.node).find("#formDivsocialNetwork #formChknone").click(function() {
-		if(!_form.socialFieldAdded) {
-			$("#formDivSocialNetwork").after(
+	$(this.node).find("#formDivsocialNetwork #formChkother").click(function() {
+        if (!_form.socialFieldAdded) {
+            $(_form.node).find("#formDivsocialNetwork").after(
 				$.el.div({'class':'form-group'},
 						$.el.label({'for':'addSocialSite',
 									'id':'frmSocialOpen',
@@ -299,7 +298,7 @@ Form.prototype.addFormEvents = function(labels) {
 
 	$(this.node).find("#formDivsocialNetwork #formChktwitter").click(function() {
 		if(!_form.twitterFieldAdded) {
-			$("#formDivsocialNetwork").after(
+			$(_form.node).find("#formDivsocialNetwork").after(
 				$.el.div({'class':'form-group'},
 						$.el.label({'for':'addTwitterId',
 									'id':'formLblTwitterId',
@@ -313,9 +312,9 @@ Form.prototype.addFormEvents = function(labels) {
 		}
 	});
 
-	$(this.node).find("#formDivtaggingSites #formChkother").click(function() {
-		if(!_form.tagsiteFieldAdded) {
-			$("#formDivTaggingSite").after(
+	$(this.node).find("#formDivtaggingSites #formChktagOther").click(function() {
+        if(!_form.tagsiteFieldAdded) {
+			$(_form.node).find("#formDivtaggingSites").after(
 				$.el.div({'class':'form-group'},
 					$.el.label({'for':'addTagSite',
 							    'id':'formLblTagSite',
@@ -479,26 +478,28 @@ SocialCheckBoxFormGroup.prototype = Object.create(CheckBoxFormGroup.prototype);
 SocialCheckBoxFormGroup.prototype.getValue = function() {
     var info = {};
 
-    if($("#formChknone").is(":checked")) {
+    if($(this.node).find("#formChknone").is(":checked")) {
         info.facebook = false;
         info.linked_in = false;
         info.twitter = false;
     } else {
-        if ($("#formChkfacebook").is(":checked"))
+        if ($(this.node).find("#formChkfacebook").is(":checked"))
             info.facebook = true;
-        if ($("#formChklinkedIn").is(":checked"))
+        if ($(this.node).find("#formChklinkedIn").is(":checked"))
             info.linked_in = true;
-        //Set twitter to true when no id is given but box is checked
-        if ($("#formChktwitter").is(":checked")) {
-            if (!($("#addTwitterId").val() === undefined) && !($("#addTwitterId").val() === "")) {
+        // set twitter to true when no id is given but box is checked
+        if ($(this.node).find("#formChktwitter").is(":checked")) {
+            if (!($("#addTwitterId").val() === undefined) &&
+                !($("#addTwitterId").val() === "")) {
                 info.twitter = $("#addTwitterId").val();
             } else {
                 info.twitter = true;
             }
         }
-        //Set social to true
-        if ($("#formChkother").is(":checked")) {
-            if (!($("#addSocialSite").val() === undefined) && !($("#addSocialSite").val() === "")) {
+        // set social to true
+        if ($(this.node).find("#formChkother").is(":checked")) {
+            if (!($("#addSocialSite").val() === undefined) &&
+                !($("#addSocialSite").val() === "")) {
                 info.other_social_site = $("#addSocialSite").val();
             } else {
                 info.other_social_site = true;
@@ -518,22 +519,23 @@ TagCheckBoxFormGroup.prototype = Object.create(CheckBoxFormGroup.prototype);
 TagCheckBoxFormGroup.prototype.getValue = function() {
     var info = {};
 
-    if($("#formChkTagNone").is(":checked")) {
+    if($(this.node).find("#formChktagNone").is(":checked")) {
         info.flickr = false;
         info.delicious = false;
         info.tag_facebook = false;
         info.other = false;
     } else {
-        if ($("#formChkTagFlickr").is(":checked"))
+        if ($(this.node).find("#formChktagFlickr").is(":checked"))
             info.flickr = true;
-        if ($("#formChkTagDelicious").is(":checked"))
+        if ($(this.node).find("#formChktagDelicious").is(":checked"))
             info.delicious = true;
-        if ($("#formChkTagFacebook").is(":checked"))
+        if ($(this.node).find("#formChktagFacebook").is(":checked"))
             info.tag_facebook = true;
 
-        //Set tagsite to true
-        if ($("#formChkTagOther").is(":checked")) {
-            if (!($("#addTagSite").val() === undefined) && !($("#addTagSite").val() === "")) {
+        // set tagsite to true
+        if ($(this.node).find("#formChktagOther").is(":checked")) {
+            if (!($("#addTagSite").val() === undefined) &&
+                !($("#addTagSite").val() === "")) {
                 info.other_tag_site = $("#addTagSite").val();
             } else {
                 info.other_tag_site = true;
@@ -551,7 +553,7 @@ function MailBoxFormGroup(id, label, boxes) {
 MailBoxFormGroup.prototype = Object.create(CheckBoxFormGroup.prototype);
 
 MailBoxFormGroup.prototype.getValue = function() {
-    if($("#formChk" + this.id).is(":checked")) {
+    if($(this.node).find("#formChk" + this.id).is(":checked")) {
 		return true;
 	} else {
 		return false;
diff --git a/web/js/item.js b/web/js/item.js
index d23e20f..8d4b576 100644
--- a/web/js/item.js
+++ b/web/js/item.js
@@ -116,6 +116,7 @@ function initLabels(labelData) {
 function events(user, locale, labels) {
 	return $.getJSON("annotations", {uri:user, type:"user"})
 	.then(function(annotations) {
+		console.log(annotations.length);
 		if(annotations.length === 0) {
 			alertMessage(labels.itemHdrFirst, labels.itemTxtFirst, 'success');
 		}
@@ -132,7 +133,7 @@ function events(user, locale, labels) {
 			});
 		}
 
-		if(annotations.length === 10) {
+		if(annotations.length === 1) {
 			var formInternet = new Form(
 				"formInternet",
 				["socialNetwork", "taggingSites", "taggingExperience", "mail", "mailCheck"],