Browse Source

article directive; home page

tags/v1.0
Robin Thoni 7 years ago
parent
commit
00998474d8

+ 46
- 17
backend/WebSem/.idea/.idea.WebSem/.idea/workspace.xml View File

@@ -2,8 +2,12 @@
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="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/.idea.WebSem/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/.idea.WebSem/.idea/workspace.xml" />
6
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/WebApiWebSem/DataAccess/ArticlesDataAccess.cs" afterPath="$PROJECT_DIR$/WebApiWebSem/DataAccess/ArticlesDataAccess.cs" />
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" />
9
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/index.html" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/index.html" />
10
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../frontend/WebSem/app/views/home.html" afterPath="$PROJECT_DIR$/../../frontend/WebSem/app/views/home.html" />
7 11
     </list>
8 12
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9 13
     <option name="TRACKING_ENABLED" value="true" />
@@ -39,8 +43,8 @@
39 43
       <file leaf-file-name="ArticlesDataAccess.cs" pinned="false" current-in-tab="true">
40 44
         <entry file="file://$PROJECT_DIR$/WebApiWebSem/DataAccess/ArticlesDataAccess.cs">
41 45
           <provider selected="true" editor-type-id="text-editor">
42
-            <state relative-caret-position="174">
43
-              <caret line="15" column="72" lean-forward="false" selection-start-line="15" selection-start-column="72" selection-end-line="15" selection-end-column="72" />
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" />
44 48
               <folding>
45 49
                 <marker date="1487804389248" expanded="true" signature="6:307" ph="..." />
46 50
                 <marker date="1487804389248" expanded="true" signature="342:4029" ph="{...}" />
@@ -68,6 +72,21 @@
68 72
           </provider>
69 73
         </entry>
70 74
       </file>
75
+      <file leaf-file-name="appsettings.Development.json" pinned="false" current-in-tab="false">
76
+        <entry file="file://$PROJECT_DIR$/WebApiWebSem/appsettings.Development.json">
77
+          <provider selected="true" editor-type-id="text-editor">
78
+            <state relative-caret-position="234">
79
+              <caret line="13" column="20" lean-forward="false" selection-start-line="13" selection-start-column="20" selection-end-line="13" selection-end-column="20" />
80
+              <folding>
81
+                <marker date="1487806459172" expanded="true" signature="0:493" ph="{...}" />
82
+                <marker date="1487806459172" expanded="true" signature="17:297" ph="{...}" />
83
+                <marker date="1487806459172" expanded="true" signature="71:291" ph="{...}" />
84
+                <marker date="1487806459172" expanded="true" signature="324:468" ph="{...}" />
85
+              </folding>
86
+            </state>
87
+          </provider>
88
+        </entry>
89
+      </file>
71 90
       <file leaf-file-name="ModelsDbo.cs" pinned="false" current-in-tab="false">
72 91
         <entry file="file://$PROJECT_DIR$/WebApiWebSem/DataAccess/ModelsDbo.cs">
73 92
           <provider selected="true" editor-type-id="text-editor">
@@ -127,10 +146,10 @@
127 146
         <option value="$PROJECT_DIR$/WebApiWebSem/Controllers/ArticlesBusiness.cs" />
128 147
         <option value="$PROJECT_DIR$/WebApiWebSem/Controllers/ArticlesController.cs" />
129 148
         <option value="$PROJECT_DIR$/WebApiWebSem/Startup.cs" />
130
-        <option value="$PROJECT_DIR$/WebApiWebSem/appsettings.Development.json" />
131 149
         <option value="$PROJECT_DIR$/Test/Tests.cs" />
132 150
         <option value="$PROJECT_DIR$/WebApiWebSem/DataAccess/ModelsDbo.cs" />
133 151
         <option value="$PROJECT_DIR$/WebApiWebSem/DataAccess/ArticlesDataAccess.cs" />
152
+        <option value="$PROJECT_DIR$/WebApiWebSem/appsettings.Development.json" />
134 153
       </list>
135 154
     </option>
136 155
   </component>
@@ -167,6 +186,10 @@
167 186
               <option name="myItemId" value="WebSem (2 projects)" />
168 187
               <option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
169 188
             </PATH_ELEMENT>
189
+            <PATH_ELEMENT>
190
+              <option name="myItemId" value="WebApiWebSem" />
191
+              <option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
192
+            </PATH_ELEMENT>
170 193
           </PATH>
171 194
           <PATH>
172 195
             <PATH_ELEMENT>
@@ -256,12 +279,12 @@
256 279
       <workItem from="1487345029610" duration="5634000" />
257 280
       <workItem from="1487441650798" duration="14018000" />
258 281
       <workItem from="1487528667649" duration="13931000" />
259
-      <workItem from="1487802391451" duration="1636000" />
282
+      <workItem from="1487802391451" duration="4043000" />
260 283
     </task>
261 284
     <servers />
262 285
   </component>
263 286
   <component name="TimeTrackingManager">
264
-    <option name="totallyTimeSpent" value="42433000" />
287
+    <option name="totallyTimeSpent" value="44840000" />
265 288
   </component>
266 289
   <component name="TodoView">
267 290
     <todo-panel id="selected-file">
@@ -282,7 +305,7 @@
282 305
       <window_info id="Unit Tests" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.26963907" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
283 306
       <window_info id="Run Dashboard" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
284 307
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
285
-      <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2282378" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
308
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2282378" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
286 309
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.19745223" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
287 310
       <window_info id="NuGet" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24258475" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" />
288 311
       <window_info id="Change Signature" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
@@ -640,13 +663,6 @@
640 663
         </state>
641 664
       </provider>
642 665
     </entry>
643
-    <entry file="file://$PROJECT_DIR$/WebApiWebSem/appsettings.Development.json">
644
-      <provider selected="true" editor-type-id="text-editor">
645
-        <state relative-caret-position="198">
646
-          <caret line="11" column="86" lean-forward="false" selection-start-line="11" selection-start-column="86" selection-end-line="11" selection-end-column="86" />
647
-        </state>
648
-      </provider>
649
-    </entry>
650 666
     <entry file="file://$USER_HOME$/.local/share/JetBrains/Shared/v08/DecompilerCache/decompiler/68A505D3-EE90-4B2D-8432-759050F70CC3/8e/cee9fac8/LuResult`1.cs">
651 667
       <provider selected="true" editor-type-id="text-editor">
652 668
         <state relative-caret-position="180">
@@ -661,6 +677,19 @@
661 677
         </state>
662 678
       </provider>
663 679
     </entry>
680
+    <entry file="file://$PROJECT_DIR$/WebApiWebSem/appsettings.Development.json">
681
+      <provider selected="true" editor-type-id="text-editor">
682
+        <state relative-caret-position="234">
683
+          <caret line="13" column="20" lean-forward="false" selection-start-line="13" selection-start-column="20" selection-end-line="13" selection-end-column="20" />
684
+          <folding>
685
+            <marker date="1487806459172" expanded="true" signature="0:493" ph="{...}" />
686
+            <marker date="1487806459172" expanded="true" signature="17:297" ph="{...}" />
687
+            <marker date="1487806459172" expanded="true" signature="71:291" ph="{...}" />
688
+            <marker date="1487806459172" expanded="true" signature="324:468" ph="{...}" />
689
+          </folding>
690
+        </state>
691
+      </provider>
692
+    </entry>
664 693
     <entry file="file://$PROJECT_DIR$/WebApiWebSem/DataAccess/ModelsDbo.cs">
665 694
       <provider selected="true" editor-type-id="text-editor">
666 695
         <state relative-caret-position="432">
@@ -681,8 +710,8 @@
681 710
     </entry>
682 711
     <entry file="file://$PROJECT_DIR$/WebApiWebSem/DataAccess/ArticlesDataAccess.cs">
683 712
       <provider selected="true" editor-type-id="text-editor">
684
-        <state relative-caret-position="174">
685
-          <caret line="15" column="72" lean-forward="false" selection-start-line="15" selection-start-column="72" selection-end-line="15" selection-end-column="72" />
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" />
686 715
           <folding>
687 716
             <marker date="1487804389248" expanded="true" signature="6:307" ph="..." />
688 717
             <marker date="1487804389248" expanded="true" signature="342:4029" ph="{...}" />

+ 1
- 1
backend/WebSem/WebApiWebSem/appsettings.Development.json View File

@@ -11,5 +11,5 @@
11 11
     "ConnectionStrings": {
12 12
         "default": "User ID=dev;Password=dev;Host=localhost;Port=5432;Database=websem_project;Pooling=true;ApplicationName=WebSemApiDev"
13 13
     },
14
-    "SleepTime": 0
14
+    "SleepTime": 1000
15 15
 }

+ 0
- 0
frontend/WebSem/app/controllers/directives/.gitkeep View File


+ 17
- 0
frontend/WebSem/app/controllers/directives/article.directive.js View File

@@ -0,0 +1,17 @@
1
+/**
2
+ * Created by robin on 02/22/17.
3
+ */
4
+angular.module('app')
5
+    .directive('article', [
6
+        function () {
7
+            return {
8
+                restrict: 'E',
9
+                require: 'ngModel',
10
+                templateUrl: 'views/directives/article.html',
11
+                scope: {
12
+                    'ngModel': '='
13
+                },
14
+                link: function ($scope, elm, attr, ctrl) {
15
+                }
16
+            };
17
+        }]);

+ 3
- 3
frontend/WebSem/app/controllers/home.controller.js View File

@@ -1,10 +1,10 @@
1 1
 angular.module('app')
2
-    .controller('HomeController', ['$scope', '$state', '$mdDialog', 'articlesBusiness', 'luBusyBusiness',
3
-        function($scope, $state, $mdDialog, articlesBusiness, luBusyBusiness) {
2
+    .controller('HomeController', ['$scope', '$state', '$mdDialog', 'articlesBusiness', 'luBusyBusiness', 'AppUtilsBusiness',
3
+        function($scope, $state, $mdDialog, articlesBusiness, luBusyBusiness, AppUtilsBusiness) {
4 4
 
5 5
         luBusyBusiness.reset();
6 6
         $scope.item = null;
7
-        $scope.itemType = 'articles';
7
+        $scope.appUtils = AppUtilsBusiness;
8 8
 
9 9
         $scope.load = function()
10 10
         {

+ 1
- 0
frontend/WebSem/app/index.html View File

@@ -78,6 +78,7 @@
78 78
     <script src="../sdk/Business/articles.business.js"></script>
79 79
 
80 80
     <!-- Directives -->
81
+    <script src="controllers/directives/article.directive.js"></script>
81 82
 
82 83
     <!-- Filters -->
83 84
     <script src="controllers/filters/formatDate.filter.js"></script>

+ 32
- 0
frontend/WebSem/app/less/app.less View File

@@ -164,6 +164,38 @@ md-table-container tbody tr {
164 164
   .justify-text();
165 165
 }
166 166
 
167
+.home-grid {
168
+  .red {
169
+    background: #ff8a80;
170
+  }
171
+  .blue {
172
+    background: #448aff;
173
+  }
174
+  .purple {
175
+    background: #b388ff;
176
+  }
177
+  figure {
178
+    padding: 12px;
179
+  }
180
+  md-grid-tile-footer {
181
+    background: rgba(0, 0, 0, 0.68);
182
+    height: 36px;
183
+    figcaption {
184
+      width: 100%;
185
+      h3 {
186
+        margin: 0;
187
+        font-weight: 700;
188
+        width: 100%;
189
+        text-align: center;
190
+      }
191
+    }
192
+  }
193
+  .article-picture {
194
+    max-width: 100%;
195
+    max-height: 100%;
196
+  }
197
+}
198
+
167 199
 /**
168 200
 ========================================================
169 201
 **/

+ 0
- 0
frontend/WebSem/app/views/directives/.gitkeep View File


+ 35
- 0
frontend/WebSem/app/views/directives/article.html View File

@@ -0,0 +1,35 @@
1
+<div layout="column" layout-align=" center">
2
+    <p class="newline-text article-text">{{ ngModel.text }}</p>
3
+</div>
4
+<div layout="row">
5
+    <div flex="70">
6
+        <md-table-container ng-show="ngModel != null">
7
+            <table md-table>
8
+                <thead md-head>
9
+                <tr md-row>
10
+                    <th md-column>{{ 'articles.fields.property' | translate }}</th>
11
+                    <th md-column>{{ 'articles.fields.value' | translate }}</th>
12
+                </tr>
13
+                </thead>
14
+                <tbody md-body>
15
+                <tr md-row ng-repeat="field in ngModel.fields track by $index">
16
+                    <td md-cell>
17
+                        {{ 'articles.fields.properties.' + field.property | translate }}
18
+                    </td>
19
+                    <td md-cell>
20
+                        {{ field.value }}
21
+                    </td>
22
+                </tr>
23
+                </tbody>
24
+            </table>
25
+        </md-table-container>
26
+    </div>
27
+    <div flex="30">
28
+        <div layout="column" layout-align=" center">
29
+            <img class="article-picture" ng-src="{{ngModel.pictureUrl}}" />
30
+        </div>
31
+        <div layout="column" layout-align=" center">
32
+            <p class="newline-text article-picture-caption">{{ ngModel.pictureCaption }}</p>
33
+        </div>
34
+    </div>
35
+</div>

+ 23
- 32
frontend/WebSem/app/views/home.html View File

@@ -1,37 +1,28 @@
1 1
 <div layout="column" layout-fill layout-align="top" angular-busy="appUtils.cgBusy('home.home')">
2
-    <div layout="column" layout-align=" center">
3
-        <p class="newline-text article-text">{{ item.text }}</p>
2
+    <div layout="row">
3
+        <article ng-model="item"></article>
4 4
     </div>
5 5
     <div layout="row">
6
-        <div flex="70">
7
-            <md-table-container>
8
-                <table md-table>
9
-                    <thead md-head>
10
-                    <tr md-row>
11
-                        <th md-column>{{ itemType + '.fields.property' | translate }}</th>
12
-                        <th md-column>{{ itemType + '.fields.value' | translate }}</th>
13
-                    </tr>
14
-                    </thead>
15
-                    <tbody md-body>
16
-                    <tr md-row ng-repeat="field in item.fields track by $index">
17
-                        <td md-cell>
18
-                            {{ itemType + '.fields.properties.' + field.property | translate }}
19
-                        </td>
20
-                        <td md-cell>
21
-                            {{ field.value }}
22
-                        </td>
23
-                    </tr>
24
-                    </tbody>
25
-                </table>
26
-            </md-table-container>
27
-        </div>
28
-        <div flex="30">
29
-            <div layout="column" layout-align=" center">
30
-                <img class="article-picture" ng-src="{{item.pictureUrl}}" />
31
-            </div>
32
-            <div layout="column" layout-align=" center">
33
-                <p class="newline-text article-picture-caption">{{ item.pictureCaption }}</p>
34
-            </div>
35
-        </div>
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">
8
+            <md-grid-tile class="red" md-colspan="2" md-rowspan="1">
9
+                <a ui-sref="persons">
10
+                    <img class="article-picture" src="http://commons.wikimedia.org/wiki/Special:FilePath/Sir_Winston_S_Churchill.jpg?width=300">
11
+                    <md-grid-tile-footer><h3>{{ 'persons.name' | translate }}</h3></md-grid-tile-footer>
12
+                </a>
13
+            </md-grid-tile>
14
+            <md-grid-tile class="purple" md-colspan="1" md-rowspan="1">
15
+                <a ui-sref="countries">
16
+                    <img class="article-picture" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Flag_of_Canada_%28Pantone%29.svg/1000px-Flag_of_Canada_%28Pantone%29.svg.png">
17
+                    <md-grid-tile-footer><h3>{{ 'countries.name' | translate }}</h3></md-grid-tile-footer>
18
+                </a>
19
+            </md-grid-tile>
20
+            <md-grid-tile class="blue" md-colspan="1" md-rowspan="1">
21
+                <a ui-sref="locations">
22
+                    <img class="article-picture" src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Europe_orthographic_Caucasus_Urals_boundary_%28with_borders%29.svg/langfr-280px-Europe_orthographic_Caucasus_Urals_boundary_%28with_borders%29.svg.png">
23
+                    <md-grid-tile-footer><h3>{{ 'locations.name' | translate }}</h3></md-grid-tile-footer>
24
+                </a>
25
+            </md-grid-tile>
26
+        </md-grid-list>
36 27
     </div>
37 28
 </div>

Loading…
Cancel
Save