add traits back office view
This commit is contained in:
		
							parent
							
								
									5cbfc79809
								
							
						
					
					
						commit
						969ef67c08
					
				| @ -159,7 +159,10 @@ class Trait(Base): | ||||
|         self.DESC_LID = DESC_LID | ||||
| 
 | ||||
|     def __str__(self) -> str: | ||||
|         return f"{self.TRAIT_ID} {self.NAME_LID}" | ||||
|         return f"Trait(TRAIT_ID={self.TRAIT_ID}, NAME_LID={self.NAME_LID}, DESC_LID={self.DESC_LID})" | ||||
|          | ||||
|     def __repr__(self) -> str: | ||||
|         return self.__str__() | ||||
| 
 | ||||
| 
 | ||||
| class Reaction(Base): | ||||
|  | ||||
| @ -40,3 +40,9 @@ def places(): | ||||
|     places_objs = db.session.query(Place).all() | ||||
|     places_dicts = [{"id": place_obj.PLACE_ID, "name": place_obj.LOCALE.TEXTS[0].TEXT} for place_obj in places_objs] | ||||
|     return flask.render_template("admin/places.html", places=places_dicts) | ||||
| 
 | ||||
| @routes_admin.route("/traits") | ||||
| def traits(): | ||||
|     traits_objs = db.session.query(Trait).all() | ||||
|     traits_dicts = [{"id": trait_obj.TRAIT_ID, "name": trait_obj.Name.TEXTS[0].TEXT, "desc": trait_obj.Desc.TEXTS[0].TEXT} for trait_obj in traits_objs] | ||||
|     return flask.render_template("admin/traits.html", traits=traits_dicts) | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
| <br> | ||||
| <a href="/admin/places"> Places </a> | ||||
| <br> | ||||
| <a href="/admin/reactions"> Reactions </a> | ||||
| <a href="/admin/traits"> Traits </a> | ||||
| <section> | ||||
|     <p> NPC list :</p> | ||||
|     {%for npc in npcs%} | ||||
|  | ||||
| @ -1 +0,0 @@ | ||||
| <a href="/admin"> go Back </a> <br> | ||||
							
								
								
									
										14
									
								
								truthinquiry/templates/admin/traits.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								truthinquiry/templates/admin/traits.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | ||||
| <a href="/admin"> go Back </a> <br> | ||||
| 
 | ||||
| <section>     | ||||
|     {%for trait in traits%} | ||||
|     <section id="{{trait['id']}}"> | ||||
|         <p> Name: </p> | ||||
|         <input value="{{trait['name']}}"> | ||||
|         <p> Description: </p> | ||||
|         <input value="{{trait['desc']}}"> | ||||
|     </section> | ||||
|     {%endfor%} | ||||
| </section> | ||||
| 
 | ||||
| <p>Images are viewable in the npc views</p> | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user