فهرست منبع

localize username

huaisianhuang 3 سال پیش
والد
کامیت
49700e7ff9

+ 1 - 1
html/make_video.html

@@ -139,7 +139,7 @@
                     <!-- fieldsets -->
                     <fieldset>
                         <h3 class="fs-subtitle"><lan set-lan="html:video_title">標題</lan><img class="ms-1" src="static/img/question.png" alt="" data-bs-toggle="tooltip" data-bs-placement="right" title="將作為影片的內嵌標題 The title of your video"></h3>            
-                        <input id=title type="text" name='t1' class='title_new' value="" placeholder="標題" /> <br/>
+                        <input id=title type="text" name='t1' class='title_new' value="" set-lan="placeholder:video_title" /> <br/>
                     </fieldset>
                     <fieldset>
                         <h3  class="fs-subtitle"><lan set-lan="html:choose_character">選擇人物</lan><img class="ms-1" src="static/img/question.png" alt="" data-bs-toggle="tooltip" data-bs-placement="right" title="將作為影片的講者 The spokesgirl of your video"></h3>            

+ 1 - 1
html/make_video_long.html

@@ -139,7 +139,7 @@
                 <!-- fieldsets -->
                 <fieldset>
                     <h3 class="fs-subtitle"><lan set-lan="html:video_title">標題</lan><img class="ms-1" src="static/img/question.png" alt="" data-bs-toggle="tooltip" data-bs-placement="right" title="將作為影片的內嵌標題"></h3>            
-                    <input id=title type="text" name='t1' class='title_new' value="" placeholder="標題" /> <br/>
+                    <input id=title type="text" name='t1' class='title_new' value="" set-lan="placeholder:video_title" /> <br/>
                 </fieldset>
                 <fieldset>
                     <h3  class="fs-subtitle"><lan set-lan="html:choose_character">選擇人物</lan><img class="ms-1" src="static/img/question.png" alt="" data-bs-toggle="tooltip" data-bs-placement="right" title="將作為影片的講者"></h3>            

+ 1 - 1
html/make_video_slide.html

@@ -140,7 +140,7 @@
                     <!-- fieldsets -->
                     <fieldset>
                         <h3 class="fs-subtitle"><lan set-lan="html:slide_link">SLIDE 連結</lan><img class="ms-1" src="static/img/question.png" alt="" data-bs-toggle="tooltip" data-bs-placement="right" title="請輸入Google Slides連結 Google Slides Link"></h3>
-                        <input id=slide_raw_url type="text" name='t1' class='title_new' value="" placeholder="連結" /><label for="myCheck" set-lan="html:add_eng">加入英文:</label> 
+                        <input id=slide_raw_url type="text" name='t1' class='title_new' value="" set-lan="placeholder:slide_link"/><label for="myCheck" set-lan="html:add_eng">加入英文:</label> 
                         <input type="checkbox" id="multiLang" > <br/>
                     </fieldset>
                     <fieldset>

+ 6 - 0
html/script_eng.js

@@ -1,5 +1,11 @@
 checkRoute();
 
+let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
+if(userBasics !== []){
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+}
+
+
 function checkRoute() {
   let jwt_token = get_jwt_token();
   if(jwt_token == undefined) {

+ 6 - 0
html/script_profiles.js

@@ -8,6 +8,11 @@ function getCookie(name) {
     if (parts.length === 2) return parts.pop().split(';').shift();
   }
 
+let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
+if(userBasics !== []){
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+}
+
 function renderView() {
     let token = getCookie('jwt_token');
     if(!token) {
@@ -24,6 +29,7 @@ function renderView() {
     }).then(res => {
         console.log(res.data);
         const userInfo = res.data;
+        localStorage.setItem('user_profile', JSON.stringify(res.data));
           if(userInfo.user_info.left_sec < 20){
             Swal.fire({
                 title: "剩餘秒數不足",

+ 5 - 3
html/static/lan.js

@@ -93,7 +93,8 @@ var zh = {
     "contact_mail": "聯絡信箱",
     "draft_edit": "編輯",
     "drafts": "草稿夾",
-    "save_draft_btn": "存為草稿"
+    "save_draft_btn": "存為草稿",
+    "upload_file": "上傳檔案"
 };
 
 var en = {
@@ -166,7 +167,8 @@ var en = {
     "contact_mail": "Email",
     "draft_edit": "Edit",
     "drafts": "Drafts",
-    "save_draft_btn": "Save as Draft"
+    "save_draft_btn": "Save as Draft",
+    "upload_file": "Upload"
 };
 
 function switchLanContent(val){
@@ -203,7 +205,7 @@ function switchLanContent(val){
                 me.html(t);
                 break;
             case 'placeholder':
-                me.placeholder(t);
+                me.attr('placeholder', t);
                 console.log("placeholder");
             case 'val':
             case 'value':

+ 7 - 0
html/static/script_util.js

@@ -1,5 +1,10 @@
 checkRoute();
 
+let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
+if(userBasics !== []){
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+}
+
 function checkRoute() {
   let jwt_token = get_jwt_token();
   if(jwt_token == undefined) {
@@ -435,6 +440,7 @@ function load_data(tid, loaded_data, draft = false) {
     imguploadlabel.setAttribute('for', `img${i + 1}`);
     imguploadlabel.classList.add('upload-btn');
     imguploadlabel.textContent = '上傳檔案';
+    imguploadlabel.setAttribute('set-lan', `html:upload_file`);
     imgInputs.appendChild(imguploadlabel);
   }
 
@@ -537,6 +543,7 @@ function renderimgBlock(i) {
   imguploadlabel.setAttribute('for', `img${i}`);
   imguploadlabel.classList.add('upload-btn');
   imguploadlabel.textContent = '上傳檔案';
+  imguploadlabel.setAttribute('set-lan', `html:upload_file`);
   imgInputs.appendChild(imguploadlabel);
   $('input[type=file]').on('change', prepareUpload);
 }

+ 3 - 1
html/static/scss/style.css

@@ -1502,7 +1502,9 @@ body {
 }
 
 .sidenav .right-text {
-  padding-top: 9vw;
+  position: absolute;
+  bottom: 0;
+  left: 0;
   color: #fff;
 }
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
html/static/scss/style.css.map


+ 3 - 1
html/static/scss/style.scss

@@ -1356,7 +1356,9 @@ body {
 		}
 	}
 	.right-text {
-		padding-top: 9vw;
+		position: absolute;
+		bottom: 0;
+		left: 0;
 		color: #fff;
 		a {
 			font-size: 18px;

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است