mirror of
				https://github.com/DerTyp7/tealcode-django-python.git
				synced 2025-10-31 05:07:08 +01:00 
			
		
		
		
	a-current
a
This commit is contained in:
		| @@ -35,13 +35,17 @@ body header div a{ | |||||||
|     cursor:pointer; |     cursor:pointer; | ||||||
|     transition: 0.1s; |     transition: 0.1s; | ||||||
|     transition-timing-function: linear;     |     transition-timing-function: linear;     | ||||||
|  |     text-decoration: none; | ||||||
|     font-weight: bold; |     font-weight: bold; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | body header div .a-current{ | ||||||
|  |     color:rgb(0, 255, 106); | ||||||
|  |     text-decoration: underline; | ||||||
|  | } | ||||||
|  |  | ||||||
| body header div a:hover{ | body header div a:hover{ | ||||||
|     color:rgb(226, 4, 255); |     color:rgb(0, 255, 106); | ||||||
|      |  | ||||||
|     text-decoration: underline; |     text-decoration: underline; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -62,6 +66,7 @@ body main #main-content{ | |||||||
| body main #main-content #main-headline h2{ | body main #main-content #main-headline h2{ | ||||||
|     text-align: center; |     text-align: center; | ||||||
|     letter-spacing: 2.5px; |     letter-spacing: 2.5px; | ||||||
|  |     text-transform: capitalize; | ||||||
| } | } | ||||||
|  |  | ||||||
| body main #main-content #main-content-code{ | body main #main-content #main-content-code{ | ||||||
|   | |||||||
| @@ -20,12 +20,12 @@ | |||||||
|         <h1>TealFire</h1> |         <h1>TealFire</h1> | ||||||
|  |  | ||||||
|         <div> |         <div> | ||||||
|             <a href="/category/python/">Python</a> |             <a id="a-python" href="/category/python/">Python</a> | ||||||
|             <a>C#</a> |             <a id="a-cs" href="/category/cs/">C#</a> | ||||||
|             <a>C++</a> |             <a id="a-c++" href="/category/c++/">C++</a> | ||||||
|             <a>C</a> |             <a id="a-c" href="/category/c/">C</a> | ||||||
|             <a>Java</a> |             <a id="a-java" href="/category/java/">Java</a> | ||||||
|             <a>JavaScript</a> |             <a id="a-javascript" href="/category/javascript/">JavaScript</a> | ||||||
|         </div> |         </div> | ||||||
|     </header> |     </header> | ||||||
|     <main> |     <main> | ||||||
| @@ -37,5 +37,15 @@ | |||||||
|  |  | ||||||
|     <script src="{% static 'main/highlight/highlight.min.js' %}"></script> |     <script src="{% static 'main/highlight/highlight.min.js' %}"></script> | ||||||
|     <script>hljs.highlightAll();</script> |     <script>hljs.highlightAll();</script> | ||||||
|  |  | ||||||
|  |     <script> | ||||||
|  |         {% if category_title %} | ||||||
|  |             document.getElementById("a-{{ category_title }}").classList.add("a-current"); | ||||||
|  |         {% else %} | ||||||
|  |             document.getElementById("a-{{ category_obj.title }}").classList.add("a-current"); | ||||||
|  |         {% endif %} | ||||||
|  |          | ||||||
|  |          | ||||||
|  |     </script> | ||||||
| </body> | </body> | ||||||
| </html> | </html> | ||||||
| @@ -2,36 +2,27 @@ | |||||||
| {% block content %} | {% block content %} | ||||||
|      |      | ||||||
|     <div id="main-headline"> |     <div id="main-headline"> | ||||||
|  |     {% if category_obj.title == "cs" %} | ||||||
|  |         <h2>C#</h2> | ||||||
|  |  | ||||||
|  |     {% else %} | ||||||
|         <h2>{{ category_obj.title }}</h2> |         <h2>{{ category_obj.title }}</h2> | ||||||
|  |     {% endif %} | ||||||
|     </div> |     </div> | ||||||
|     <div id="list"> |     <div id="list"> | ||||||
|         <div class="list-item"> |         {% for topic in topics %} | ||||||
|             <img src="c_icon.png"/> |         <div class="list-item" onclick="openTopic('{{ topic.title }}')"> | ||||||
|             <p>How To 1 in c</p> |             <!--<img src="c_icon.png"/>--> | ||||||
|         </div> |             <p>{{ topic.title }}</p> | ||||||
|         <div class="list-item"> |  | ||||||
|             <img src="c_icon.png"/> |  | ||||||
|             <p>How To 1 in c</p> |  | ||||||
|         </div> |  | ||||||
|         <div class="list-item"> |  | ||||||
|             <img src="c_icon.png"/> |  | ||||||
|             <p>How To 1 in c</p> |  | ||||||
|         </div> |  | ||||||
|         <div class="list-item"> |  | ||||||
|             <img src="c_icon.png"/> |  | ||||||
|             <p>How To 1 in c</p> |  | ||||||
|         </div> |  | ||||||
|         <div class="list-item"> |  | ||||||
|             <img src="c_icon.png"/> |  | ||||||
|             <p>How To 1 in c</p> |  | ||||||
|         </div> |  | ||||||
|         <div class="list-item"> |  | ||||||
|             <img src="c_icon.png"/> |  | ||||||
|             <p>How To 1 in c</p> |  | ||||||
|         </div> |  | ||||||
|         <div class="list-item"> |  | ||||||
|             <img src="c_icon.png"/> |  | ||||||
|             <p>How To 1 in c</p> |  | ||||||
|         </div> |         </div> | ||||||
|  |         {% endfor %} | ||||||
|  |  | ||||||
|  |          | ||||||
|     </div>    |     </div>    | ||||||
|  |  | ||||||
|  |     <script> | ||||||
|  |         function openTopic(topic){ | ||||||
|  |             window.open("/topic/{{ category_obj.title }}/" + topic, "_self"); | ||||||
|  |         } | ||||||
|  |     </script> | ||||||
| {% endblock content %} | {% endblock content %} | ||||||
| @@ -5,6 +5,7 @@ | |||||||
|             </div> |             </div> | ||||||
|  |  | ||||||
|     <div id="main-content-code"> |     <div id="main-content-code"> | ||||||
|  |          | ||||||
|         <pre><code  style="padding-top: 5px; padding-bottom: 5px;"class="language-{{category_title}}">{{code}}</code></pre> |         <pre><code  style="padding-top: 5px; padding-bottom: 5px;"class="language-{{category_title}}">{{code}}</code></pre> | ||||||
|     </div> |     </div> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -28,7 +28,8 @@ def category(req, category): | |||||||
|     if category: |     if category: | ||||||
|         category_obj = Category.objects.filter(title = category).first() |         category_obj = Category.objects.filter(title = category).first() | ||||||
|         if category_obj: |         if category_obj: | ||||||
|             return render(req, "main/category.html", {'category_obj': category_obj}) |             topics_obj = Topic.objects.filter(category=category_obj) | ||||||
|  |             return render(req, "main/category.html", {'category_obj': category_obj, 'topics': topics_obj}) | ||||||
|          |          | ||||||
|      |      | ||||||
|     return redirect("main-index") |     return redirect("main-index") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187