Browse Source

Merge pull request #15 from tracim/fix-sidebar

Skylsmoi 6 years ago
parent
commit
251d0699f6
No account linked to committer's email

+ 8 - 8
frontend/src/component/Sidebar/WorkspaceListItem.jsx View File

7
 
7
 
8
 const WorkspaceListItem = props => {
8
 const WorkspaceListItem = props => {
9
   return (
9
   return (
10
-    <li className='sidebar__navigation__workspace__item'>
10
+    <li className='sidebar__content__navigation__workspace__item'>
11
       <div
11
       <div
12
-        className='sidebar__navigation__workspace__item__wrapper primaryColorBg primaryColorBgDarkenHover primaryColorBorder'
12
+        className='sidebar__content__navigation__workspace__item__wrapper primaryColorBg primaryColorBgDarkenHover primaryColorBorder'
13
         onClick={props.onClickTitle}
13
         onClick={props.onClickTitle}
14
       >
14
       >
15
-        <div className='sidebar__navigation__workspace__item__number'>
15
+        <div className='sidebar__content__navigation__workspace__item__number'>
16
           {props.label.substring(0, 2).toUpperCase()}
16
           {props.label.substring(0, 2).toUpperCase()}
17
         </div>
17
         </div>
18
 
18
 
19
-        <div className='sidebar__navigation__workspace__item__name' title={props.label}>
19
+        <div className='sidebar__content__navigation__workspace__item__name' title={props.label}>
20
           {props.label}
20
           {props.label}
21
         </div>
21
         </div>
22
 
22
 
23
-        <div className='sidebar__navigation__workspace__item__icon'>
23
+        <div className='sidebar__content__navigation__workspace__item__icon'>
24
           <i className={classnames(props.isOpenInSidebar ? 'fa fa-chevron-up' : 'fa fa-chevron-down')} />
24
           <i className={classnames(props.isOpenInSidebar ? 'fa fa-chevron-up' : 'fa fa-chevron-down')} />
25
         </div>
25
         </div>
26
       </div>
26
       </div>
27
 
27
 
28
       <AnimateHeight duration={500} height={props.isOpenInSidebar ? 'auto' : 0}>
28
       <AnimateHeight duration={500} height={props.isOpenInSidebar ? 'auto' : 0}>
29
         <ul
29
         <ul
30
-          className='sidebar__navigation__workspace__item__submenu'
30
+          className='sidebar__content__navigation__workspace__item__submenu'
31
           id={`sidebarSubMenu_${props.number}`}
31
           id={`sidebarSubMenu_${props.number}`}
32
         >
32
         >
33
           { props.allowedApp.map(aa =>
33
           { props.allowedApp.map(aa =>
37
             >
37
             >
38
               <Link to={aa.route}>
38
               <Link to={aa.route}>
39
                 <div className={classnames(
39
                 <div className={classnames(
40
-                  'sidebar__navigation__workspace__item__submenu__dropdown primaryColorBgLighten primaryColorBgHover primaryColorBorderDarken',
40
+                  'sidebar__content__navigation__workspace__item__submenu__dropdown primaryColorBgLighten primaryColorBgHover primaryColorBorderDarken',
41
                   {'activeFilter': props.activeFilterList.includes(aa.slug)}
41
                   {'activeFilter': props.activeFilterList.includes(aa.slug)}
42
                 )}>
42
                 )}>
43
                   <div className='dropdown__icon'>
43
                   <div className='dropdown__icon'>
44
                     <i className={classnames(`fa fa-${aa.faIcon}`)} style={{backgroudColor: aa.hexcolor}} />
44
                     <i className={classnames(`fa fa-${aa.faIcon}`)} style={{backgroudColor: aa.hexcolor}} />
45
                   </div>
45
                   </div>
46
 
46
 
47
-                  <div className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown'>
47
+                  <div className='sidebar__content__navigation__workspace__item__submenu__dropdown__showdropdown'>
48
                     <div className='dropdown__title' id='navbarDropdown'>
48
                     <div className='dropdown__title' id='navbarDropdown'>
49
                       <div className='dropdown__title__text'>
49
                       <div className='dropdown__title__text'>
50
                         {aa.label/* [props.lang.id] */}
50
                         {aa.label/* [props.lang.id] */}

+ 37 - 39
frontend/src/container/Sidebar.jsx View File

106
 
106
 
107
     return (
107
     return (
108
       <div className={classnames('sidebar primaryColorBgDarken', {'sidebarclose': sidebarClose})}>
108
       <div className={classnames('sidebar primaryColorBgDarken', {'sidebarclose': sidebarClose})}>
109
-        <div className='sidebarSticky'>
110
-          <div className='sidebar__expand primaryColorBg' onClick={this.handleClickToggleSidebar}>
111
-            <i className={classnames('fa fa-chevron-left', {'fa-chevron-right': sidebarClose, 'fa-chevron-left': !sidebarClose})} />
112
-          </div>
113
 
109
 
114
-          <div className='sidebar__wrapper'>
115
-
116
-            <nav className='sidebar__navigation'>
117
-              <ul className='sidebar__navigation__workspace'>
118
-                { workspaceList.map(ws =>
119
-                  <WorkspaceListItem
120
-                    idWs={ws.id}
121
-                    label={ws.label}
122
-                    allowedApp={ws.sidebarEntry}
123
-                    lang={activeLang}
124
-                    activeFilterList={ws.id === workspaceIdInUrl ? [qs.parse(this.props.location.search).type] : []}
125
-                    isOpenInSidebar={ws.isOpenInSidebar}
126
-                    onClickTitle={() => this.handleClickWorkspace(ws.id, !ws.isOpenInSidebar)}
127
-                    onClickAllContent={this.handleClickAllContent}
128
-                    // onClickContentFilter={this.handleClickContentFilter}
129
-                    key={ws.id}
130
-                  />
131
-                )}
132
-              </ul>
133
-            </nav>
134
-
135
-            <div className='sidebar__btnnewworkspace'>
136
-              <button
137
-                className='sidebar__btnnewworkspace__btn btn btn-primary primaryColorBg primaryColorBorder primaryColorBorderDarkenHover mb-5'
138
-                onClick={this.handleClickNewWorkspace}
139
-              >
140
-                {t('Create a workspace')}
141
-              </button>
142
-            </div>
110
+        <div className='sidebar__expand primaryColorBg' onClick={this.handleClickToggleSidebar}>
111
+          <i className={classnames('fa fa-chevron-left', {'fa-chevron-right': sidebarClose, 'fa-chevron-left': !sidebarClose})} />
112
+        </div>
143
 
113
 
114
+        <div className='sidebar__content'>
115
+          <nav className={classnames('sidebar__content__navigation', {'sidebarclose': sidebarClose})}>
116
+            <ul className='sidebar__content__navigation__workspace'>
117
+              { workspaceList.map(ws =>
118
+                <WorkspaceListItem
119
+                  idWs={ws.id}
120
+                  label={ws.label}
121
+                  allowedApp={ws.sidebarEntry}
122
+                  lang={activeLang}
123
+                  activeFilterList={ws.id === workspaceIdInUrl ? [qs.parse(this.props.location.search).type] : []}
124
+                  isOpenInSidebar={ws.isOpenInSidebar}
125
+                  onClickTitle={() => this.handleClickWorkspace(ws.id, !ws.isOpenInSidebar)}
126
+                  onClickAllContent={this.handleClickAllContent}
127
+                  // onClickContentFilter={this.handleClickContentFilter}
128
+                  key={ws.id}
129
+                />
130
+              )}
131
+            </ul>
132
+          </nav>
133
+
134
+          <div className='sidebar__content__btnnewworkspace'>
135
+            <button
136
+              className='sidebar__content__btnnewworkspace__btn btn btn-primary primaryColorBg primaryColorBorder primaryColorBorderDarkenHover mb-5'
137
+              onClick={this.handleClickNewWorkspace}
138
+            >
139
+              {t('Create a workspace')}
140
+            </button>
144
           </div>
141
           </div>
145
 
142
 
146
-          <div className='sidebar__footer mb-2'>
147
-            <div className='sidebar__footer__text whiteFontColor d-flex align-items-end justify-content-center'>
148
-              Copyright - 2013 - 2018
149
-              <div className='sidebar__footer__text__link'>
150
-                <a href='http://www.tracim.fr/' target='_blank' className='ml-3'>tracim.fr</a>
151
-              </div>
143
+        </div>
144
+
145
+        <div className='sidebar__footer mb-2'>
146
+          <div className='sidebar__footer__text whiteFontColor d-flex align-items-end justify-content-center'>
147
+            Copyright - 2013 - 2018
148
+            <div className='sidebar__footer__text__link'>
149
+              <a href='http://www.tracim.fr/' target='_blank' className='ml-3'>tracim.fr</a>
152
             </div>
150
             </div>
153
           </div>
151
           </div>
154
         </div>
152
         </div>

+ 94 - 74
frontend/src/css/Sidebar.styl View File

1
-sidebar-width = 280px
1
+sidebar-width = 300px
2
 sidebar-animate-speed = 0.5s
2
 sidebar-animate-speed = 0.5s
3
 
3
 
4
 .sidebarSticky
4
 .sidebarSticky
15
   background-color rgba(253, 253, 253, 0.3)
15
   background-color rgba(253, 253, 253, 0.3)
16
 
16
 
17
 .sidebar
17
 .sidebar
18
+  display flex
19
+  flex-direction column
20
+  justify-content space-between
18
   position relative
21
   position relative
19
   transition all sidebar-animate-speed
22
   transition all sidebar-animate-speed
20
   width sidebar-width
23
   width sidebar-width
26
     width 0
29
     width 0
27
   &__expand
30
   &__expand
28
     position absolute
31
     position absolute
29
-    top 0
30
-    right -43px
32
+    right -42px
31
     display flex
33
     display flex
32
     justify-content center
34
     justify-content center
33
     align-items center
35
     align-items center
38
     cursor pointer
40
     cursor pointer
39
     color white
41
     color white
40
     transition all sidebar-animate-speed
42
     transition all sidebar-animate-speed
41
-  &__btnnewworkspace
42
-    margin 50px 0
43
-    overflow hidden
44
-    &__btn
45
-      display block
46
-      margin 0 auto
47
-      padding 15px 30px
48
-  &__navigation
49
-    padding 0
50
-    overflow hidden
51
-    &__workspace
52
-      padding-left 0
53
-      list-style none
54
-      &__item
55
-        &__wrapper
56
-          display flex
57
-          align-items center
58
-          border-bottom 1px solid
59
-          width 100%
60
-          height 100%
61
-          cursor pointer
62
-        &__number
63
-          display flex
64
-          leftside()
65
-          padding 12px
66
-          width 50px
67
-          letter-spacing 2px
68
-        &__name
69
-          padding 10px
70
-          font-size 20px
71
-          color off-white
72
-          white-space nowrap
73
-          overflow hidden
74
-          text-overflow ellipsis
75
-        &__icon
76
-          margin 0 10px 0 auto
77
-          color white
78
-        &__submenu
79
-          margin 0
80
-          padding 0
81
-          width 100%
82
-          overflow hidden
83
-          & > li
84
-            display block
85
-          &__dropdown
43
+  &__content
44
+    height 100%
45
+    &__btnnewworkspace
46
+      margin 50px 0
47
+      overflow hidden
48
+      &__btn
49
+        display block
50
+        margin 0 auto
51
+        padding 15px 30px
52
+    &__navigation
53
+      padding 0
54
+      width sidebar-width
55
+      transition all sidebar-animate-speed
56
+      overflow hidden
57
+      &.sidebarclose
58
+        width 0
59
+      &__workspace
60
+        padding-left 0
61
+        list-style none
62
+        &__item
63
+          &__wrapper
86
             display flex
64
             display flex
87
             align-items center
65
             align-items center
88
             border-bottom 1px solid
66
             border-bottom 1px solid
67
+            width 100%
68
+            height 100%
89
             cursor pointer
69
             cursor pointer
90
-            &__showdropdown
70
+          &__number
71
+            display flex
72
+            leftside()
73
+            padding 12px
74
+            width 50px
75
+            letter-spacing 2px
76
+          &__name
77
+            padding 10px
78
+            width 224px
79
+            font-size 20px
80
+            color off-white
81
+            white-space nowrap
82
+            overflow hidden
83
+            text-overflow ellipsis
84
+          &__icon
85
+            display flex
86
+            align-items center
87
+            width 26px
88
+            height 50px
89
+            color white
90
+          &__submenu
91
+            margin 0
92
+            padding 0
93
+            width 100%
94
+            overflow hidden
95
+            & > li
96
+              display block
97
+            &__dropdown
91
               display flex
98
               display flex
92
-              justify-content space-between
93
               align-items center
99
               align-items center
94
-              padding 0 10px
95
-              width 100%
96
-            .dropdown__icon
97
-              padding 10px 15px
98
-              min-width 50px
99
-              leftside()
100
-            .dropdown__title
101
-              white-space nowrap
102
-              overflow hidden
103
-              text-overflow ellipsis
104
-              // color off-white
105
-            &.activeFilter
100
+              border-bottom 1px solid
101
+              cursor pointer
102
+              &__showdropdown
103
+                display flex
104
+                justify-content space-between
105
+                align-items center
106
+                padding 0 10px
107
+                width 100%
106
               .dropdown__icon
108
               .dropdown__icon
107
-                background-color rgba(253, 253, 253, 0.8)
109
+                padding 10px 15px
110
+                min-width 50px
111
+                leftside()
112
+              .dropdown__title
113
+                white-space nowrap
114
+                overflow hidden
115
+                text-overflow ellipsis
116
+                // color off-white
117
+              &.activeFilter
118
+                .dropdown__icon
119
+                  background-color rgba(253, 253, 253, 0.8)
108
   &__footer
120
   &__footer
109
     &__text
121
     &__text
110
       color off-white
122
       color off-white
117
             text-decoration underline
129
             text-decoration underline
118
             color fourthColor
130
             color fourthColor
119
 
131
 
132
+
133
+/***** MEDIAQUERIES ******/
134
+
120
 /***** MEDIA 992px and 1199px ******/
135
 /***** MEDIA 992px and 1199px ******/
121
 
136
 
122
 @media (min-width: min-lg) and (max-width: max-lg)
137
 @media (min-width: min-lg) and (max-width: max-lg)
123
 
138
 
139
+  .sidebarpagecontainer
140
+    position relative
141
+
124
   .sidebar
142
   .sidebar
125
-    position fixed
143
+    position absolute
126
 
144
 
127
-/***** MEDIA 576px and 991px ******/
145
+/*** MEDIA 768px and 991px ****/
128
 
146
 
129
-@media (min-width: min-sm) and (max-width: max-md)
147
+@media (min-width: min-md) and (max-width: max-md)
130
 
148
 
131
-  .sidebarSticky
132
-    top 69px
149
+  .sidebarpagecontainer
150
+    position relative
133
 
151
 
134
   .sidebar
152
   .sidebar
135
-    position fixed
153
+    position absolute
136
 
154
 
137
 /***** MEDIA 576px and 767px *****/
155
 /***** MEDIA 576px and 767px *****/
138
 
156
 
139
 @media (min-width: min-sm) and (max-width: max-sm)
157
 @media (min-width: min-sm) and (max-width: max-sm)
140
 
158
 
141
   .sidebarpagecontainer
159
   .sidebarpagecontainer
160
+    position relative
142
     padding-top 69px
161
     padding-top 69px
143
 
162
 
144
-/***** MEDIA  *****/
163
+  .sidebar
164
+    position absolute
165
+
166
+/***** MEDIA 575px *****/
145
 
167
 
146
 @media (max-width: 575px)
168
 @media (max-width: 575px)
147
 
169
 
148
   .sidebarpagecontainer
170
   .sidebarpagecontainer
171
+    position relative
149
     padding-top 69px
172
     padding-top 69px
150
 
173
 
151
-  .sidebarSticky
152
-    top 69px
153
-
154
   .sidebar
174
   .sidebar
155
-    position fixed
175
+    position absolute