Pārlūkot izejas kodu

added flags; artile category page

tags/v1.0
Robin Thoni 7 gadus atpakaļ
vecāks
revīzija
f99f6b74f7

+ 15
- 10
backend/WebSem/.idea/.idea.WebSem/.idea/workspace.xml Parādīt failu

@@ -2,12 +2,17 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="8d054e21-e284-419c-acba-f672639639a4" name="Default" comment="">
5
-      <change type="DELETED" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/controllers/directives/.gitkeep" afterPath="" />
6
-      <change type="DELETED" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/views/directives/.gitkeep" afterPath="" />
7
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/WebApiWebSem/appsettings.Development.json" afterPath="$PROJECT_DIR$/WebApiWebSem/appsettings.Development.json" />
8
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/controllers/home.controller.js" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/controllers/home.controller.js" />
5
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/img/blank.gif" />
6
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/img/flags.png" />
7
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/less/flags.css" />
8
+      <change type="DELETED" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/img/.gitkeep" afterPath="" />
9
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/.idea.WebSem/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/.idea.WebSem/.idea/workspace.xml" />
10
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/controllers/articleCategory.controller.js" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/controllers/articleCategory.controller.js" />
9 11
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/index.html" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/index.html" />
12
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/less/app.less" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/less/app.less" />
13
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/views/articlesCategory.html" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/views/articlesCategory.html" />
10 14
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/views/home.html" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/views/home.html" />
15
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/views/toolbar.html" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/views/toolbar.html" />
11 16
     </list>
12 17
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
13 18
     <option name="TRACKING_ENABLED" value="true" />
@@ -43,8 +48,8 @@
43 48
       <file leaf-file-name="ArticlesDataAccess.cs" pinned="false" current-in-tab="true">
44 49
         <entry file="file://$PROJECT_DIR$/WebApiWebSem/DataAccess/ArticlesDataAccess.cs">
45 50
           <provider selected="true" editor-type-id="text-editor">
46
-            <state relative-caret-position="210">
47
-              <caret line="17" column="91" lean-forward="true" selection-start-line="17" selection-start-column="91" selection-end-line="17" selection-end-column="91" />
51
+            <state relative-caret-position="534">
52
+              <caret line="35" column="0" lean-forward="true" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
48 53
               <folding>
49 54
                 <marker date="1487804389248" expanded="true" signature="6:307" ph="..." />
50 55
                 <marker date="1487804389248" expanded="true" signature="342:4029" ph="{...}" />
@@ -279,12 +284,12 @@
279 284
       <workItem from="1487345029610" duration="5634000" />
280 285
       <workItem from="1487441650798" duration="14018000" />
281 286
       <workItem from="1487528667649" duration="13931000" />
282
-      <workItem from="1487802391451" duration="4043000" />
287
+      <workItem from="1487802391451" duration="5525000" />
283 288
     </task>
284 289
     <servers />
285 290
   </component>
286 291
   <component name="TimeTrackingManager">
287
-    <option name="totallyTimeSpent" value="44840000" />
292
+    <option name="totallyTimeSpent" value="46322000" />
288 293
   </component>
289 294
   <component name="TodoView">
290 295
     <todo-panel id="selected-file">
@@ -710,8 +715,8 @@
710 715
     </entry>
711 716
     <entry file="file://$PROJECT_DIR$/WebApiWebSem/DataAccess/ArticlesDataAccess.cs">
712 717
       <provider selected="true" editor-type-id="text-editor">
713
-        <state relative-caret-position="210">
714
-          <caret line="17" column="91" lean-forward="true" selection-start-line="17" selection-start-column="91" selection-end-line="17" selection-end-column="91" />
718
+        <state relative-caret-position="534">
719
+          <caret line="35" column="0" lean-forward="true" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
715 720
           <folding>
716 721
             <marker date="1487804389248" expanded="true" signature="6:307" ph="..." />
717 722
             <marker date="1487804389248" expanded="true" signature="342:4029" ph="{...}" />

+ 24
- 33
frontend/WebSem/app/controllers/articleCategory.controller.js Parādīt failu

@@ -1,36 +1,27 @@
1 1
 angular.module('app')
2
-    .controller('articleCategoryController', ['$scope', '$stateParams', 'articlesBusiness', 'listControllerBuilder',
3
-        function($scope, $stateParams, articlesBusiness, listControllerBuilder) {
2
+    .controller('articleCategoryController', ['$scope', '$stateParams', 'articlesBusiness', 'AppUtilsBusiness', 'luBusyBusiness',
3
+        function($scope, $stateParams, articlesBusiness, AppUtilsBusiness, luBusyBusiness) {
4 4
 
5
-            $scope.business = articlesBusiness;
6
-            $scope.itemType = 'articles';
7
-            // $scope.defaultOrder = 'id';
8
-            // listControllerBuilder.create($scope, $stateParams);
9
-            //
10
-            // $scope.getAddItem = function()
11
-            // {
12
-            //     return {
13
-            //         title: $scope.query.filter
14
-            //     };
15
-            // };
16
-            //
17
-            // $scope.getFilter = function (filter) {
18
-            //     var label = $scope.appUtils.tr('articles.type').toLowerCase();
19
-            //     return filter.replace(new RegExp(label + ': *([a-zA-Z0-9]*)'), function(match, p1)
20
-            //     {
21
-            //         var type = null;
22
-            //         for (var t in $scope.appUtils.articleTypes)
23
-            //         {
24
-            //             var str = $scope.appUtils.articleTypes[t];
25
-            //             if ($scope.appUtils.tr('articles.types.' + str).toLowerCase() == p1.toLowerCase())
26
-            //             {
27
-            //                 type = str;
28
-            //                 break;
29
-            //             }
30
-            //         }
31
-            //         return type == null ? '' : 'type:' + type;
32
-            //     });
33
-            // };
34
-            //
35
-            // $scope.init();
5
+            luBusyBusiness.reset();
6
+            $scope.items = null;
7
+            $scope.appUtils = AppUtilsBusiness;
8
+            $scope.itemType = $stateParams.type;
9
+
10
+            $scope.query = {
11
+                order: 'id',
12
+                filter: '',
13
+                limit: 10,
14
+                page: 1
15
+            };
16
+
17
+            $scope.load = function()
18
+            {
19
+                articlesBusiness.getMultiple($scope.query.order, 'type: ' + $scope.itemType + ' ' + $scope.query.filter,
20
+                    $scope.query.page - 1, $scope.query.limit, 'articleCategory.articleCategory').then(function(data)
21
+                {
22
+                    $scope.items = data;
23
+                }, function (error) {});
24
+            };
25
+
26
+            $scope.load();
36 27
     }]);

+ 0
- 0
frontend/WebSem/app/img/.gitkeep Parādīt failu


Binārs
frontend/WebSem/app/img/blank.gif Parādīt failu


Binārs
frontend/WebSem/app/img/flags.png Parādīt failu


+ 1
- 0
frontend/WebSem/app/index.html Parādīt failu

@@ -16,6 +16,7 @@
16 16
 
17 17
     <!-- build:less css/styles.css -->
18 18
     <link rel="stylesheet/less" href="less/app.less">
19
+    <link rel="stylesheet" href="less/flags.css">
19 20
     <!-- endbuild -->
20 21
 
21 22
     <!-- build:remove -->

+ 1
- 1
frontend/WebSem/app/less/app.less Parādīt failu

@@ -164,7 +164,7 @@ md-table-container tbody tr {
164 164
   .justify-text();
165 165
 }
166 166
 
167
-.home-grid {
167
+.image-grid {
168 168
   .red {
169 169
     background: #ff8a80;
170 170
   }

+ 19
- 0
frontend/WebSem/app/less/flags.css Parādīt failu

@@ -0,0 +1,19 @@
1
+/*!
2
+ * Generated with CSS Flag Sprite generator (https://www.flag-sprites.com/)
3
+ */
4
+
5
+.flag {
6
+    display: inline-block;
7
+    width: 16px;
8
+    height: 11px;
9
+    background: url('../img/flags.png') no-repeat;
10
+}
11
+
12
+
13
+.flag.flag-us {
14
+    background-position: -16px 0;
15
+}
16
+
17
+.flag.flag-fr {
18
+    background-position: 0 0;
19
+}

+ 14
- 104
frontend/WebSem/app/views/articlesCategory.html Parādīt failu

@@ -1,113 +1,23 @@
1
-<div layout="column" layout-fill layout-align="top" angular-busy="appUtils.cgBusy(itemType + '.table')">
1
+<div layout="column" layout-fill layout-align="top" angular-busy="appUtils.cgBusy('articleCategory.articleCategory')">
2 2
 
3
-    <div flex>
4
-        <md-toolbar class="md-table-toolbar md-default" ng-show="isModal || (!isFilterShown && selected.length == 0)">
5
-            <div class="md-toolbar-tools">
6
-                <span>{{ itemType + '.name' | translate }}</span>
7
-                <span flex></span>
8
-                <md-button ng-show="isModal && items != null" class="md-icon-button" ng-click="addItemDialog()" title="{{ 'common.new' | translate }}">
9
-                    <md-icon class="material-icons">add</md-icon>
10
-                </md-button>
11
-                <md-button ng-show="!isModal" class="md-icon-button" ui-sref="{{itemType}}_add" title="{{ 'common.new' | translate }}">
12
-                    <md-icon class="material-icons">add</md-icon>
13
-                </md-button>
14
-                <md-button ng-show="!isModal" class="md-icon-button" ng-click="showFilter(true)" title="{{ 'common.filter' | translate }}">
15
-                    <md-icon class="material-icons">search</md-icon>
16
-                </md-button>
17
-                <md-button ng-show="!isModal" class="md-icon-button" ng-click="getItems()" title="{{ 'common.refresh' | translate }}">
18
-                    <md-icon class="material-icons">refresh</md-icon>
19
-                </md-button>
20
-            </div>
21
-        </md-toolbar>
22
-        <md-toolbar class="md-table-toolbar md-default" ng-show="isModal || (isFilterShown && selected.length == 0)">
23
-            <div class="md-toolbar-tools">
24
-                <md-icon class="material-icons">search</md-icon>
25
-                <form autocomplete="off">
26
-                    <md-input-container class="md-block" flex-gt-sm>
27
-                        <label>{{ 'common.filter' | translate }}</label>
28
-                        <input type="text" ng-model="query.filter" ng-model-options="{debounce: 500}" ng-change="getItems()">
29
-                    </md-input-container>
30
-
31
-                </form>
32
-                <md-button ng-show="!isModal" class="md-icon-button" ng-click="showFilter(false)" title="{{ 'common.close' | translate }}">
33
-                    <md-icon class="material-icons">close</md-icon>
34
-                </md-button>
35
-                <md-button class="md-icon-button" ng-click="getItems()" title="{{ 'common.refresh' | translate }}">
36
-                    <md-icon class="material-icons">refresh</md-icon>
37
-                </md-button>
38
-            </div>
39
-        </md-toolbar>
40
-        <md-toolbar class="md-table-toolbar alternate" ng-show="selected.length > 0">
41
-            <div class="md-toolbar-tools">
42
-                <span>{{ itemType + '.selectedItems' | translate:{count:selected.length} }}</span>
43
-                <span flex></span>
44
-                <md-button class="md-icon-button" ng-click="askRemoveSelected()" title="{{ 'common.delete' | translate }}">
45
-                    <md-icon class="material-icons">delete</md-icon>
46
-                </md-button>
47
-            </div>
48
-        </md-toolbar>
3
+    <div layout="row">
4
+        <span flex="15"></span>
5
+        <md-grid-list class="image-grid" md-cols="4" md-row-height="200px" md-row-height-gt-sm="300px"
6
+                      md-row-height-gt-md="450px" md-gutter="4px" flex="60">
7
+            <md-grid-tile ng-repeat="item in items.data" class="red" md-colspan="{{$index < 2 ? 2 : 1}}" md-rowspan="1">
8
+                <a ui-sref="{{itemType}}">
9
+                    <img class="article-picture" ng-src="{{item.pictureUrl}}">
10
+                    <md-grid-tile-footer><h3>{{ item.title }}</h3></md-grid-tile-footer>
11
+                </a>
12
+            </md-grid-tile>
13
+        </md-grid-list>
49 14
     </div>
50 15
 
51
-    <div flex>
52
-        <md-table-container>
53
-            <table md-table md-row-select multiple ng-model="selected" >
54
-                <thead md-head md-order="query.order" md-on-reorder="getItems">
55
-                <tr md-row>
56
-                    <th md-column md-order-by="id"><span>{{ itemType + '.title' | translate }}</span></th>
57
-                    <th md-column md-order-by="type"><span>{{ itemType + '.type' | translate }}</span></th>
58
-                    <th md-column md-order-by="createdAt">{{ 'common.createdAt' | translate }}</th>
59
-                    <th md-column md-order-by="updatedAt">{{ 'common.updatedAt' | translate }}</th>
60
-                    <th class="col-icon-1" md-column>{{ 'common.actions' | translate }}</th>
61
-                </tr>
62
-                </thead>
63
-                <tbody md-body>
64
-                <tr md-row md-select="item" md-select-id="id" ng-repeat="item in items.data">
65
-                    <td md-cell>{{item.title}}</td>
66
-                    <td md-cell>{{ itemType + '.types.' + item.type | translate }}</td>
67
-                    <td md-cell>{{item.createdAt | formatDateTime}}</td>
68
-                    <td md-cell>{{item.updatedAt == null ? ('common.never' | translate ) : (item.updatedAt | formatDateTime)}}</td>
69
-                    <td class="col-icon-1" md-cell>
70
-                        <md-menu ng-show="!isModal">
71
-                            <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)">
72
-                                <md-icon class="material-icons">more_vert</md-icon>
73
-                            </md-button>
74
-                            <md-menu-content>
75
-                                <md-menu-item>
76
-                                    <md-button ui-sref="{{itemType}}_edit({id: item.id, item: item})">
77
-                                        <md-icon class="material-icons">mode_edit</md-icon>
78
-                                        {{ 'common.edit' | translate }}
79
-                                    </md-button>
80
-                                </md-menu-item>
81
-                                <md-menu-item>
82
-                                    <md-button ng-click="editItem(item)">
83
-                                        <md-icon class="material-icons">border_color</md-icon>
84
-                                        {{ 'common.editDialog' | translate }}
85
-                                    </md-button>
86
-                                </md-menu-item>
87
-                                <md-menu-divider></md-menu-divider>
88
-                                <md-menu-item>
89
-                                    <md-button ng-click="askRemoveOne(item)">
90
-                                        <md-icon class="material-icons">delete</md-icon>
91
-                                        {{ 'common.delete' | translate }}
92
-                                    </md-button>
93
-                                </md-menu-item>
94
-                            </md-menu-content>
95
-                        </md-menu>
96
-
97
-                        <md-button ng-show="isModal" class="md-icon-button" ng-click="selectItem(item)" title="{{ 'common.select' | translate }}">
98
-                            <md-icon class="material-icons">done</md-icon>
99
-                        </md-button>
100
-                    </td>
101
-                </tr>
102
-                </tbody>
103
-            </table>
104
-        </md-table-container>
105
-    </div>
106 16
 
107 17
     <md-table-pagination md-label="{{appUtils.mdTableLabels()}}" class="col-xs-11" md-limit="query.limit" md-limit-options="[5, 10, 20]"
108
-                         md-page="query.page" md-total="{{items.count}}" md-on-paginate="getItems" md-page-select></md-table-pagination>
18
+                         md-page="query.page" md-total="{{items.count}}" md-on-paginate="load" md-page-select></md-table-pagination>
109 19
 
110
-    <div ng-repeat="error in busy.errors(itemType + '.table')" class="isa_error">
20
+    <div ng-repeat="error in busy.errors('articleCategory.articleCategory')" class="isa_error">
111 21
         <i class="fa fa-times-circle"></i>
112 22
         {{ error.data.message }}
113 23
     </div>

+ 6
- 1
frontend/WebSem/app/views/home.html Parādīt failu

@@ -4,7 +4,7 @@
4 4
     </div>
5 5
     <div layout="row">
6 6
         <span flex="25"></span>
7
-        <md-grid-list class="home-grid" md-cols="2" md-row-height="200px" md-row-height-gt-sm="300px" md-row-height-gt-md="450px" md-gutter="4px" flex="40">
7
+        <md-grid-list class="image-grid" md-cols="2" md-row-height="200px" md-row-height-gt-sm="300px" md-row-height-gt-md="450px" md-gutter="4px" flex="40">
8 8
             <md-grid-tile class="red" md-colspan="2" md-rowspan="1">
9 9
                 <a ui-sref="persons">
10 10
                     <img class="article-picture" src="http://commons.wikimedia.org/wiki/Special:FilePath/Sir_Winston_S_Churchill.jpg?width=300">
@@ -25,4 +25,9 @@
25 25
             </md-grid-tile>
26 26
         </md-grid-list>
27 27
     </div>
28
+
29
+    <div ng-repeat="error in busy.errors('home.home')" class="isa_error">
30
+        <i class="fa fa-times-circle"></i>
31
+        {{ error.data.message }}
32
+    </div>
28 33
 </div>

+ 1
- 0
frontend/WebSem/app/views/toolbar.html Parādīt failu

@@ -5,5 +5,6 @@
5 5
         </md-button>
6 6
         <h2>{{title}}</h2>
7 7
         <span flex></span>
8
+        <!--<img src="img/blank.gif" class="flag flag-us" alt="English" />-->
8 9
     </div>
9 10
 </md-toolbar>

Notiek ielāde…
Atcelt
Saglabāt