Browse Source

Merge branch 'laravel' into chanpter_progress

visuddhinanda@gmail.com 3 years ago
parent
commit
7c0aa08741

+ 16 - 15
app/Http/Controllers/SentenceInfoController.php

@@ -106,21 +106,22 @@ class SentenceInfoController extends Controller
             $para_strlen = 0;
             foreach ($sentFinished as $sent) {
                 # code...
-                /*
-                $para_strlen += PaliSentence::where('book',$request->get('book'))
-                            ->where('paragraph',$sent->paragraph)
-                            ->where('word_begin',$sent->word_start)
-                            ->where('word_end',$sent->word_end)
-                            ->value('length');
-                */
-                $key_sent_id = $sent->book_id.'-'.$sent->paragraph.'-'.$sent->word_start.'-'.$sent->word_end;
-                $para_strlen += Cache::get(env('REDIS_NAMESPACE').'pali-sent/strlen/'.$key_sent_id, function() use($sent) {
-                    return PaliSentence::where('book',$sent->book_id)
-                            ->where('paragraph',$sent->paragraph)
-                            ->where('word_begin',$sent->word_start)
-                            ->where('word_end',$sent->word_end)
-                            ->value('length');
-                });
+                if($request->get('cache')=="1"){
+                    $key_sent_id = $sent->book_id.'-'.$sent->paragraph.'-'.$sent->word_start.'-'.$sent->word_end;
+                    $para_strlen += Cache::get(env('REDIS_NAMESPACE').'pali-sent/strlen/'.$key_sent_id, function() use($sent) {
+                        return PaliSentence::where('book',$sent->book_id)
+                                ->where('paragraph',$sent->paragraph)
+                                ->where('word_begin',$sent->word_start)
+                                ->where('word_end',$sent->word_end)
+                                ->value('length');
+                    });
+                }else{
+                    $para_strlen += PaliSentence::where('book',$request->get('book'))
+                                ->where('paragraph',$sent->paragraph)
+                                ->where('word_begin',$sent->word_start)
+                                ->where('word_end',$sent->word_end)
+                                ->value('length');                    
+                }
             }
 
             $percent = $para_strlen / $allStrLen;

+ 14 - 1
public/app/palicanon/style.css

@@ -275,7 +275,7 @@ li.level_1.selected {
 }
 .book_view ul li {
 	width: 180px;
-	height: 250px;
+	height: 120px;
 	margin: 1em;
 	border: 10px solid wheat;
 }
@@ -283,3 +283,16 @@ li.level_1.selected {
 	display: flex;
 	flex-flow: wrap;
 }
+
+.chapter_list .more_info{
+    display:none;
+}
+.head_bar{
+    display:flex;
+}
+.book_view .list li {
+    width: 180px;
+    height: unset;
+    margin: unset;
+    border: unset;
+}

+ 1 - 1
public/app/public/book_tag/en.json

@@ -13040,7 +13040,7 @@
 	{
 		"book": "209",
 		"para": "1433",
-		"level": "2",
+		"level": "1",
 		"title": "bhikkhunīvibhaṅgavaṇṇanā",
 		"tag": ":vajirabuddhi::ṭīkā::vinaya::suttavibhaṅga::bhikkhunīvibhaṅga::pācittiyapāḷi::bhikkhunī:"
 	},

File diff suppressed because it is too large
+ 36 - 36
public/pali_title/209_pali.csv


Some files were not shown because too many files changed in this diff