Przeglądaj źródła

Merge branch 'master' of github.com:tracim/tracim

Bastien Sevajol (Algoo) 7 lat temu
rodzic
commit
feb4838e67

+ 90 - 0
tracim/tracim/public/assets/css/dashboard.css Wyświetl plik

@@ -517,3 +517,93 @@ table th {
517 517
 div.mce-fullscreen {
518 518
   z-index: 1030;
519 519
 }
520
+
521
+#unread-content-panel, /*#recent-activity-panel,*/ #workspaces-panel {
522
+  display: none;
523
+}
524
+.panel-success > .panel-heading, .panel { /* bootstrap override */
525
+  border-top-left-radius: 0px;
526
+}
527
+.panel { /* bootstrap override */
528
+  border-width: 2px;
529
+  border-top-width: 10px;
530
+}
531
+.content__home__tab-wrapper {
532
+  margin: 15px 0 0 0;
533
+}
534
+.content__home__tab__item {
535
+  display: inline-block;
536
+  padding: 3px 25px;
537
+  border: 1px solid #333;
538
+  border-bottom-width: 0px;
539
+  border-top-left-radius: 5px;
540
+  border-top-right-radius: 5px;
541
+  text-align: center;
542
+  font-weight: bold;
543
+  vertical-align: bottom;
544
+  cursor: pointer;
545
+}
546
+.content__home__tab__item > i {
547
+  margin-right: 4px;
548
+}
549
+.content__home__tab__item-news {
550
+  float: right;
551
+  position: relative;
552
+  top: -18px;
553
+  right: -28px;
554
+  height: auto;
555
+  color: #b35454;
556
+  font-size: 22px;
557
+}
558
+.content__home__tab__item-news__number {
559
+  top: -3px;
560
+  color: #dff0d8;
561
+  font-size: 10px;
562
+  font-weight: bold;
563
+  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
564
+  letter-spacing: -1px;
565
+}
566
+.content__home__tab__item-lastactivity {
567
+  font-size: 12px;
568
+  font-weight: normal;
569
+  color: #b35454;
570
+}
571
+.content__home__tab__item:hover {
572
+  background-color: #eee;
573
+}
574
+.content__home__tab__item.active {
575
+  padding: 5px 25px;
576
+}
577
+.content__home__tab__item.unread {
578
+  border-color: #d6e9c6;
579
+  background-color: #dff0d8;
580
+  color: #3c763d;
581
+}
582
+.content__home__tab__item.unread:hover,
583
+.content__home__tab__item.unread.active {
584
+  border-color: #dff0d8;
585
+  background-color: #d6e9c6;
586
+  color: #3c763d;
587
+}
588
+.content__home__tab__item.recent_activity {
589
+  border-color: #faebcc;
590
+  background-color: #fcf8e3;
591
+  color: #8a6d3b;
592
+}
593
+.content__home__tab__item.recent_activity:hover,
594
+.content__home__tab__item.recent_activity.active {
595
+  border-color: #fcf8e3;
596
+  background-color: #faebcc;
597
+  color: #8a6d3b;
598
+}
599
+.content__home__tab__item.workspace {
600
+  border-color: #bce8f1;
601
+  background-color: #d9edf7;
602
+  color: #31708f;
603
+}
604
+.content__home__tab__item.workspace:hover,
605
+.content__home__tab__item.workspace.active {
606
+  border-color: #d9edf7;
607
+  background-color: #bce8f1;
608
+  color: #31708f;
609
+}

+ 19 - 0
tracim/tracim/public/assets/js/main.js Wyświetl plik

@@ -1,5 +1,6 @@
1 1
 $(document).ready(function () {
2 2
 
3
+  // toggle sidebar-left width to fixed or auto
3 4
   $('#toggle-left-sidebar-width').click( function() {
4 5
     sidebar = $('#sidebar-left')
5 6
     buttonIcon = $('> i', this)
@@ -13,6 +14,24 @@ $(document).ready(function () {
13 14
     }
14 15
   })
15 16
 
17
+  var homeTabList = ['#unread-content-panel', '#recent-activity-panel', '#workspaces-panel']
18
+  // toggle the active tab in home page
19
+  $('.content__home__tab__item.unread, .content__home__tab__item.recent_activity, .content__home__tab__item.workspace').click(function () {
20
+    $('.content__home__tab__item.unread, .content__home__tab__item.recent_activity, .content__home__tab__item.workspace').removeClass('active')
21
+    homeTabList.forEach(function (item) { $(item).css('display', 'none') })
22
+  })
23
+  $('.content__home__tab__item.unread').click(function () {
24
+    $(this).addClass('active')
25
+    $('#unread-content-panel').css('display', 'block') })
26
+  $('.content__home__tab__item.recent_activity').click(function () {
27
+    $(this).addClass('active')
28
+    $('#recent-activity-panel').css('display', 'block')
29
+  })
30
+  $('.content__home__tab__item.workspace').click(function () {
31
+    $(this).addClass('active')
32
+    $('#workspaces-panel').css('display', 'block')
33
+  })
34
+
16 35
   // Côme - 2017-01-06 - is the code bellow usefull ?
17 36
   // $('#current-page-breadcrumb-toggle-button').click( function() {
18 37
   //   $('#current-page-breadcrumb').toggle();

+ 92 - 80
tracim/tracim/templates/home.mak Wyświetl plik

@@ -32,96 +32,108 @@
32 32
 </%def>
33 33
 
34 34
 <div class="content__home">
35
-    ## NOT READ
36
-    <div class="t-spacer-above" id="unread-content-panel">
37
-        <div class="t-half-spacer-above">
38
-            <div class="panel panel-success">
39
-                <div class="panel-heading">
40
-                    <h3 class="panel-title"><i class="fa fa-fw fa-eye-slash"></i> ${_('Not Read')}</h3>
41
-                </div>
42
-                <div class="panel-body">
43
-                    % if fake_api.last_unread.nb <= 0:
44
-                        ${P.EMPTY_CONTENT(_('No new content.'))}
45
-                    % else:
46
-                        <table class="table table-hover">
47
-                            % for item in fake_api.last_unread.contents:
48
-                                <tr>
49
-                                    <td>
50
-                                        <i class="${item.type.icon} fa-fw ${item.type.color}"></i>
51
-                                        <a href="${item.url}">${item.label}</a>
52
-                                        <br/>
53
-                                        <span class="t-less-visible">${item.workspace.label}</span>
54
-                                    </td>
55
-                                    <td title="${_('Last activity: {datetime}').format(datetime=item.last_activity.label)}">
56
-                                        ${item.last_activity.delta}
57
-                                    </td>
58
-                                </tr>
59
-                            % endfor
60
-                        </table>
61
-                    % endif
62
-                 </div>
63
-             </div>
35
+    <div class="content__home__tab-wrapper">
36
+        <div class="content__home__tab__item recent_activity active">
37
+            <i class="fa fa-fw fa-line-chart"></i>${_('Recent Activity')}
38
+            % if fake_api.last_actives.contents[0]:
39
+              <span class="content__home__tab__item-lastactivity">[${fake_api.last_actives.contents[0].last_activity.delta}]</span>
40
+            % endif
41
+        </div>
42
+        <div class="content__home__tab__item unread">
43
+            <i class="fa fa-fw fa-eye-slash"></i>${_('Not Read')}
44
+            % if fake_api.last_unread.nb > 0:
45
+              <div class="content__home__tab__item-news fa-stack">
46
+                <i class="fa fa-bookmark fa-stack-1x"></i>
47
+                <i class="content__home__tab__item-news__number fa-stack-1x">
48
+                  % if fake_api.last_unread.nb == 10:
49
+                    ${fake_api.last_unread.nb}+
50
+                  % else:
51
+                    ${fake_api.last_unread.nb}
52
+                  % endif
53
+                </i>
54
+              </div>
55
+            % endif
56
+        </div>
57
+        <div class="content__home__tab__item workspace">
58
+            <i class="fa fa-bank"></i>${_('My workspaces')}
64 59
         </div>
65 60
     </div>
66 61
 
67 62
     ## RECENT ACTIVITY
68
-    <div class="t-spacer-above" id="recent-activity-panel">
69
-        <div class="t-half-spacer-above">
70
-            <div class="panel panel-warning">
71
-                <div class="panel-heading">
72
-                    <h3 class="panel-title"><i class="fa fa-fw fa-line-chart"></i> ${_('Recent Activity')}</h3>
73
-                </div>
74
-                <div class="panel-body">
75
-                    % if fake_api.last_actives.nb <= 0:
76
-                        ${P.EMPTY_CONTENT(_('There\'s no activity yet.'))}
77
-                    % else:
78
-                        <table class="table table-hover">
79
-                            % for item in fake_api.last_actives.contents:
80
-                                <tr>
81
-                                    <td>
82
-                                        <i class="${item.type.icon} fa-fw ${item.type.color}"></i>
83
-                                        <a href="${item.url}">${item.label}</a>
84
-                                        <br/>
85
-                                        <span class="t-less-visible">${item.workspace.label}</span>
86
-                                    </td>
87
-                                    <td title="${_('Last activity: {datetime}').format(datetime=item.last_activity.label)}">
88
-                                        ${item.last_activity.delta}
89
-                                    </td>
90
-                                </tr>
91
-                            % endfor
92
-                        </table>
93
-                    % endif
94
-                </div>
63
+    <div class="" id="recent-activity-panel">
64
+        <div class="panel panel-warning">
65
+            <div class="panel-body">
66
+                % if fake_api.last_actives.nb <= 0:
67
+                    ${P.EMPTY_CONTENT(_('There\'s no activity yet.'))}
68
+                % else:
69
+                    <table class="table table-hover">
70
+                        % for item in fake_api.last_actives.contents:
71
+                            <tr>
72
+                                <td>
73
+                                    <i class="${item.type.icon} fa-fw ${item.type.color}"></i>
74
+                                    <a href="${item.url}">${item.label}</a>
75
+                                    <br/>
76
+                                    <span class="t-less-visible">${item.workspace.label}</span>
77
+                                </td>
78
+                                <td title="${_('Last activity: {datetime}').format(datetime=item.last_activity.label)}">
79
+                                    ${item.last_activity.delta}
80
+                                </td>
81
+                            </tr>
82
+                        % endfor
83
+                    </table>
84
+                % endif
95 85
             </div>
96 86
         </div>
97 87
     </div>
98 88
 
89
+    ## NOT READ
90
+    <div class="" id="unread-content-panel">
91
+        <div class="panel panel-success">
92
+            <div class="panel-body">
93
+                % if fake_api.last_unread.nb <= 0:
94
+                    ${P.EMPTY_CONTENT(_('No new content.'))}
95
+                % else:
96
+                    <table class="table table-hover">
97
+                        % for item in fake_api.last_unread.contents:
98
+                            <tr>
99
+                                <td>
100
+                                    <i class="${item.type.icon} fa-fw ${item.type.color}"></i>
101
+                                    <a href="${item.url}">${item.label}</a>
102
+                                    <br/>
103
+                                    <span class="t-less-visible">${item.workspace.label}</span>
104
+                                </td>
105
+                                <td title="${_('Last activity: {datetime}').format(datetime=item.last_activity.label)}">
106
+                                    ${item.last_activity.delta}
107
+                                </td>
108
+                            </tr>
109
+                        % endfor
110
+                    </table>
111
+                % endif
112
+             </div>
113
+         </div>
114
+    </div>
115
+
99 116
     ## Workspace list and notifications
100
-    <div class="t-half-spacer-above" id="workspaces-panel">
101
-        <div class="t-spacer-above">
102
-            <div class="panel panel-info">
103
-                <div class="panel-heading">
104
-                    <h3 class="panel-title"><i class="fa fa-bank"></i> ${_('Workspaces')}</h3>
105
-                </div>
106
-                <div class="panel-body">
117
+    <div class="" id="workspaces-panel">
118
+        <div class="panel panel-info">
119
+            <div class="panel-body">
107 120
 
108
-                    % if len(fake_api.current_user.roles)<=0:
109
-                        ${P.EMPTY_CONTENT(_('I\'m not member of any workspace.'))}
110
-                    % else:
111
-                        <table class="table">
112
-                            <thead>
113
-                                <tr>
114
-                                    <th>${_('Workspace')}</th>
115
-                                    <th>${_('Role')}</th>
116
-                                    <th>${_('Email Notifications')}</th>
117
-                                </tr>
118
-                            </thead>
119
-                            % for role in fake_api.current_user.roles:
120
-                                ${TABLE_ROW.USER_ROLE_IN_WORKSPACE(fake_api.current_user, role, show_id=False, enable_link='/user/me/workspaces/{workspace}/enable_notifications?next_url=/home', disable_link='/user/me/workspaces/{workspace}/disable_notifications?next_url=/home')}
121
-                            % endfor
122
-                        </table>
123
-                    % endif
124
-                </div>
121
+                % if len(fake_api.current_user.roles)<=0:
122
+                    ${P.EMPTY_CONTENT(_('I\'m not member of any workspace.'))}
123
+                % else:
124
+                    <table class="table">
125
+                        <thead>
126
+                            <tr>
127
+                                <th>${_('Workspace')}</th>
128
+                                <th>${_('Role')}</th>
129
+                                <th>${_('Email Notifications')}</th>
130
+                            </tr>
131
+                        </thead>
132
+                        % for role in fake_api.current_user.roles:
133
+                            ${TABLE_ROW.USER_ROLE_IN_WORKSPACE(fake_api.current_user, role, show_id=False, enable_link='/user/me/workspaces/{workspace}/enable_notifications?next_url=/home', disable_link='/user/me/workspaces/{workspace}/disable_notifications?next_url=/home')}
134
+                        % endfor
135
+                    </table>
136
+                % endif
125 137
             </div>
126 138
         </div>
127 139
     </div>

+ 1 - 1
tracim/tracim/templates/master_authenticated.mak Wyświetl plik

@@ -12,9 +12,9 @@
12 12
         <meta name="author" content="">
13 13
         <link rel="icon" href="/favicon.ico">
14 14
         <link href="${tg.url('/assets/css/bootstrap.min.css')}" rel="stylesheet">
15
-        <link href="${tg.url('/assets/css/dashboard.css')}" rel="stylesheet">
16 15
         <link href="${tg.url('/assets/font-awesome-4.2.0/css/font-awesome.css')}" rel="stylesheet">
17 16
         <link href="${tg.url('/assets/select2-4.0.3/css/select2.min.css')}" rel="stylesheet">
17
+        <link href="${tg.url('/assets/css/dashboard.css')}" rel="stylesheet">
18 18
 
19 19
         <script>
20 20
             var shiftWindow = function() { scrollBy(0, -50) };