File tree Expand file tree Collapse file tree 6 files changed +116
-11
lines changed Expand file tree Collapse file tree 6 files changed +116
-11
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,10 @@ def __send_notification(post):
92
92
channel_layer .group_send )(
93
93
"notifier" ,
94
94
{"type" : "send.notification" , "id" : str (post .id ),
95
- "thumnail_photo" : post .thumnail_photo , "title" : post .title })
95
+ "thumnail_photo" : post .thumnail_photo , "title" : post .title ,
96
+ "created_at" : post .created_at .strftime ('%b %d, %Y' ),
97
+ "author_screen_name" : post .author_screen_name ,
98
+ "rtl" : post .rtl })
96
99
97
100
@classmethod
98
101
def __add_post_to_user (cls , post , user_id ):
Original file line number Diff line number Diff line change @@ -686,6 +686,57 @@ ul {
686
686
margin-top : 0 ;
687
687
}
688
688
}
689
+
690
+ .author__block__rtl {
691
+ display : block;
692
+ position : relative;
693
+ padding-right : 100px ;
694
+ }
695
+ .author__block__rtl .author__avatar {
696
+ left : unset;
697
+ right : 0 ;
698
+ }
699
+ .author__block__rtl .author__name {
700
+ text-align : right;
701
+ }
702
+ .author__block__rtl .author__description {
703
+ text-align : right;
704
+ }
705
+
706
+ .author__block {
707
+ display : block;
708
+ position : relative;
709
+ padding-left : 100px ;
710
+ }
711
+ .author__avatar {
712
+ position : absolute;
713
+ top : 0 ;
714
+ left : 0 ;
715
+ width : 88px ;
716
+ height : 88px ;
717
+ border-radius : 50% ;
718
+ }
719
+
720
+ .author__name {
721
+ display : block;
722
+ font-size : 16px ;
723
+ color : # 222831 ;
724
+ line-height : 22px ;
725
+ letter-spacing : 0.4px ;
726
+ margin-bottom : 5px ;
727
+ font-family : "cairo-semibold" ;
728
+ }
729
+
730
+ .author__description {
731
+ word-wrap : break-word;
732
+ margin-top : 15px ;
733
+ margin-bottom : 0 ;
734
+ width : 100% ;
735
+ font-size : 16px ;
736
+ line-height : 26px ;
737
+ color : # 222831 ;
738
+ }
739
+
689
740
.comments {
690
741
padding-top : 20px ;
691
742
margin-top : 50px ;
Original file line number Diff line number Diff line change @@ -695,6 +695,57 @@ ul {
695
695
margin-top : 0 ;
696
696
}
697
697
}
698
+
699
+ .author__block__rtl {
700
+ display : block;
701
+ position : relative;
702
+ padding-right : 100px ;
703
+ }
704
+ .author__block__rtl .author__avatar {
705
+ left : unset;
706
+ right : 0 ;
707
+ }
708
+ .author__block__rtl .author__name {
709
+ text-align : right;
710
+ }
711
+ .author__block__rtl .author__description {
712
+ text-align : right;
713
+ }
714
+
715
+ .author__block {
716
+ display : block;
717
+ position : relative;
718
+ padding-left : 100px ;
719
+ }
720
+ .author__avatar {
721
+ position : absolute;
722
+ top : 0 ;
723
+ left : 0 ;
724
+ width : 88px ;
725
+ height : 88px ;
726
+ border-radius : 50% ;
727
+ }
728
+
729
+ .author__name {
730
+ display : block;
731
+ font-size : 16px ;
732
+ color : # fff ;
733
+ line-height : 22px ;
734
+ letter-spacing : 0.4px ;
735
+ margin-bottom : 5px ;
736
+ font-family : "cairo-semibold" ;
737
+ }
738
+
739
+ .author__description {
740
+ word-wrap : break-word;
741
+ margin-top : 15px ;
742
+ margin-bottom : 0 ;
743
+ width : 100% ;
744
+ font-size : 16px ;
745
+ line-height : 26px ;
746
+ color : # fff ;
747
+ }
748
+
698
749
.comments {
699
750
padding-top : 20px ;
700
751
margin-top : 50px ;
714
765
align-items : flex-end;
715
766
margin-top : 30px ;
716
767
}
768
+
717
769
.comments__autor {
718
770
display : block;
719
771
position : relative;
Original file line number Diff line number Diff line change @@ -146,11 +146,10 @@ $(document).ready(function () {
146
146
return false ;
147
147
}
148
148
149
- document . querySelectorAll ( ".description-block " ) . forEach ( ( e ) => {
149
+ document . querySelectorAll ( ".author__description " ) . forEach ( ( e ) => {
150
150
if ( isUnicode ( e . innerText ) ) {
151
151
e . style . direction = "rtl" ;
152
+ document . querySelector ( ".author__block" ) . classList . add ( "author__block__rtl" ) ;
152
153
}
153
154
} ) ;
154
155
} ) ;
155
-
156
-
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ socket.onopen = function open() {
7
7
socket . onmessage = function recieve ( message ) {
8
8
const data = JSON . parse ( message . data ) ;
9
9
const post = data . event ;
10
- console . log ( post ) ;
11
10
$ . notifyClose ( ) ;
12
11
$ . notify (
13
12
{
@@ -38,9 +37,10 @@ socket.onmessage = function recieve(message) {
38
37
${ post . thumnail_photo }
39
38
</div>
40
39
<div class="post__meta">
41
- <span>now</span>
40
+ <span>${ post . created_at } </span>
41
+ <span>author : ${ post . author_screen_name } </span>
42
42
</div>
43
- <h3 class="post__title">${ post . title } </h3>
43
+ <h3 class="post__title" ${ post . rtl ? 'style="direction: rtl; text-align: right;"' : "" } " >${ post . title } </h3>
44
44
<div class="post__wrap">
45
45
<a href="/post/${ post . id } " class="post__link">Read more</a>
46
46
<div class="post__comments">
Original file line number Diff line number Diff line change 38
38
< div class ="container ">
39
39
< div class ="row ">
40
40
< div class ="col-12 ">
41
- < div class ="comments__autor " style =" height: unset; padding-right:100px ">
42
- < img class ="comments__avatar " src ="{{post.author_photo}} " alt ="" style =" width: 88px;height:88px ">
43
- < span class ="comments__name "> < a href ="https://twitter.com/{{post.author_screen_name}} "
41
+ < div class ="author__block ">
42
+ < img class ="author__avatar " src ="{{post.author_photo}} " alt ="">
43
+ < span class ="author__name "> < a href ="https://twitter.com/{{post.author_screen_name}} "
44
44
target ="_blank "> {{post.author_name}}</ a > </ span >
45
- < p class ="comments__text description-block "> {{post.author_describtion}}</ p > </ span > </ span >
45
+ < p class ="author__description "> {{post.author_describtion}}</ p > </ span > </ span >
46
46
</ div >
47
47
</ div >
48
48
< div class ="col-12 " style ="margin-top: 50px; ">
You can’t perform that action at this time.
0 commit comments