From 4ed4e16b60e328d400b44b02be54d932d5e5e550 Mon Sep 17 00:00:00 2001 From: voltan Date: Sun, 6 Aug 2017 12:36:01 +0430 Subject: [PATCH] Work on ask module --- asset/css/front.css | 22 +- locale/en/admin.mo | Bin 452 -> 412 bytes locale/en/admin.po | 134 ++++---- locale/en/default.mo | Bin 452 -> 412 bytes locale/en/default.po | 354 ++++++++++++++----- locale/fa/admin.mo | Bin 2281 -> 2516 bytes locale/fa/admin.po | 94 +++--- locale/fa/default.mo | Bin 4603 -> 6985 bytes locale/fa/default.po | 356 ++++++++++++++------ src/Api/Breadcrumbs.php | 34 +- src/Api/Project.php | 13 + src/Api/Question.php | 8 +- src/Controller/Front/AnswerController.php | 9 +- src/Controller/Front/QuestionController.php | 27 +- src/Form/AskForm.php | 6 +- src/Form/ProjectForm.php | 2 +- template/front/answer-index.phtml | 34 ++ template/front/answer_index.phtml | 10 - template/front/project-list.phtml | 28 +- template/front/question-index.phtml | 111 ++++++ template/front/question-list.phtml | 57 +++- template/front/question_index.phtml | 50 --- 22 files changed, 967 insertions(+), 382 deletions(-) create mode 100644 template/front/answer-index.phtml delete mode 100644 template/front/answer_index.phtml create mode 100644 template/front/question-index.phtml delete mode 100644 template/front/question_index.phtml diff --git a/asset/css/front.css b/asset/css/front.css index f0de45a..ab56120 100644 --- a/asset/css/front.css +++ b/asset/css/front.css @@ -13,4 +13,24 @@ margin: 0; } -.question-single .question-single-time {} \ No newline at end of file +.question-single .question-single-time {} + +.project-list-single { + padding-bottom: 5px; + margin-bottom: 5px; + border-bottom: 1px solid #ddd; +} + +.answer-single { + padding-bottom: 5px; + margin-bottom: 5px; + border-bottom: 1px solid #ddd; +} + +.question-is-manager { + background: #DFF0D8; +} + +.question-vote { + text-align: left !important; +} \ No newline at end of file diff --git a/locale/en/admin.mo b/locale/en/admin.mo index ccd1eec6e93b97362ae79c8af2688e6d682c67a7..0c574823a11e1a99435cab36ba38ca30e2ce1e89 100644 GIT binary patch delta 52 zcmX@YJcoIL3S-hlReJ$*T>}eU12Y9fBP(N5Z3B~uC0ki6^bCzA>o5i|>*?!Fu4a^E I*5hIT0AI5V9smFU delta 92 zcmbQke1v&|3S-wqReJ$bT?1oXBTEHCLn}jLZ3E+pC0m)z^-L%0G6qa;WRx(_FH0=a uFE20G&nU^w(a*_GPR!9S$OIx?BRx|+1O3wCBK_R_l+v73{lwyIE(QS0FB^*h diff --git a/locale/en/admin.po b/locale/en/admin.po index e0b6fdb..36fecdb 100644 --- a/locale/en/admin.po +++ b/locale/en/admin.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2015-03-29 11:13+0330\n" +"POT-Creation-Date: 2017-08-06 12:35+0430\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -9,141 +9,145 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.5\n" +"X-Generator: Poedit 1.8.12\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: _a;_t\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: /var/www/html/local/pi/pi-2.5.0/usr/module/ask\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SearchPath-0: .\n" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/comment.php:15 -msgid "Ask comments" +#: config/config.php:16 +msgid "Admin" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:16 -msgid "Admin" +#: config/config.php:20 +msgid "Show" +msgstr "" + +#: config/config.php:24 config/page.php:53 +msgid "Question" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:20 -msgid "Front" +#: config/config.php:28 +msgid "Project" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:24 +#: config/config.php:32 msgid "Feed" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:28 +#: config/config.php:36 msgid "Vote" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:36 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:45 +#: config/config.php:44 config/config.php:53 msgid "Perpage" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:46 +#: config/config.php:54 msgid "Number of questions in each page" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:53 +#: config/config.php:61 +msgid "Show information" +msgstr "" + +#: config/config.php:69 msgid "Tags" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:54 +#: config/config.php:70 msgid "Number of tags in tag controller" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:60 +#: config/config.php:77 +msgid "Show breadcrumbs" +msgstr "" + +#: config/config.php:86 +msgid "Active project system" +msgstr "" + +#: config/config.php:95 +msgid "Can ask" +msgstr "" + +#: config/config.php:103 +msgid "Can answer" +msgstr "" + +#: config/config.php:110 msgid "Automatic approval" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:66 +#: config/config.php:116 msgid "All questions and answers need admin review before publish" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:67 +#: config/config.php:117 msgid "Automatic approval all questions and answers" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:78 +#: config/config.php:128 msgid "Show feed icon" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:86 +#: config/config.php:136 msgid "Feed number" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:95 +#: config/config.php:145 msgid "Use vote system" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/module.php:15 +#: config/module.php:15 msgid "Ask" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/module.php:16 +#: config/module.php:16 msgid "Ask and Answer" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/navigation.php:16 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:17 +#: config/navigation.php:16 config/page.php:17 config/permission.php:39 msgid "List of Questions" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/navigation.php:26 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:22 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:76 +#: config/navigation.php:26 config/navigation.php:36 config/page.php:22 +#: config/permission.php:45 +msgid "projects" +msgstr "" + +#: config/navigation.php:46 +msgid "New project" +msgstr "" + +#: config/navigation.php:58 config/page.php:27 config/permission.php:51 msgid "Tools" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:30 +#: config/page.php:35 msgid "Index page" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:36 -msgid "Answer" +#: config/page.php:41 +msgid "Project page" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:42 -msgid "Question" +#: config/page.php:47 config/permission.php:30 +msgid "Answer" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:48 +#: config/page.php:59 msgid "Submit question" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:54 +#: config/page.php:65 msgid "Tag" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:17 +#: config/permission.php:17 msgid "Global public resource" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:24 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:46 -msgid "Authors" -msgstr "" - -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:31 -msgid "Favourite" -msgstr "" - -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:40 -msgid "Attach" -msgstr "" - -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:52 -msgid "Extra" -msgstr "" - -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:58 -msgid "Spotlight" -msgstr "" - -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:64 -msgid "Story" -msgstr "" - -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:70 -msgid "Topic" +#: config/permission.php:24 +msgid "Submit" msgstr "" diff --git a/locale/en/default.mo b/locale/en/default.mo index 60f371ac121e6aeb617a02761dbf0af59eed0e50..6d9b8c4a8271f43100d1196695ec8814090fd489 100644 GIT binary patch delta 52 zcmX@YJcoIL3S-hlReJ$*T>}eU12Y9fBP(N5Z3B~uC0ki6^bCzA>o5i|>*?!Fu4a^E I*5hIT0AI5V9smFU delta 92 zcmbQke1v&|3S-wqReJ$bT?1oXBTEHCLn}jLZ3E+pC0m)z^-L%0G6qa;WRx(_FH0=a uFE20G&nU^w(a*_GPR!9S$OIx?BRx|+1O3wCBK_R_l+v73{lwyIE(QS0FB^*h diff --git a/locale/en/default.po b/locale/en/default.po index d28eafd..1e43996 100644 --- a/locale/en/default.po +++ b/locale/en/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2015-03-29 11:13+0330\n" +"POT-Creation-Date: 2017-08-06 12:35+0430\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -9,189 +9,389 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.5\n" +"X-Generator: Poedit 1.8.12\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: /var/www/html/local/pi/pi-2.5.0/usr/module/ask\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SearchPath-0: .\n" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:102 +#: src/Api/Breadcrumbs.php:66 src/Api/Breadcrumbs.php:77 +#: template/front/tag_list.phtml:4 +msgid "Tag list" +msgstr "" + +#: src/Api/Breadcrumbs.php:118 +msgid "Answer to question" +msgstr "" + +#: src/Api/Breadcrumbs.php:135 src/Controller/Front/SubmitController.php:120 +msgid "Ask a new Question" +msgstr "" + +#: src/Controller/Admin/ProjectController.php:89 +msgid "Project data saved successfully." +msgstr "" + +#: src/Controller/Admin/ProjectController.php:101 +msgid "Add project" +msgstr "" + +#: src/Controller/Admin/QuestionController.php:85 #, php-format msgid "%s question accept successfully" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:107 +#: src/Controller/Admin/QuestionController.php:90 #, php-format msgid "Error in accept %s question" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:113 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:176 +#: src/Controller/Admin/QuestionController.php:96 +#: src/Controller/Admin/QuestionController.php:185 msgid "Please select question" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:153 +#: src/Controller/Admin/QuestionController.php:154 msgid "Your selected item edit successfully" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:174 +#: src/Controller/Admin/QuestionController.php:183 msgid "Your selected question deleted" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Feed/IndexController.php:25 +#: src/Controller/Feed/IndexController.php:25 msgid "Ask feed" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Feed/IndexController.php:26 +#: src/Controller/Feed/IndexController.php:26 msgid "Recent Questions." msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:42 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/QuestionController.php:33 +#: src/Controller/Front/AnswerController.php:33 +msgid "Answer question not active" +msgstr "" + +#: src/Controller/Front/AnswerController.php:41 +#: src/Controller/Front/QuestionController.php:33 msgid "The question not found." msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:65 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:95 +#: src/Controller/Front/AnswerController.php:54 +#: src/Controller/Front/AnswerController.php:101 #, php-format msgid "Answer to %s" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:83 +#: src/Controller/Front/AnswerController.php:89 msgid "" "Your new answer to this question save successfully, and show under question" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:85 +#: src/Controller/Front/AnswerController.php:91 msgid "" "Your new answer to this question save successfully, But it need review and " "publish by website admin" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/IndexController.php:69 -msgid "Ask index seo title" +#: src/Controller/Front/IndexController.php:35 +msgid "List of all projects" +msgstr "" + +#: src/Controller/Front/IndexController.php:53 +#: src/Controller/Front/ProjectController.php:55 +msgid "List of all questions" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/IndexController.php:70 -msgid "ask index seo description" +#: src/Controller/Front/ProjectController.php:34 +#: src/Controller/Front/SubmitController.php:45 +msgid "Project not set." msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/IndexController.php:71 -msgid "ask index seo keywords" +#: src/Controller/Front/SubmitController.php:34 +msgid "Ask question not active" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/SubmitController.php:64 +#: src/Controller/Front/SubmitController.php:51 +msgid "Please select project for ask question" +msgstr "" + +#: src/Controller/Front/SubmitController.php:104 msgid "Your ask new question successfully, Other users can view and answer it" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/SubmitController.php:66 +#: src/Controller/Front/SubmitController.php:106 msgid "" "Your ask new question successfully, But it need review and publish by " "website admin" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/SubmitController.php:73 -msgid "Ask a new Question" +#: src/Controller/Front/SubmitController.php:118 +#, php-format +msgid "Ask a new Question on %s project" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:37 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:54 -msgid "The tag not found." +#: src/Controller/Front/TagController.php:29 +msgid "Tag module not installed." msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:96 -msgid "Back to question list" +#: src/Controller/Front/TagController.php:61 +#, php-format +msgid "All questions from %s" +msgstr "" + +#: src/Controller/Front/TagController.php:102 +msgid "List of all used tags" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AnswerForm.php:48 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:31 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/question_index.phtml:28 +#: src/Form/AnswerForm.php:49 template/admin/question-index.phtml:32 +#: template/front/question-index.phtml:104 +#: template/front/question-index.phtml:108 +#: template/front/question-list.phtml:73 msgid "Answer" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AnswerForm.php:62 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:80 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:80 +#: src/Form/AnswerForm.php:63 src/Form/AskForm.php:107 +#: src/Form/ProjectForm.php:180 src/Form/UpdateForm.php:81 msgid "Submit" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:42 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:42 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:14 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:3 +#: src/Form/AskForm.php:42 src/Form/ProjectForm.php:42 +#: src/Form/UpdateForm.php:42 template/admin/project-index.phtml:8 +#: template/admin/question-index.phtml:15 +#: template/admin/question-update.phtml:3 msgid "Title" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:53 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:28 +#: src/Form/AskForm.php:53 src/Form/UpdateForm.php:53 +#: template/admin/question-index.phtml:29 msgid "Question" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:67 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:67 +#: src/Form/AskForm.php:67 src/Form/ProjectForm.php:78 +msgid "Main image" +msgstr "" + +#: src/Form/AskForm.php:94 src/Form/UpdateForm.php:68 msgid "Tags" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:53 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:5 -msgid "Content" +#: src/Form/AskForm.php:98 src/Form/UpdateForm.php:72 +msgid "Use `|` as delimiter to separate tag terms" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:10 -msgid "List of questions and answers" +#: src/Form/ProjectForm.php:53 +msgid "slug" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:13 -msgid "ID" +#: src/Form/ProjectForm.php:57 +msgid "Used on URL value : must be unique, short, and user oriented" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:15 -msgid "Type" +#: src/Form/ProjectForm.php:64 template/admin/question-update.phtml:5 +msgid "Description" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:16 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:6 -msgid "Create" +#: src/Form/ProjectForm.php:91 +msgid "Additional images" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:17 -msgid "Action" +#: src/Form/ProjectForm.php:104 +msgid "Status" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:49 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:74 -msgid "Reject" +#: src/Form/ProjectForm.php:106 template/admin/project-index.phtml:34 +#: template/admin/question-index.phtml:62 +msgid "Published" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:51 -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:79 -msgid "Accept" +#: src/Form/ProjectForm.php:107 template/admin/project-index.phtml:35 +#: template/admin/question-index.phtml:63 +msgid "Pending review" +msgstr "" + +#: src/Form/ProjectForm.php:108 +msgid "Draft" +msgstr "" + +#: src/Form/ProjectForm.php:109 +msgid "Private" +msgstr "" + +#: src/Form/ProjectForm.php:110 +msgid "Remove" +msgstr "" + +#: src/Form/ProjectForm.php:121 +msgid "Manager" +msgstr "" + +#: src/Form/ProjectForm.php:125 +msgid "Project manager user id" +msgstr "" + +#: src/Form/ProjectForm.php:133 +msgid "SEO options" +msgstr "" + +#: src/Form/ProjectForm.php:140 +msgid "Meta Title" +msgstr "" + +#: src/Form/ProjectForm.php:146 +msgid "" +"Displayed in search Engine result pages as Title : between 10 to 70 " +"character. If empty, will be popuated automaticaly by main title value" +msgstr "" + +#: src/Form/ProjectForm.php:153 +msgid "Meta Keywords" +msgstr "" + +#: src/Form/ProjectForm.php:159 +msgid "" +"Not used anymore by search engines : between 5 to 12 words / left it empty, " +"it will be automaticaly populated with main title values" +msgstr "" + +#: src/Form/ProjectForm.php:166 +msgid "Meta Description" +msgstr "" + +#: src/Form/ProjectForm.php:172 +msgid "" +"Displayed in search Engine result pages : quick summary to incitate user to " +"click, between 80 to 160 character" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:53 +#: template/admin/project-index.phtml:4 +msgid "List of projects" +msgstr "" + +#: template/admin/project-index.phtml:7 template/admin/question-index.phtml:14 +msgid "ID" +msgstr "" + +#: template/admin/project-index.phtml:9 template/admin/question-index.phtml:18 +msgid "Action" +msgstr "" + +#: template/admin/project-index.phtml:25 template/front/question-list.phtml:78 +msgid "View" +msgstr "" + +#: template/admin/project-index.phtml:26 template/admin/project-index.phtml:28 +#: template/admin/question-index.phtml:54 msgid "Edit" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:54 -msgid "Delete" +#: template/admin/project-index.phtml:39 +msgid "No project create yet" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:61 -msgid "Published" +#: template/admin/question-index.phtml:11 +msgid "List of questions and answers" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:62 -msgid "Pending review" +#: template/admin/question-index.phtml:16 +msgid "Type" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:68 +#: template/admin/question-index.phtml:17 +#: template/admin/question-update.phtml:6 +msgid "Create" +msgstr "" + +#: template/admin/question-index.phtml:50 +#: template/admin/question-index.phtml:78 +msgid "Reject" +msgstr "" + +#: template/admin/question-index.phtml:52 +#: template/admin/question-index.phtml:83 +msgid "Accept" +msgstr "" + +#: template/admin/question-index.phtml:55 +msgid "Delete" +msgstr "" + +#: template/admin/question-index.phtml:66 +msgid "No question submit yet" +msgstr "" + +#: template/admin/question-index.phtml:72 msgid "Accept in process" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:4 +#: template/admin/question-update.phtml:4 msgid "Slug" msgstr "" -#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/question_list.phtml:3 +#: template/front/answer-index.phtml:19 template/front/question-index.phtml:27 +#: template/front/question-index.phtml:82 +msgid "Time" +msgstr "" + +#: template/front/answer-index.phtml:20 template/front/question-index.phtml:28 +msgid "Read" +msgstr "" + +#: template/front/answer-index.phtml:20 template/front/question-index.phtml:28 +msgid "Times" +msgstr "" + +#: template/front/question-index.phtml:13 +#: template/front/question-index.phtml:76 +msgid "View profile" +msgstr "" + +#: template/front/question-index.phtml:62 +msgid "Answers" +msgstr "" + +#: template/front/question-list.phtml:20 +msgid "Contact to manager" +msgstr "" + +#: template/front/question-list.phtml:34 template/front/question-list.phtml:38 +#: template/front/question-list.phtml:53 template/front/question-list.phtml:56 msgid "Ask question" msgstr "" + +#: template/front/question-list.phtml:63 +msgid "List of questions" +msgstr "" + +#: template/front/question-list.phtml:84 +msgid "Vote" +msgstr "" + +#: template/front/question-list.phtml:100 +msgid "On" +msgstr "" + +#: template/front/question-list.phtml:102 +msgid "By" +msgstr "" + +#: template/front/submit-index.phtml:11 +msgid "Roles to ask question" +msgstr "" + +#: template/front/submit-index.phtml:13 +msgid "Please check website roles before ask question" +msgstr "" + +#: template/front/submit-index.phtml:14 +msgid "Please dont submit duplicate question" +msgstr "" + +#: template/front/submit-index.phtml:15 +msgid "All questions will review by admin or project manager" +msgstr "" + +#: template/front/tag_list.phtml:18 +msgid "" +"No keyword has been used as tag on this part yet. please check this page " +"later" +msgstr "" diff --git a/locale/fa/admin.mo b/locale/fa/admin.mo index 790b0c8b5106af1717c3896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WahWP!F3z;YV^>fcT zz30#GoZfu&pFQPYqQ3VPB}+U+EY&FW3_iD&FUqJ-sWu$L2k;U`@I9}7730+Bz4{G& zkoqzP@mGxEAD%Val=4%LA^l~wgNFnSDXhgll!=ab9!K6)CvZCs;ubuMGVzq>EbgE_ zhevT4n=#H{jra&k{Qw5=dGs^CdYK2Az(U#CYsg1UdF^j`^@}Jgzk;p!f!F^9$_Bnf z+376|z@Ui;BH zrT8eDul;xqCG{1Q_m+^Ksw&Dcub?cjxt=j4CHr`gfe)hWWDq5_CG5r-WYOwd zSHF!i(Or~`{O0wqp+P-B=K)NiENldq@e20hiw)#oF5Tq@&IjjFj^GZ;ihoC$a1|fM zf02*c%YjOJkLOb;m+lD4I2ML*7F+PD*Z-C09c-d~wUPYG&bIMu88C=aPv9Zki8E+< zuHr29H_6`=hFNVNzKbcmjhxK-VkM(eNXGw)Y)sN`5T=~JWPpsU7rDWb%H6~sLXJmv z)=5Z_n=hBCi`YlV?zko@Mo5wKmW@b}%P9Y1*0g?{a_id(x$GOIoc5mN-0v@PQ6!ae zZjvf8ruGsYgcP|K8zsX-8zC7WL24Hv$0V8DDDu}`FYUJRddae#v0}l<4e7SptUgoQ ztiP`9)2;r9e%x=y`-=s~Dmbct!pb?8dfLicj-@~Jcj*=Xe!V>q2pYM<9QB4qRKkh3|X{%6XtkvxRkfdoPD}ZwcC0%9@BlH z{~WH#^N>KAzMg&94M1?qc|WXR1fJ(IYgds=%Ie`-0ogetProject($params['slug'], 'slug'); + $result[] = array( + 'href' => $moduleData['moduleUrl'], + 'label' => $moduleData['title'], + ); + $result[] = array( + 'label' => $project['title'], + ); + break; + case 'tag': $result[] = array( 'href' => $moduleData['moduleUrl'], @@ -74,6 +85,13 @@ public function load() 'href' => $moduleData['moduleUrl'], 'label' => $moduleData['title'], ); + if ($question['project_id'] > 0) { + $project = Pi::api('project', 'ask')->getProject($question['project_id']); + $result[] = array( + 'href' => $project['projectUrl'], + 'label' => $project['title'], + ); + } $result[] = array( 'label' => $question['title'], ); @@ -85,9 +103,16 @@ public function load() 'href' => $moduleData['moduleUrl'], 'label' => $moduleData['title'], ); + if ($question['project_id'] > 0) { + $project = Pi::api('project', 'ask')->getProject($question['project_id']); + $result[] = array( + 'href' => $project['projectUrl'], + 'label' => $project['title'], + ); + } $result[] = array( 'href' => $question['questionUrl'], - 'label' => $question['title'], + 'label' => mb_substr(strip_tags($question['title']), 0, 50, 'utf-8' ) . "...", ); $result[] = array( 'label' => __('Answer to question'), @@ -99,6 +124,13 @@ public function load() 'href' => $moduleData['moduleUrl'], 'label' => $moduleData['title'], ); + if (!empty($params['slug'])) { + $project = Pi::api('project', 'ask')->getProject($params['slug'], 'slug'); + $result[] = array( + 'href' => $project['projectUrl'], + 'label' => $project['title'], + ); + } $result[] = array( 'label' => __('Ask a new Question'), ); diff --git a/src/Api/Project.php b/src/Api/Project.php index f2c3202..9e88d81 100644 --- a/src/Api/Project.php +++ b/src/Api/Project.php @@ -63,6 +63,19 @@ public function canonizeProject($project) 'controller' => 'project', 'slug' => $project['slug'], ))); + // Set project manager + if ($project['manager'] > 0) { + $project['user'] = Pi::user()->get($project['manager'], array( + 'id', 'identity', 'name', 'email' + )); + $project['user']['avatar'] = Pi::service('user')->avatar($project['user']['id'], 'large', array( + 'alt' => $project['user']['name'], + 'class' => 'img-responsive img-circle', + )); + $project['user']['profileUrl'] = Pi::url(Pi::service('user')->getUrl('profile', array( + 'id' => $project['user']['id'], + ))); + } // return question return $project; } diff --git a/src/Api/Question.php b/src/Api/Question.php index 8d35ba4..111da4a 100644 --- a/src/Api/Question.php +++ b/src/Api/Question.php @@ -76,18 +76,18 @@ public function canonizeQuestion($question) $question['user'] = Pi::user()->get($question['uid'], array( 'id', 'identity', 'name', 'email' )); - /* $question['user']['avatar'] = Pi::service('user')->avatar($question['user']['id'], 'large', array( + $question['user']['avatar'] = Pi::service('user')->avatar($question['user']['id'], 'large', array( 'alt' => $question['user']['name'], - 'class' => 'img-circle', + 'class' => 'img-responsive img-circle', )); $question['user']['profileUrl'] = Pi::url(Pi::service('user')->getUrl('profile', array( 'id' => $question['user']['id'], - ))); */ + ))); // Set info for Q and A switch ($question['type']) { case 'Q': // Set text_description - $question['text_description'] = Pi::service('markup')->render($question['text_description'], 'html', 'html'); + $question['text_description'] = Pi::service('markup')->render($question['text_description'], 'html', 'text'); // Set question url $question['questionUrl'] = Pi::url(Pi::service('url')->assemble('ask', array( 'module' => $this->getModule(), diff --git a/src/Controller/Front/AnswerController.php b/src/Controller/Front/AnswerController.php index 71fd844..017b31d 100644 --- a/src/Controller/Front/AnswerController.php +++ b/src/Controller/Front/AnswerController.php @@ -59,7 +59,6 @@ public function indexAction() $filter = new Filter\Slug; $slug = sprintf('%s-%s', $values['title'], _date($values['time_create'])); $values['slug'] = $filter($slug); - // Set seo_title $filter = new Filter\HeadTitle; $values['seo_title'] = $filter($values['title']); @@ -77,7 +76,10 @@ public function indexAction() $values['status'] = $this->config('auto_approval'); $values['type'] = 'A'; // Update answer - $this->getModel('question')->update(array('answer' => $question['answer'] + 1), array('id' => $question['id'])); + $this->getModel('question')->update( + array('answer' => $question['answer'] + 1), + array('id' => $question['id']) + ); // Save values $row = $this->getModel('question')->createRow(); $row->assign($values); @@ -107,9 +109,10 @@ public function indexAction() $this->view()->headTitle($title); $this->view()->headDescription($title, 'set'); $this->view()->headKeywords($seoKeywords, 'set'); - $this->view()->setTemplate('answer_index'); + $this->view()->setTemplate('answer-index'); $this->view()->assign('form', $form); $this->view()->assign('title', $title); $this->view()->assign('question', $question); + $this->view()->assign('config', $config); } } \ No newline at end of file diff --git a/src/Controller/Front/QuestionController.php b/src/Controller/Front/QuestionController.php index c792592..bdea648 100644 --- a/src/Controller/Front/QuestionController.php +++ b/src/Controller/Front/QuestionController.php @@ -34,19 +34,25 @@ public function indexAction() } // Update Hits $this->getModel('question')->increment('hits', array('id' => $question['id'])); - // Update Hits - $this->getModel('question')->update(array('hits' => $question['hits'] + 1), array('id' => $question['id'])); // Set vote - if (Pi::service('module')->isActive('vote')) { - $vote = array( + if (Pi::service('module')->isActive('vote') && $config['vote_bar']) { + $question['vote'] = array( 'point' => $question['point'], 'count' => $question['count'], 'item' => $question['id'], 'table' => 'question', 'module' => $module, 'type' => 'plus', + 'class' => 'btn-group-vertical', ); - $this->view()->assign('vote', $vote); + } + // Get project + $question['is_manager'] = false; + if ($question['project_id'] > 0) { + $question['project'] = Pi::api('project', 'ask')->getProject($question['project_id']); + if ($question['project']['user']['id'] == $question['user']['id']) { + $question['is_manager'] = true; + } } // Get answers if ($question['answer'] > 0) { @@ -57,7 +63,13 @@ public function indexAction() $rowset = $this->getModel('question')->selectWith($select); foreach ($rowset as $row) { $answers[$row->id] = Pi::api('question', 'ask')->canonizeQuestion($row); - if (Pi::service('module')->isActive('vote')) { + + $answers[$row->id]['is_manager'] = false; + if ($question['project']['user']['id'] == $answers[$row->id]['user']['id']) { + $answers[$row->id]['is_manager'] = true; + } + + if (Pi::service('module')->isActive('vote') && $config['vote_bar']) { $answers[$row->id]['vote'] = array( 'point' => $answers[$row->id]['point'], 'count' => $answers[$row->id]['count'], @@ -65,6 +77,7 @@ public function indexAction() 'table' => 'question', 'module' => $module, 'type' => 'plus', + 'class' => 'btn-group-vertical', ); } } @@ -74,7 +87,7 @@ public function indexAction() $this->view()->headTitle($question['seo_title']); $this->view()->headDescription($question['seo_keywords'], 'set'); $this->view()->headKeywords($question['seo_description'], 'set'); - $this->view()->setTemplate('question_index'); + $this->view()->setTemplate('question-index'); $this->view()->assign('question', $question); $this->view()->assign('config', $config); } diff --git a/src/Form/AskForm.php b/src/Form/AskForm.php index 0291f39..cb84b8d 100644 --- a/src/Form/AskForm.php +++ b/src/Form/AskForm.php @@ -51,11 +51,11 @@ public function init() 'name' => 'text_description', 'options' => array( 'label' => __('Question'), - 'editor' => 'html', - 'set' => '', ), 'attributes' => array( - 'type' => 'editor', + 'type' => 'textarea', + 'rows' => '10', + 'cols' => '40', 'description' => '', ) )); diff --git a/src/Form/ProjectForm.php b/src/Form/ProjectForm.php index 8e0abfc..cc295bd 100644 --- a/src/Form/ProjectForm.php +++ b/src/Form/ProjectForm.php @@ -54,7 +54,7 @@ public function init() ), 'attributes' => array( 'type' => 'text', - 'description' => __('Used as story URL value : must be unique, short, and user oriented'), + 'description' => __('Used on URL value : must be unique, short, and user oriented'), ) )); // text_description diff --git a/template/front/answer-index.phtml b/template/front/answer-index.phtml new file mode 100644 index 0000000..306bb1d --- /dev/null +++ b/template/front/answer-index.phtml @@ -0,0 +1,34 @@ +css($this->assetModule('css/front.css')); ?> +
+
+
+ +
+
+ +
+
+ +
+
+ + +
    +
  • : escape($question['time_create_view']); ?>
  • +
  • : escape($question['hits'])); ?>
  • +
+ +
+
+
+ +
+
+
+
+
+ form($form, 'vertical'); ?> +
+
\ No newline at end of file diff --git a/template/front/answer_index.phtml b/template/front/answer_index.phtml deleted file mode 100644 index 41e1db6..0000000 --- a/template/front/answer_index.phtml +++ /dev/null @@ -1,10 +0,0 @@ -css($this->assetModule('css/front.css')); ?> -
-
-

escape($title); ?>

-
- -
-
- form($form); ?> -
\ No newline at end of file diff --git a/template/front/project-list.phtml b/template/front/project-list.phtml index 426ae55..e4d8ed7 100644 --- a/template/front/project-list.phtml +++ b/template/front/project-list.phtml @@ -4,12 +4,26 @@

escape($title); ?>

\ No newline at end of file diff --git a/template/front/question-index.phtml b/template/front/question-index.phtml new file mode 100644 index 0000000..0fbf9d6 --- /dev/null +++ b/template/front/question-index.phtml @@ -0,0 +1,111 @@ +css($this->assetModule('css/front.css')); ?> +
+
+
+
+
+ +
+
+
escape($question['user']['name']); ?>
+
+ + + +
+
+
+ +
+
+ +
+
+ + +
    +
  • : escape($question['time_create_view']); ?>
  • +
  • : escape($question['hits'])); ?>
  • +
+ +
+
+ +
+ +
+ + + +
+
+
+ template('votebar', 'front', 'vote'); + } ?> +
+
+
+ + +
+ +
+
+
+
+ +
+
+
escape($answer['user']['name']); ?>
+
+ + + +
+
+
+
    +
  • : escape($answer['time_create_view']); ?>
  • +
+
+
+
+ +
+
+
+
+ template('votebar', 'front', 'vote'); + } ?> +
+
+
+ +
+ + +
+ +
+ +
\ No newline at end of file diff --git a/template/front/question-list.phtml b/template/front/question-list.phtml index 1658b6f..4a7c4e8 100644 --- a/template/front/question-list.phtml +++ b/template/front/question-list.phtml @@ -1,22 +1,50 @@ css($this->assetModule('css/front.css')); ?>
- - getSingleLinkUrl($project['main_image'])->thumb('thumbnail'); ?> +