@@ -566,6 +566,9 @@ <h4 class="text-[16px] font-semibold uppercase tracking-wide mb-2">
566
566
< button class ="mr-3 " onclick ="openBookmarkModal(); ">
567
567
< div class ="bg-[#f4f4f4] rounded-2xl p-3 m-2 "> 📑 {% trans "Bookmarks" %} {{ bookmarks|length }}</ div >
568
568
</ button >
569
+ < button class ="mr-3 " onclick ="openKudosModal(); ">
570
+ < div class ="bg-[#f4f4f4] rounded-2xl p-3 m-2 "> 🌟 Kudos {{ user.kudos_received.count }}</ div >
571
+ </ button >
569
572
< button class ="mr-3 ">
570
573
< div class ="bg-[#f4f4f4] rounded-2xl p-3 m-2 "> 👁️ {% trans "Profile Views" %} {{ user.userprofile.visit_count }}</ div >
571
574
</ button >
@@ -860,6 +863,73 @@ <h3 class="text-lg font-semibold mb-4">Assign a Badge</h3>
860
863
</ form >
861
864
</ div >
862
865
</ div >
866
+ <!-- Kudos modal -->
867
+ < div id ="Kudos "
868
+ class ="hidden relative z-10 "
869
+ aria-labelledby ="modal-title "
870
+ role ="dialog "
871
+ aria-modal ="true ">
872
+ < div class ="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity "
873
+ aria-hidden ="true "> </ div >
874
+ < div class ="fixed inset-0 z-10 w-screen overflow-y-auto ">
875
+ < div class ="flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0 ">
876
+ < div class ="relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 max-sm:w-full lg:w-[30vw] ">
877
+ < div class ="bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4 ">
878
+ < div class ="sm:flex sm:items-start lg:w-full ">
879
+ < div class ="mt-3 sm:ml-4 sm:mt-0 sm:text-left lg:w-full ">
880
+ < div class ="mt-2 ">
881
+ < h3 > Appreciation Received:</ h3 >
882
+ < br >
883
+ < p class ="text-xl ">
884
+ < table class ="table-auto w-full border-spacing-52 ">
885
+ < tbody >
886
+ {% for k in user.kudos_received.all %}
887
+ < tr class ="shadow-lg m-3 w-full rounded ">
888
+ < td >
889
+ {% if k.sender.userprofile.avatar %}
890
+ < img src ="{{ k.sender.userprofile.avatar }} "
891
+ height ="50 "
892
+ width ="50 "
893
+ alt ="{{ k.sender.username }} ">
894
+ {% else %}
895
+ < img src ="{% gravatar_url k.sender.email 50 %} "
896
+ height ="50 "
897
+ width ="50 "
898
+ alt ="{{ k.sender.username }} ">
899
+ {% endif %}
900
+ </ td >
901
+ < td >
902
+ < a href ="{% url 'profile' slug=k.sender.username %} "> {{ k.sender.username }}</ a >
903
+ </ td >
904
+ < td > {{ k.timestamp }}</ td >
905
+ </ tr >
906
+ {% endfor %}
907
+ </ tbody >
908
+ </ table >
909
+ </ p >
910
+ </ div >
911
+ </ div >
912
+ </ div >
913
+ </ div >
914
+ < div class ="bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6 ">
915
+ < button type ="button "
916
+ class ="mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-xl font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto "
917
+ id ="close-kudos "> Close</ button >
918
+ </ div >
919
+ </ div >
920
+ </ div >
921
+ </ div >
922
+ </ div >
923
+ < script defer >
924
+ var closeKudos = document . getElementById ( "close-kudos" ) ;
925
+ var openKudos = document . getElementById ( "Kudos" ) ;
926
+ closeKudos . addEventListener ( "click" , ( ) => {
927
+ openKudos . style . display = "none" ;
928
+ } ) ;
929
+ function openKudosModal ( ) {
930
+ openKudos . style . cssText = "display:block !important;" ;
931
+ }
932
+ </ script >
863
933
< script >
864
934
// Assign Badge Modal Logic
865
935
const addBadgeButton = document . getElementById ( "add-badge-button" ) ;
0 commit comments