|
4 | 4 |
|
5 | 5 | {% block content %} |
6 | 6 |
|
7 | | -{% comment %} <main> |
8 | | - <div class="px-4 pt-6 flex flex-row gap-7"> |
9 | | - <div class="w-full max-w-sm bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700"> |
10 | | - <div class="flex justify-end px-4 pt-4"> |
11 | | - <button id="dropdownButton" data-dropdown-toggle="dropdown" class="inline-block text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-4 focus:outline-none focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-1.5" type="button"> |
12 | | - <span class="sr-only">Open dropdown</span> |
13 | | - <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 3"> |
14 | | - <path d="M2 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm6.041 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM14 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z"/> |
15 | | - </svg> |
16 | | - </button> |
17 | | - <!-- Dropdown menu --> |
18 | | - <div id="dropdown" class="z-10 hidden text-base list-none bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700"> |
19 | | - <ul class="py-2" aria-labelledby="dropdownButton"> |
20 | | - <li> |
21 | | - <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">Edit</a> |
22 | | - </li> |
23 | | - <li> |
24 | | - <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">Export Data</a> |
25 | | - </li> |
26 | | - <li> |
27 | | - <a href="#" class="block px-4 py-2 text-sm text-red-600 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">Delete</a> |
28 | | - </li> |
29 | | - </ul> |
30 | | - </div> |
31 | | - </div> |
32 | | - <div class="flex flex-col items-center pb-10"> |
33 | | - {% if request.user.profile.avatar %} |
34 | | - <img class="w-24 h-24 mb-3 rounded-full shadow-lg" src="{{ request.user.profile.avatar.url }}" alt="Bonnie image"/> |
35 | | - {% else %} |
36 | | - <img class="w-24 h-24 mb-3 rounded-full shadow-lg" src="{% static "dist/img/default-user.png" %}" alt="Bonnie image"/> |
37 | | - {% endif %} |
38 | | - <h5 class="mb-1 text-xl font-medium text-gray-900 dark:text-white"> |
39 | | - {% if request.user.profile.full_name %} |
40 | | - {{request.user.profile.full_name}} |
41 | | - {% else %} |
42 | | - {{ request.user.username }} |
43 | | - {% endif %} |
44 | | - </h5> |
45 | | - <span class="text-sm text-gray-500 dark:text-gray-400 block mb-2">{{ request.user.profile.role }}</span> |
46 | | - <span class="text-sm text-gray-500 dark:text-gray-400 block mb-2">{{ request.user.profile.phone }}</span> |
47 | | - <span class="text-sm text-gray-500 dark:text-gray-400 block mb-2">{{ request.user.profile.address }}</span> |
48 | | - </div> |
49 | | - </div> |
50 | | - |
51 | | - <form method="post" class="w-full border border-gray-200 rounded-lg p-3 shadow dark:bg-gray-800 dark:border-gray-700" enctype="multipart/form-data"> |
52 | | - {% csrf_token %} |
53 | | - |
54 | | - {% for field in form %} |
55 | | - <div class="relative z-0 w-full mb-6 group"> |
56 | | - <label for="{{ field.name }}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ field.label }}</label> |
57 | | - {{ field }} |
58 | | - </div> |
59 | | - {% endfor %} |
60 | | - <button type="submit" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Submit</button> |
61 | | - </form> |
62 | | - |
63 | | - </div> |
64 | | -</main> {% endcomment %} |
65 | | - |
66 | 7 | <div class="grid grid-cols-1 px-4 pt-6 xl:grid-cols-3 xl:gap-4 dark:bg-gray-900"> |
67 | 8 | <div class="mb-4 col-span-full xl:mb-2"> |
68 | 9 | <nav class="flex mb-5" aria-label="Breadcrumb"> |
@@ -107,15 +48,19 @@ <h3 class="mb-1 text-xl font-bold text-gray-900 dark:text-white">{{ request.user |
107 | 48 | <div class="mb-4 text-sm text-gray-500 dark:text-gray-400"> |
108 | 49 | JPG, GIF or PNG. Max size of 800K |
109 | 50 | </div> |
110 | | - <div class="flex items-center space-x-4"> |
111 | | - <button type="button" class="inline-flex items-center px-3 py-2 text-sm font-medium text-center text-white rounded-lg bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-blue-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"> |
112 | | - <svg class="w-4 h-4 mr-2 -ml-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13H5.5z"></path><path d="M9 13h2v5a1 1 0 11-2 0v-5z"></path></svg> |
113 | | - Upload picture |
114 | | - </button> |
| 51 | + <form method="post" action="{% url "upload_avatar" %}" enctype="multipart/form-data" class="flex items-center space-x-4"> |
| 52 | + {% csrf_token %} |
| 53 | + <label for="avatar"> |
| 54 | + <div class="inline-flex items-center px-3 py-2 text-sm font-medium text-center text-white rounded-lg bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-blue-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"> |
| 55 | + <svg class="w-4 h-4 mr-2 -ml-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13H5.5z"></path><path d="M9 13h2v5a1 1 0 11-2 0v-5z"></path></svg> |
| 56 | + Upload picture |
| 57 | + </div> |
| 58 | + </label> |
| 59 | + <input onchange="this.form.submit()" type="file" class="hidden" name="avatar" id="avatar"> |
115 | 60 | <button type="button" class="py-2 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"> |
116 | 61 | Delete |
117 | 62 | </button> |
118 | | - </div> |
| 63 | + </form> |
119 | 64 | </div> |
120 | 65 | </div> |
121 | 66 | </div> |
@@ -153,7 +98,7 @@ <h3 class="mb-4 text-xl font-semibold dark:text-white">Language & Time</h3> |
153 | 98 | <div class="col-span-2"> |
154 | 99 | <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800"> |
155 | 100 | <h3 class="mb-4 text-xl font-semibold dark:text-white">General information</h3> |
156 | | - <form method="post" enctype="multipart/form-data"> |
| 101 | + <form method="post"> |
157 | 102 | {% csrf_token %} |
158 | 103 |
|
159 | 104 | <div class="grid grid-cols-6 gap-6"> |
|
0 commit comments