Bladeren bron

согласие на обработку персональных данных

alexlcdee 8 jaren geleden
bovenliggende
commit
76a36369fa

+ 9 - 1
app/assets/scripts/comments.js

@@ -96,15 +96,22 @@ var Comments;
             }
             this.formData = { answerTo: targetId };
         };
+        CommentForm.prototype.isRulesAccepted = function () {
+            return $('#acceptRules').is(':checked');
+        };
         CommentForm.prototype.submitFrom = function (e) {
             e.preventDefault();
+            $('.comments__add-error').remove();
+            if (!this.isRulesAccepted()) {
+                this.form.prepend($('<p class="comments__add-error">Необходимо дать согласие на обработку персональных данных.</p>'));
+                return false;
+            }
             var data = this.form.serializeArray();
             for (var i in data) {
                 if (data.hasOwnProperty(i)) {
                     this.formData[data[i].name] = data[i].value;
                 }
             }
-            $('.comments__add-error').remove();
             console.dir({ UserComments: this.formData });
             $.ajax({
                 url: this.owner.postEndpointUrl,
@@ -132,6 +139,7 @@ var Comments;
             }).bind(this)).always((function () {
                 this.formData = [];
             }).bind(this));
+            return true;
         };
         return CommentForm;
     }());

+ 17 - 0
app/assets/styles/content/centerbar/comments.scss

@@ -267,4 +267,21 @@
         font-size: 13px;
         color: #f00;
     }
+
+    &__accept-rules {
+        color: #595959;
+        margin-top: 10px;
+
+        input[type=checkbox] {
+            -webkit-appearance: checkbox;
+            -moz-appearance: checkbox;
+            appearance: checkbox;
+            vertical-align: top;
+        }
+
+        label {
+            width: 90%;
+            display: inline-block;
+        }
+    }
 }

+ 14 - 1
app/assets/ts/comments.ts

@@ -106,15 +106,27 @@ namespace Comments {
             this.formData = {answerTo: targetId};
         }
 
+        private isRulesAccepted() {
+            return $('#acceptRules').is(':checked');
+        }
+
         private submitFrom(e) {
             e.preventDefault();
+
+            $('.comments__add-error').remove();
+
+            if (!this.isRulesAccepted()) {
+                this.form.prepend($('<p class="comments__add-error">Необходимо дать согласие на обработку персональных данных.</p>'));
+                return false;
+            }
+
             let data = this.form.serializeArray();
             for (let i in data) {
                 if (data.hasOwnProperty(i)) {
                     this.formData[data[i].name] = data[i].value;
                 }
             }
-            $('.comments__add-error').remove();
+
             console.dir({UserComments: this.formData});
             $.ajax({
                 url: this.owner.postEndpointUrl,
@@ -141,6 +153,7 @@ namespace Comments {
             }).bind(this)).always((function () {
                 this.formData = [];
             }).bind(this));
+            return true;
         }
     }
 

+ 17 - 0
app/www/css/all.css

@@ -3118,6 +3118,23 @@ body {
   font-size: 13px;
   color: #f00; }
 
+.comments__accept-rules {
+    color: #595959;
+    margin-top: 10px;
+}
+
+.comments__accept-rules input[type=checkbox] {
+    -webkit-appearance: checkbox;
+    -moz-appearance: checkbox;
+    appearance: checkbox;
+    vertical-align: top;
+}
+
+.comments__accept-rules label {
+    width: 90%;
+    display: inline-block;
+}
+
 .organization-info__container {
   box-sizing: border-box;
   border: 1px solid #ebebeb;

File diff suppressed because it is too large
+ 0 - 0
app/www/css/all.css.map


File diff suppressed because it is too large
+ 0 - 0
app/www/css/all.min.css


File diff suppressed because it is too large
+ 0 - 0
app/www/js/all.min.js


Some files were not shown because too many files changed in this diff