Browse code

CSS pre konverziacie, fixy v rosteri

Cinan Rakosnik authored on 06/03/2013 at 09:23:29
Showing 7 changed files
... ...
@@ -7,4 +7,7 @@ $gray: #b0b7b9;
7 7
 $gray-light: #dde0e3;
8 8
 $black: #282828;
9 9
 
10
+$border-color: #c5c6c9;
11
+$status-color: #b0b7b9;
12
+
10 13
 $error: #AD3A3A;
11 14
\ No newline at end of file
... ...
@@ -1,15 +1,27 @@
1 1
 /*
2 2
  *= require normalize-rails
3
+ *= require iconfonts
3 4
  *= require_self
4
- *= require_tree .
5 5
 */
6 6
 
7
-@import "config";
8 7
 @import "compass/css3/box-sizing";
9 8
 
9
+@import "config";
10
+@import "chat.css.scss";
11
+@import "sessions.css.scss";
12
+
10 13
 body {
11 14
   background: $bg-color;
12 15
   border-top: #658489 7px solid;
16
+  font-size: 12px;
17
+}
18
+
19
+a {
20
+  text-decoration: none;
21
+}
22
+
23
+a:visited {
24
+  color: inherit
13 25
 }
14 26
 
15 27
 input {
... ...
@@ -33,26 +45,32 @@ input {
33 33
   }
34 34
 
35 35
   &:focus {
36
-    outline: 5px auto $app-color;
36
+    outline: none;
37
+    box-shadow: 0px 0px 1px 1px $app-color;
38
+    border: 1px solid white !important;
37 39
   }
38 40
 }
39 41
 
40 42
 .top-border {
41
-  border-top: 5px solid $app-color;
43
+  box-shadow: 0 -5px 0 $app-color;
42 44
 }
43 45
 
44 46
 .left-border {
45
-  border-left: 5px solid $app-color !important;
47
+  box-shadow: -5px 0 0 $app-color;
46 48
 }
47 49
 
48 50
 .border {
49
-  border: solid 1px #c5c6c9;
51
+  border: solid 1px $border-color;
50 52
 }
51 53
 
52 54
 .no-top-border {
53 55
   border-top: 0;
54 56
 }
55 57
 
58
+.no-left-border {
59
+  border-left: 0;
60
+}
61
+
56 62
 .alert {
57 63
   font-size: 12px;
58 64
   &.alert-notice {
... ...
@@ -68,6 +86,10 @@ input {
68 68
   float: left;
69 69
 }
70 70
 
71
+.right {
72
+  float: right;
73
+}
74
+
71 75
 .clear {
72 76
   clear: both;
73 77
 }
74 78
\ No newline at end of file
... ...
@@ -1,14 +1,16 @@
1
-@import "config";
2
-
3 1
 .container {
4 2
   width: 1000px;
5
-  padding: 5px 17px;
3
+  padding: 10px 17px;
6 4
 }
7 5
 
8 6
 .leftside {
9 7
   width: 23%;
10 8
 }
11 9
 
10
+.rightside {
11
+  width: 75%;
12
+}
13
+
12 14
 .roster {
13 15
   background: $bg-roster;
14 16
   padding: 16px 9px 9px;
... ...
@@ -24,10 +26,6 @@
24 24
   padding: 4px 3px;
25 25
   margin-right: -9px;
26 26
 
27
-  &:hover {
28
-    background: #fbfbfb;
29
-  }
30
-
31 27
   h1, h2, h3 {
32 28
     margin: 0 0 1px;
33 29
   }
... ...
@@ -47,13 +45,30 @@
47 47
 
48 48
   h3 {
49 49
     font-size: 12px;
50
-    color: #b0b7b9;
50
+    color: $status-color;
51
+    margin-top: -3px;
52
+
53
+    .drop-down {
54
+      position: relative;
55
+      top: 2px;
56
+      left: -2px;
57
+      font-size: 13px;
58
+    }
51 59
   }
52 60
 
53 61
   .avatar {
54 62
     float: left;
55 63
     margin-right: 8px;
56
-    height: 46px;
64
+
65
+    img {
66
+      height: 32px;
67
+    }
68
+
69
+    &.bigger {
70
+      img {
71
+        height: 46px;
72
+      }
73
+    }
57 74
   }
58 75
 }
59 76
 
... ...
@@ -75,34 +90,266 @@
75 75
 
76 76
     li {
77 77
       list-style: none;
78
-
79
-      img {
80
-        width: 32px;
81
-      }
82 78
     }
83 79
   }
84 80
 
81
+  .user:hover {
82
+    background: #fbfbfb;
83
+  }
84
+
85 85
   .active-group {
86
-    margin: 0 -14px 0 -10px;
86
+    margin: 0 -16px 0 -5px;
87 87
     padding: 8px 10px;
88 88
     background: white;
89 89
     border-right: 1px solid #fcfcfc;
90 90
 
91
+    &::before {
92
+      content: '';
93
+      border-left: 5px solid #24a396 !important;
94
+      display: block;
95
+      width: 0;
96
+      height: 0;
97
+    }
98
+
91 99
     .user {
92
-      margin-right: -6px;
100
+      margin-right: -5px;
93 101
 
94 102
       &:hover {
95 103
         background: $bg-roster;
96 104
       }
97 105
     }
98 106
   }
107
+
108
+  .action {
109
+    margin-right: 2px;
110
+
111
+    .icon-bubble:before {
112
+      margin-left: 6px;
113
+    }
114
+
115
+    .icon-bubbles:before {
116
+      margin-left: 6px;
117
+    }
118
+
119
+    .icon-x-full:before {
120
+      margin-left: 6px;
121
+    }
122
+
123
+    &.invite {
124
+
125
+    }
126
+  }
127
+}
128
+
129
+.status {
130
+  font-size: 15px;
131
+  position: relative;
132
+  top: 2px;
133
+
134
+  &::before {
135
+    content: '\26AB'
136
+  }
137
+
138
+  &.online {
139
+    color: #83C91F;
140
+  }
141
+
142
+  &.away {
143
+    color: #E6D105;
144
+  }
145
+
146
+  &.dnd {
147
+    color: #DC4E06;
148
+  }
149
+
150
+  &.offline {
151
+    color: #848F99;
152
+  }
99 153
 }
100 154
 
101 155
 .toolbox {
102 156
   position: absolute;
103 157
   bottom: 0;
158
+  width: 93%;
159
+
160
+  input {
161
+    width: 75%;
162
+    height: 22px;
163
+    border-radius: 16px;
164
+    margin-right: 6px;
165
+    padding-left: 10px;
166
+    padding-right: 10px;
167
+    display: block;
168
+    float: left;
169
+  }
170
+
171
+  a, a:visited {
172
+    color: $app-color;
173
+    border: 1px solid #dde0e3;
174
+    border-radius: 12px;
175
+    padding: 5px 4px 4px 5px;
176
+    margin-left: 0;
177
+    width: 13px;
178
+    height: 13px;
179
+    background: white;
180
+    display: inline-block;
181
+  }
104 182
 }
105 183
 
106 184
 .chatting-window {
185
+  padding-left: 5px;
186
+  min-height: 400px;
187
+}
188
+
189
+.tabbar {
107 190
 
108
-}
109 191
\ No newline at end of file
192
+  .tab {
193
+    background: #f7f6f5;
194
+    width: 132px;
195
+    border: $border-color 1px solid;
196
+    float: left;
197
+    padding: 10px 7px 6px 7px;
198
+    margin: 0 4px -1px 0;
199
+    font-size: 15px;
200
+    color: $bg-color;
201
+
202
+    &:last-child {
203
+      margin-right: 0;
204
+    }
205
+
206
+    &.active {
207
+      width: 240px;
208
+      background: $bg-roster;
209
+      font-weight: bold;
210
+      color: $app-color;
211
+      padding-bottom: 5px;
212
+      border-top: 0;
213
+      padding-top: 12px;
214
+      line-height: 17px;
215
+    }
216
+
217
+    .icon {
218
+      margin-right: 4px;
219
+    }
220
+  }
221
+}
222
+
223
+.conversation {
224
+  background: white;
225
+  padding: 9px;
226
+
227
+  .event {
228
+    color: $status-color;
229
+    font-weight: bold;
230
+    font-size: 12px;
231
+    margin: 10px auto 0;
232
+    width: 50%;
233
+    text-align: center;
234
+  }
235
+
236
+  .message-box {
237
+    width: 75%;
238
+    color: #393939;
239
+    background: $bg-roster;
240
+    border: 1px solid $gray-light;
241
+    border-radius: 5px;
242
+    padding: 0 10px;
243
+    margin-top: 10px;
244
+    margin-left: 45px;
245
+    position: relative;
246
+
247
+    &::after, &::before {
248
+      content: '';
249
+      display: block;
250
+      width: 0;
251
+      height: 0;
252
+      border-right: 8px solid #f4f4f4;
253
+      border-bottom: 8px solid rgba(255,255,255,0);
254
+      border-top: 8px solid rgba(255,255,255,0);
255
+      position: absolute;
256
+      left: -8px;
257
+      top: 14px;
258
+    }
259
+
260
+    &::before {
261
+      z-index: 20;
262
+    }
263
+
264
+    &::after {
265
+      height: 2px;
266
+      border-right: 8px solid $gray-light;
267
+      left: -9px;
268
+      top: 13px;
269
+    }
270
+
271
+    &.active {
272
+      background: #dfecea;
273
+
274
+      &::before {
275
+        border-right: 8px solid #dfecea;
276
+      }
277
+    }
278
+
279
+    .date {
280
+      color: #949494;
281
+      text-shadow: white 1px 1px;
282
+    }
283
+
284
+    p {
285
+      margin: 4px 0 8px;
286
+    }
287
+
288
+    .user {
289
+      margin-left: -59px;
290
+
291
+      &:hover {
292
+        background: transparent;
293
+      }
294
+    }
295
+  }
296
+}
297
+
298
+.message-writer {
299
+  padding-top: 20px;
300
+  padding-left: 9px;
301
+  border-top: 1px solid $gray-light;
302
+  margin: 10px -9px 0;
303
+  position: relative;
304
+
305
+  input {
306
+    margin-top: 0;
307
+    border-color: black;
308
+    font-weight: bold;
309
+  }
310
+
311
+  input[type="text"] {
312
+    font-size: 12px;
313
+    width: 90%;
314
+    margin-right: 5px;
315
+    border-color: $gray-light;
316
+    color: $app-color;
317
+
318
+
319
+  }
320
+
321
+  ::-webkit-input-placeholder {
322
+    color: $app-color;
323
+    opacity: 1;
324
+  }
325
+  ::-moz-placeholder {
326
+    color: $app-color;
327
+    opacity: 1;
328
+  }
329
+  :-ms-input-placeholder {
330
+    color: $app-color;
331
+    opacity: 1;
332
+  }
333
+
334
+  input[type="submit"] {
335
+    font-size: 17px;
336
+    width: 8%;
337
+    position: absolute;
338
+    right: 8px;
339
+    margin: 0;
340
+  }
341
+}
... ...
@@ -1,5 +1,3 @@
1
-@import "config";
2
-
3 1
 label {
4 2
   display: block;
5 3
   color: $gray;
... ...
@@ -1,7 +1,7 @@
1 1
 class ApplicationController < ActionController::Base
2 2
   #protect_from_forgery
3 3
 
4
-	before_filter :require_login
4
+	#before_filter :require_login
5 5
 
6 6
 	def require_login
7 7
 		#if controller_name == 'sessions' && action_name == 'new'
... ...
@@ -2,46 +2,129 @@
2 2
 - content_for :javascript, javascript_include_tag("application")
3 3
 
4 4
 .container
5
-  .top-border.leftside.left
6
-    .roster.border.no-top-border.height-setter
5
+  .leftside.left
6
+    .roster.border.no-top-border.top-border.height-setter
7 7
       .user
8
-        .avatar
8
+        .avatar.bigger
9 9
           %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
10 10
         %h1 Cinan Rakosnik
11 11
         %h2 frontend developer
12
-        %h3 available
12
+        %h3
13
+          %span.status.online
14
+          %a{ href: "#"}
15
+            available
16
+            %span.icon-arrow-down.drop-down
13 17
       .friends
14 18
         %h1.group-header.active Chat group
15
-        %ul.active-group.border.left-border
16
-          %li.clear
17
-            .user
18
-              .avatar
19
-                %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
20
-              %h1 Adam Wolsky
21
-              %h2 co-founder
22
-          %li.clear
23
-            .user
24
-              .avatar
25
-                %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
26
-              %h1 John Savage
27
-              %h2 web & ui designer
28
-
19
+        %ul.active-group.border.no-left-border.left-border
20
+          %li.clear.user
21
+            .avatar
22
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
23
+            %h1
24
+              Adam Wolsky
25
+              %span.status.online
26
+            %h2 co-founder
27
+            %span.action{ style: "float: right; margin-top: -31px; width: 62px; color: #7e8b90"}
28
+              %span.icon-x-full{ style: "width: 21px; overflow: hidden; display: block; float: right;padding-right: 10px; padding-top: 1px;"}
29
+                %span{style: "font-variant: small-caps; font-weight: bold; position: relative; top: -3px; left: 2px; font-size: 0.9em;"} kick
30
+          %li.clear.user
31
+            .avatar
32
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
33
+            %h1
34
+              John Savage
35
+              %span.status.away
36
+            %h2 web & ui designer
37
+            %span.action{ style: "float: right; margin-top: -31px; width: 62px; color: #7e8b90"}
38
+              %span.icon-x-full{ style: "width: 21px; overflow: hidden; display: block; float: right;padding-right: 10px; padding-top: 1px;"}
39
+                %span{style: "font-variant: small-caps; font-weight: bold; position: relative; top: -3px; left: 2px; font-size: 0.9em;"} kick
40
+              %span.icon-bubbles{ style: "width: 21px; overflow: hidden; display: block; float: right;padding-right: 10px; padding-top: 1px;"}
41
+                %span{style: "font-variant: small-caps; font-weight: bold; position: relative; top: -3px; font-size: 0.9em;"} invite
29 42
         %h1.group-header Friends
30 43
         %ul
31
-          %li.clear
32
-            .user
33
-              .avatar
34
-                %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
35
-              %h1 Ashley Bond
36
-              %h2 sexretary
37
-          %li.clear
38
-            .user
39
-              .avatar
40
-                %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
41
-              %h1 Bob Awesome
42
-              %h2 sales manager
44
+          %li.clear.user{ style: "padding-right: 0"}
45
+            .avatar
46
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
47
+            %h1
48
+              Ashley Bond
49
+              %span.status.offline
50
+            %h2 sexretary
51
+            %span.action{ style: "float: right; margin-top: -31px; width: 62px; color: #7e8b90"}
52
+              -#%span.icon-bubble{ style: "width: 21px; overflow: hidden; display: block; float: right;padding-right: 10px; padding-top: 1px;"}
53
+              -#  %span{style: "font-variant: small-caps; font-weight: bold; position: relative; top: -3px; font-size: 0.9em;"} chat
54
+              %span.icon-bubbles{ style: "width: 21px; overflow: hidden; display: block; float: right;padding-right: 13px; padding-top: 1px;"}
55
+                %span{style: "font-variant: small-caps; font-weight: bold; position: relative; top: -3px; font-size: 0.9em;"} invite
56
+          %li.clear.user
57
+            .avatar
58
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
59
+            %h1
60
+              Bob Awesome
61
+              %span.status.dnd
62
+            %h2 sales manager
63
+            %span.action{ style: "float: right; margin-top: -31px; width: 62px; color: #7e8b90"}
64
+              %span.icon-x-full{ style: "width: 21px; overflow: hidden; display: block; float: right;padding-right: 10px; padding-top: 1px;"}
65
+                %span{style: "font-variant: small-caps; font-weight: bold; position: relative; top: -3px; left: 2px; font-size: 0.9em;"} kick
66
+          %li.clear.user
67
+            .avatar
68
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
69
+            %h1
70
+              Bob Awesome
71
+              %span.status.dnd
72
+            %h2 sales manager
73
+            %span.action{ style: "float: right; margin-top: -31px; width: 62px; color: #7e8b90"}
74
+              %span.icon-bubble{ style: "width: 21px; overflow: hidden; display: block; float: right;padding-right: 10px; padding-top: 1px;"}
75
+                %span{style: "font-variant: small-caps; font-weight: bold; position: relative; top: -3px; left: 2px; font-size: 0.9em;"} chat
43 76
 
44 77
       .toolbox
45
-        %input{type: "text", placeholder: "Search contact"}
46
-  .chatting-window
47
-    Chatting
48 78
\ No newline at end of file
79
+        %input{type: "search", placeholder: "Search contact"}
80
+        %a{ href: "#"}
81
+          %span.icon-cog
82
+  .chatting-window.left.rightside
83
+    .tabbar
84
+      %a{ href: "#", class: "tab active top-border"}
85
+        Adam and John
86
+        %span.right.icon.icon-x
87
+      %a{ href: "#", class: "tab"}
88
+        &nbsp;
89
+        %span.right.icon.icon-x
90
+      %a{ href: "#", class: "tab"}
91
+        &nbsp;
92
+        %span.right.icon.icon-x
93
+    .conversation.clear.border
94
+      .messages
95
+        %a{ href: "#", class: "event" }
96
+          Load older messages
97
+          %span.icon-arrow-up
98
+        .message-box
99
+          .user
100
+            .avatar
101
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
102
+            -#todo: user name missing in design
103
+          .date 3 hours ago
104
+          %p Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Supendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies. Curabitur et ligula...
105
+        .message-box
106
+          .user
107
+            .avatar
108
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
109
+            -#todo: user name missing in design
110
+          .date 3 hours ago
111
+          %p Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Supendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies. Curabitur et ligula...
112
+          -#%hr
113
+          %p Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Supendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies. Curabitur et ligula...
114
+
115
+        .event
116
+          Monday 13.2.2013
117
+
118
+        .message-box.active
119
+          .user
120
+            .avatar
121
+              %img{src: 'assets/avatar.png', alt: t("chat.avatar_alt")}
122
+            -#todo: user name missing in design
123
+          .date 3 hours ago
124
+          %p Etiam ullamcorper. Supendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies. Lorem ipsum dolor sit amet enim.
125
+
126
+        .event
127
+          Adam left the room | 13:45
128
+
129
+      .message-writer
130
+        %input{ type: "text", placeholder: "Type your message here" }
131
+        %input{ type: "submit", value: "Send" }
... ...
@@ -2,6 +2,7 @@ require "spec_helper"
2 2
 
3 3
 describe "Chatting behaviour" do
4 4
 
5
+    #todo change subject in testing roster and chatting window
5 6
 	subject { page }
6 7
 
7 8
 	describe "should show account info" do
... ...
@@ -19,5 +20,31 @@ describe "Chatting behaviour" do
19 19
 
20 20
 		it { should have_selector('h1', 'John Savage') }
21 21
 		it { should have_selector('h1', 'Adam Wolsky') }
22
-	end
22
+    end
23
+
24
+    describe "should show tabbar" do
25
+        before { visit chat_path }
26
+
27
+        it { should have_selector(class: 'tabbar') }
28
+        it { should have_selector('h1', text: 'Adam and John', class: 'tab') }
29
+    end
30
+
31
+    describe "should a conversation" do
32
+        before { visit chat_path }
33
+
34
+        describe "show some messages" do
35
+            it { should have_selector('img') }
36
+            it { should have_selector(class: 'date') }
37
+            #todo should have a message text
38
+        end
39
+
40
+        describe "should show event dates" do
41
+            it { should have_selector(text: 'Monday 13.2.2013') }
42
+        end
43
+
44
+        describe "should allow write a new message" do
45
+            it { should have_selector('input', placeholder: 'Type your message here') }
46
+            it { should have_button('Send') }
47
+        end
48
+    end
23 49
 end
24 50
\ No newline at end of file