วันพุธที่ 14 มิถุนายน พ.ศ. 2560

commit เพิ่มเติม : เพื่มเปลี่ยน theme เข้าไปในเว็บ

add change theme

ได้เพิ่มการเปลี่ยน theme
ใช้ theme จาก https://bootswatch.com/


ใช้ session ในการเก็บค่า theme


จาก
The session framework lets you store and retrieve arbitrary data on a per-site-visitor basis

session จะทำให้สามารถเก็บและดึงข้อมูลมาใช้ได้ ในการเยี่ยมชมเว็บไซต์ครังนี้

 แก้ไขในไฟล์ html ทุกไฟล์
โดยการเพิ่ม ตัวแปร theme

ไปเพื่มในไฟล์ views.py ให้ดึงค่า theme จาก session หากไม่เจอค่า theme จะเอาค่า 'css/boostrap.min.css' มาใช้เลย














ฟังก์ชั่นเปลี่ยน theme โดยจะดึงค่าจาก GET( ตัวแปร theme ) มาเพื่อเทียบว่าใช้ theme อันไหน
แล้วตั้งค่าใน session

2 ความคิดเห็น:

commit เพิ่มเติม : เพื่ม userstory, bookmark

>>  add userstory ทำการเพิ่ม userstory ใน functional tests >>  add bookmark for user เพิ่มระบบ Bookmark โดยการสร้าง model ขึ...