{"ast":null,"code":"import server from \"@/assets/js/scripts\";\nexport default {\n  props: [\"token\", \"serverpublic\", \"likes\", \"post\", \"p\", \"token\", \"au\"],\n  methods: {\n    comments(post) {\n      if (localStorage.getItem(\"token\")) {\n        let comment = new FormData();\n        comment.append(\"comment\", this.comment);\n        server.postData(\"comments=\" + post, \"POST\", add).then(res => {\n          if (res.errors) {\n            server.parseErrors(\"comment\", res.errors);\n          }\n        });\n      }\n    }\n  },\n  mounted() {\n    this.post();\n  }\n};","map":{"version":3,"names":["server","props","methods","comments","post","localStorage","getItem","comment","FormData","append","postData","add","then","res","errors","parseErrors","mounted"],"sources":["C:\\xampp\\htdocs\\blog_vue1t\\src\\components\\Post.vue"],"sourcesContent":["<template>\r\n    <article class=\"post\" v-for=\"(post) in p\">\r\n\r\n        <header>\r\n            <div class=\"title\">\r\n                <h2><a href=\"#\">\r\n                        {{ post.header }}\r\n                    </a></h2>\r\n                <p>\r\n                    {{ post.subheader }}\r\n                </p>\r\n            </div>\r\n            <div class=\"meta\">\r\n                <time class=\"published\" datetime=\"{{ postdatepost }}\">\r\n                    {{ post.datepost }}\r\n                </time>\r\n                <a href=\"{{Route('user', post.user_id)}}\" class=\"author\"><span class=\"name\">\r\n                        {{ post.user.fullname }}\r\n                    </span></a>\r\n            </div>\r\n        </header>\r\n        <span class=\"image featured\"><img :src=\"serverpublic + post.photo\" alt=\"\" /></span>\r\n\r\n        <p>\r\n            {{ post.anons }}\r\n        </p>\r\n\r\n        <p>\r\n            {{ post.post }}\r\n        </p>\r\n        <footer>\r\n            <ul class=\"stats\" v-if=\"au.id == post.user_id\">\r\n                @if(Auth::id() == post.user_id)\r\n                <li><a href=\"{{Route('edit', post.id)}}\">Edit</a></li>\r\n                <li><a href=\"{{Route('deletepost', post.id)}}\" class=\"red\">Delete</a></li>\r\n                <li><a href=\"{{Route('blockpost', post.id)}}\" class=\"red\"></a></li>\r\n                @endif\r\n                <li><a class=\"icon fa-heart\" @click=\"likes(post.id)\">{{ post.likes_count }}</a></li>\r\n                <li><a href=\"#comm\" class=\"icon fa-comment\">{{ post.comments_count }}</a></li>\r\n            </ul>\r\n        </footer>\r\n    </article>\r\n    <div class=\"post\">\r\n        <section class=\"comments\">\r\n            <h3 id=\"comm\">Comments</h3>\r\n            <div>\r\n                <textarea name='comment' style='resize: none;'></textarea><br>\r\n                <h5 style=\"text-align: center; color: red;\">\r\n                </h5>\r\n                <input type=\"submit\" name=\"addcomment\" @click=\"comments(post.id)\" class=\"button big fit\" value=\"Add Comment\">\r\n            </div>\r\n        </section>\r\n\r\n        @foreach ($comments as $comment)\r\n        <article class=\"comment\">\r\n            <div class=\"comment-autor\">\r\n                <a href=\"\"></a>\r\n                <!-- <a href=\"\">{{ comment.user.fullname }}</a> -->\r\n            </div>\r\n            <p>\r\n                <!-- {{ comment.comment }} -->\r\n            </p>\r\n        </article>\r\n    </div>\r\n</template>\r\n<script>\r\nimport server from \"@/assets/js/scripts\";\r\n\r\nexport default {\r\n    props: [\"token\", \"serverpublic\", \"likes\", \"post\", \"p\", \"token\", \"au\",],\r\n    methods: {\r\n        comments(post) {\r\n            if (localStorage.getItem(\"token\")) {\r\n                let comment = new FormData();\r\n                comment.append(\"comment\", this.comment)\r\n                server.postData(\"comments=\" + post, \"POST\", add).then((res) => {\r\n                    if (res.errors) {\r\n                        server.parseErrors(\"comment\", res.errors);\r\n                    }\r\n                });\r\n            }\r\n        },\r\n    },\r\n    mounted() {\r\n        this.post();\r\n    },\r\n};\r\n</script>"],"mappings":"AAkEA,OAAOA,MAAK,MAAO,qBAAqB;AAExC,eAAe;EACXC,KAAK,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAE;EACtEC,OAAO,EAAE;IACLC,QAAQA,CAACC,IAAI,EAAE;MACX,IAAIC,YAAY,CAACC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC/B,IAAIC,OAAM,GAAI,IAAIC,QAAQ,CAAC,CAAC;QAC5BD,OAAO,CAACE,MAAM,CAAC,SAAS,EAAE,IAAI,CAACF,OAAO;QACtCP,MAAM,CAACU,QAAQ,CAAC,WAAU,GAAIN,IAAI,EAAE,MAAM,EAAEO,GAAG,CAAC,CAACC,IAAI,CAAEC,GAAG,IAAK;UAC3D,IAAIA,GAAG,CAACC,MAAM,EAAE;YACZd,MAAM,CAACe,WAAW,CAAC,SAAS,EAAEF,GAAG,CAACC,MAAM,CAAC;UAC7C;QACJ,CAAC,CAAC;MACN;IACJ;EACJ,CAAC;EACDE,OAAOA,CAAA,EAAG;IACN,IAAI,CAACZ,IAAI,CAAC,CAAC;EACf;AACJ,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}