xcbosa-itx 2 жил өмнө
parent
commit
2f188afdd9

+ 1 - 1
controller/StaticWebPageController.cpp

@@ -95,7 +95,7 @@ namespace xc::controller {
                     b(it["name"]),
                     b(it["name"]),
                     ", You password is ",
                     ", You password is ",
                     it["pwd"]
                     it["pwd"]
-                });
+                }).style("text-align", "center");
             })
             })
         });
         });
     }
     }

+ 18 - 0
processor/templates/ViewTemplatePrototypes.cpp

@@ -115,6 +115,24 @@ namespace xc {
                 }
                 }
             }
             }
 
 
+            ViewTemplatePrototype& ViewTemplatePrototype::klass(string value) { return this->prop("class", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::classAdd(string klass) {
+                if (this->properties.find("class") == this->properties.end()) {
+                    this->properties["class"] = klass;
+                } else {
+                    this->properties["class"] += klass + " ";
+                }
+                return *this;
+            }
+            ViewTemplatePrototype& ViewTemplatePrototype::contenteditable(bool value) { return this->prop("contenteditable", value ? "true" : "false"); }
+            ViewTemplatePrototype& ViewTemplatePrototype::dir(string value) { return this->prop("dir", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::draggable(bool value) { return this->prop("draggable", value ? "true" : "false"); }
+            ViewTemplatePrototype& ViewTemplatePrototype::hidden(bool value) { return this->prop("hidden", value ? "true" : "false"); }
+            ViewTemplatePrototype& ViewTemplatePrototype::id(string value) { return this->prop("id", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::lang(string value) { return this->prop("lang", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::spellcheck(bool value) { return this->prop("spellcheck", value ? "true" : "false"); }
+            ViewTemplatePrototype& ViewTemplatePrototype::title(string value) { return this->prop("title", value); }
+
             Foreach::Foreach(vector<JsonModel> model, function<ViewTemplatePrototype(JsonModel)> generateBlock): ViewTemplatePrototype("") {
             Foreach::Foreach(vector<JsonModel> model, function<ViewTemplatePrototype(JsonModel)> generateBlock): ViewTemplatePrototype("") {
                 ostringstream oss;
                 ostringstream oss;
                 for (JsonModel t : model) {
                 for (JsonModel t : model) {

+ 11 - 0
processor/templates/ViewTemplatePrototypes.h

@@ -23,6 +23,17 @@ namespace xc {
                 ViewTemplatePrototype& style(string key, string value);
                 ViewTemplatePrototype& style(string key, string value);
                 ViewTemplatePrototype& inner(vector<ViewTemplatePrototype> inner);
                 ViewTemplatePrototype& inner(vector<ViewTemplatePrototype> inner);
                 ViewTemplatePrototype& inner(string inner);
                 ViewTemplatePrototype& inner(string inner);
+
+                ViewTemplatePrototype& klass(string value);
+                ViewTemplatePrototype& classAdd(string klass);
+                ViewTemplatePrototype& contenteditable(bool value);
+                ViewTemplatePrototype& dir(string value);
+                ViewTemplatePrototype& draggable(bool value);
+                ViewTemplatePrototype& hidden(bool value);
+                ViewTemplatePrototype& id(string value);
+                ViewTemplatePrototype& lang(string value);
+                ViewTemplatePrototype& spellcheck(bool value);
+                ViewTemplatePrototype& title(string value);
             protected:
             protected:
                 string innerHTML;
                 string innerHTML;
             private:
             private: