Преглед изворни кода

channel 信息修改完善

visuddhinanda пре 5 година
родитељ
комит
6dbd63b7c1

+ 44 - 12
app/channal/channal.js

@@ -79,6 +79,9 @@ function my_channal_list() {
 	);
 }
 
+/*
+编辑channel信息
+*/
 function my_channal_edit(id) {
 	$.get(
 		"../channal/my_channal_get.php",
@@ -95,18 +98,32 @@ function my_channal_edit(id) {
 					html += '<div class="" style="padding:5px;">';
 					html += '<div style="max-width:2em;flex:1;"></div>';
 					html += "</div>";
+
 					html += "<div style='display:flex;'>";
-					html += "<div style='flex:4;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.title + "</div>";
+					html += "<div style='flex:8;'>";
 					html += "<input type='hidden' name='id' value='" + result.id + "'/>";
 					html +=
 						"<input type='input' name='name' value='" +
 						result.name +
-						"' maxlength='32' placeholder='📝≤32'/>";
+						"' maxlength='32' placeholder='channel title'/>";
+					html += "</div>";
+					html += "</div>";
+
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.introduction + "</div>";
+					html += "<div style='flex:8;'>";
 					html += "<textarea name='summary'>" + result.summary + "</textarea>";
+					html += "</div>";
+					html += "</div>";
 
-					html += "<div>";
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.language + "</div>";
+					html += "<div style='flex:8;'>";
 					html +=
-						'<input id="channal_lang_select" type="input"  onchange="channal_lang_change()"  title="type language name/code" code="' +
+						'<input id="channal_lang_select" type="input"  onchange="channal_lang_change()"' +
+						' placeholder = "try type chinese or en " ' +
+						'  title="type language name/code" code="' +
 						result.lang +
 						'" value="' +
 						result.lang +
@@ -114,26 +131,29 @@ function my_channal_edit(id) {
 						result.lang +
 						'">';
 					html += "</div>";
+					html += "</div>";
 
 					html += '<div style="display:flex;">';
-					html += '<div style="flex:2;">Status</div>';
+					html += '<div style="flex:2;">' + gLocal.gui.view + "</div>";
 					html += '<div style="flex:8;">';
 					let arrStatus = [
-						{ id: 0, string: gLocal.gui.disable },
-						{ id: 10, string: gLocal.gui.private },
-						{ id: 30, string: gLocal.gui.public },
+						{ id: 0, string: gLocal.gui.disable, note: gLocal.gui.disable_note },
+						{ id: 10, string: gLocal.gui.private, note: gLocal.gui.private_note },
+						{ id: 30, string: gLocal.gui.public, note: gLocal.gui.public_note },
 					];
-					html += "<select id = 'status'  name = 'status'>";
+					html += "<select id = 'status'  name = 'status' onchange='status_change(this)'>";
+					let status_note = "";
 					for (const iterator of arrStatus) {
 						html += "<option ";
 						if (parseInt(result.status) == iterator.id) {
 							html += " selected ";
+							status_note = iterator.note;
 						}
 						html += " value='" + iterator.id + "'>" + iterator.string + "</option>";
 					}
 
 					html += "</select>";
-					html += "</div>";
+					html += "<span id = 'status_help'>" + status_note + "</span><a href='#' target='_blank'>[详情]</a>";
 					html += "</div>";
 					html += "</div>";
 
@@ -141,8 +161,6 @@ function my_channal_edit(id) {
 					html += "<div id='preview_inner' ></div>";
 					html += "</div>";
 
-					html += "</div>";
-
 					$("#channal_info").html(html);
 					tran_lang_select_init("channal_lang_select");
 					//$("#aritcle_status").html(render_status(result.status));
@@ -158,6 +176,20 @@ function my_channal_edit(id) {
 	);
 }
 
+function status_change(obj) {
+	let arrStatus = [
+		{ id: 0, string: gLocal.gui.disable, note: gLocal.gui.disable_note },
+		{ id: 10, string: gLocal.gui.private, note: gLocal.gui.private_note },
+		{ id: 30, string: gLocal.gui.public, note: gLocal.gui.public_note },
+	];
+	let newStatus = $(obj).val();
+	for (const iterator of arrStatus) {
+		if (parseInt(newStatus) == iterator.id) {
+			$("#status_help").html(iterator.note);
+		}
+	}
+}
+
 function channal_lang_change() {
 	let lang = $("#channal_lang_select").val();
 	if (lang.split("_").length == 3) {

+ 1 - 0
app/public/lang/default.json

@@ -570,6 +570,7 @@
 		"show_nissaya": "show nissaya",
 		"related_para": "related&nbsp;paragraph",
 		"disable": "disable",
+		"disable_note": "disable",
 		"not_found": "not&nbsp;found",
 		"": ""
 	},

+ 1 - 0
app/public/lang/en.json

@@ -569,6 +569,7 @@
 		"show_nissaya": "show nissaya",
 		"related_para": "related&nbsp;paragraph",
 		"disable": "disable",
+		"disable_note": "disable",
 		"not_found": "not&nbsp;found",
 		"": ""
 	},

+ 1 - 0
app/public/lang/my.json

@@ -569,6 +569,7 @@
 		"show_nissaya": "show nissaya",
 		"related_para": "related&nbsp;paragraph",
 		"disable": "disable",
+		"disable_note": "disable",
 		"not_found": "not&nbsp;found",
 		"": "",
 		"": ""

+ 1 - 0
app/public/lang/si.json

@@ -574,6 +574,7 @@
 		"show_nissaya": "show nissaya",
 		"related_para": "related&nbsp;paragraph",
 		"disable": "disable",
+		"disable_note": "disable",
 		"not_found": "not&nbsp;found",
 		"": "",
 		"": ""

+ 4 - 3
app/public/lang/zh-cn.json

@@ -526,11 +526,11 @@
 		"blank": "空白",
 		"vocabulary_list": "词汇列表",
 		"private": "私享",
-		"private_note": "仅自己可见,不订阅,不可搜索",
+		"private_note": "仅自己可见,不支持订阅,不可搜索",
 		"unlisted": "不公开列出",
-		"unlisted_note": "可通过链接访问,不推订阅,不可搜索",
+		"unlisted_note": "可通过链接访问,不支持订阅,其他人搜索不到",
 		"public": "公开",
-		"public_note": "可通过链接访问,订阅,可搜索",
+		"public_note": "可通过链接访问,支持订阅,可搜索",
 		"copy_link": "复制链接",
 		"saved": "已保存",
 		"title_necessary": "必须填写标题",
@@ -571,6 +571,7 @@
 		"show_nissaya": "显示nissaya",
 		"related_para": "相应段落",
 		"disable": "停用",
+		"disable_note": "停用,即使自己也无法更新",
 		"not_found": "未找到",
 		"site_intro": "想学巴利不知从何开始<br>学过巴利语法但是面对圣典无从下手<br>想要翻译巴利但面临种种困难<br>我们都有相关工具为您提供支持<br>降低巴利语的阅读门槛",
 

+ 1 - 0
app/public/lang/zh-tw.json

@@ -570,6 +570,7 @@
 		"show_nissaya": "显示nissaya",
 		"related_para": "相應段落",
 		"disable": "停用",
+		"disable_note": "停用",
 		"not_found": "未找到",
 		"site_intro": "想學巴利不知從何開始<br>學過巴利語法但是面對聖典無從下手<br>想要翻譯巴利但面臨種種困難<br>我們都有相關工具為您提供支援<br>降低巴利語的閱讀門檻",
 		"": ""

+ 2 - 1
app/usent/get.php

@@ -1,6 +1,6 @@
 <?php
 /*
-get xml doc from db
+获取句子译文
 */
 require_once "../path.php";
 require_once "../public/_pdo.php";
@@ -46,6 +46,7 @@ $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 /* 开始一个事务,关闭自动提交 */
 
 if(isset($_GET["sentences"])){
+	#查询句子编号列表
     $arrSent = explode(",",$_GET["sentences"]);
     /*  创建一个填充了和params相同数量占位符的字符串 */
     $place_holders = implode(',', array_fill(0, count($arrSent), '?'));