diff options
author | Marvin Borner | 2018-04-25 17:13:27 +0200 |
---|---|---|
committer | Marvin Borner | 2018-04-25 17:13:27 +0200 |
commit | 3f404e93155299ad395312ee2328df773bd0a677 (patch) | |
tree | b34e5047983beba7127a110812c6baa5e69508fb /main | |
parent | 0ddf1d1ca8111132259d139b4fc498f06978e9e5 (diff) |
Added basic user/friend integration
Diffstat (limited to 'main')
3 files changed, 23 insertions, 1 deletions
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/main.js b/main/app/sprinkles/core/assets/SiteAssets/js/main.js index 8341cbf..dbbfc5b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/js/main.js +++ b/main/app/sprinkles/core/assets/SiteAssets/js/main.js @@ -120,6 +120,8 @@ UserSearchBar.keyup(function () { error: function () { console.log("[SEARCH LOGGER] 404s are not a bug - they're a feature!"); console.log("[SEARCH LOGGER] " + RequestedUser + " not found..."); + + SearchResults.empty(); } }); });
\ No newline at end of file diff --git a/main/app/sprinkles/core/src/Controller/CoreController.php b/main/app/sprinkles/core/src/Controller/CoreController.php index b5f6e3c..9a73e66 100644 --- a/main/app/sprinkles/core/src/Controller/CoreController.php +++ b/main/app/sprinkles/core/src/Controller/CoreController.php @@ -27,8 +27,19 @@ class CoreController extends SimpleController * By default, this is the page that non-authenticated users will first see when they navigate to your website's root. * Request type: GET */ + public function pageIndex($request, $response, $args) { - return $this->ci->view->render($response, 'pages/index.html.twig'); + /** @var UserFrosting\Sprinkle\Core\Util\ClassMapper $classMapper */ + $classMapper = $this->ci->classMapper; + + // Probably a better way to do this + $users = $classMapper->staticMethod('user', 'orderBy', 'created_at', 'desc') + //->take(8) + ->get(); + + return $this->ci->view->render($response, 'pages/index.html.twig', [ + 'users' => $users + ]); } /** diff --git a/main/app/sprinkles/core/templates/pages/index.html.twig b/main/app/sprinkles/core/templates/pages/index.html.twig index e560fd9..b40b958 100644 --- a/main/app/sprinkles/core/templates/pages/index.html.twig +++ b/main/app/sprinkles/core/templates/pages/index.html.twig @@ -78,6 +78,15 @@ </div> <hr> </div> + <div class="MainInTab"> + {% for user in users %} + <li> + <img src="{{ user.avatar }}" alt="User Image"> + <a class="users-list-name" href="{{site.uri.public}}/users/u/{{user.user_name}}">{{user.first_name}} {{user.last_name}}</a> + <span class="users-list-date">{{ user.registered }}</span> + </li> + {% endfor %} + </div> </div> <div class="carousel-cell PersonalTab"> |