mirror of
https://github.com/bodyrep/bodyrep-sandpit.git
synced 2026-01-30 00:31:42 +00:00
Controllers
Authentication was moved from the member controller the new AuthController. User entity created strictly for session management Symfony config Service and parameter configuration has been switched to YAML and consolidated into app/config/config.yml Removed Twig extension from the service container (services.xml) Presentation LABJS test added Some sample js added to test inline js vs callbacks vs Twig/Angular/etc Tests New units tests for Landing, Profile, Auth and Member controllers
This commit is contained in:
34
src/BodyRep/Resources/views/Auth/login.html.twig
Normal file
34
src/BodyRep/Resources/views/Auth/login.html.twig
Normal file
@@ -0,0 +1,34 @@
|
||||
{% extends 'BodyRep::layout.html.twig' %}
|
||||
{% block js %}
|
||||
$(document).ready(function()
|
||||
{
|
||||
if($('#username').val().length > 0)
|
||||
$('#password').focus();
|
||||
else
|
||||
$('#username').focus();
|
||||
});
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
<h1>Login</h1>
|
||||
|
||||
{% if error %}
|
||||
<div class="error">{{ error.message }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form name='login' action="{{ path("_login_check") }}" method="post" id="login">
|
||||
<div>
|
||||
<label for="username">Username</label>
|
||||
<input type="text" id="username" name="_username" value="{{ last_username }}" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" id="password" name="_password" />
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary btn-mini" id='loginbtn' value="LOGIN" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
35
src/BodyRep/Resources/views/Auth/navbar.html.twig
Normal file
35
src/BodyRep/Resources/views/Auth/navbar.html.twig
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container-fluid">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<img src="/img/logo-nav.png" class='pull-left' style='padding-right : 5px; margin-top : 10px;' />
|
||||
<a class="brand" href="#">BODY<b>REP</b></a>
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#" style="background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
|
||||
<i class="icon-user icon-white"></i> {{name}}
|
||||
<span class="caret" style='border-top-color : white; border-bottom-color : white;'></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ path('_member_profile') }}">Profile</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="{{ path('_logout') }}">Sign Out</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='offset2'>
|
||||
<form class="navbar-search pull-left" id='topsearch' action="{{ path('_member_search') }}">
|
||||
<input type="text" class="search-query span4" id="topsearch" style='height : 28px;' placeholder="Search"><span id='msg_topsearch'></span>
|
||||
</form>
|
||||
</div>
|
||||
<a class="btn dropdown-toggle pull-right" data-toggle="dropdown" href="#" style="margin : 0; background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
|
||||
<i class='licon-calendar licon-white'></i>
|
||||
</a>
|
||||
<a class="btn dropdown-toggle pull-right" data-toggle="dropdown" href="#" style="margin : 0; background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
|
||||
<i class='licon-mail-new licon-white'></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -20,6 +20,6 @@
|
||||
<div> </div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
<input type="submit" class="btn btn-primary btn-mini" value="Save" />
|
||||
<input type="submit" class="btn btn-primary btn-small" value="Save" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
{% block title "Hello " ~ name %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'BodyRep:Member:navbar.html.twig' %}
|
||||
|
||||
{% include 'BodyRep:Auth:navbar.html.twig' %}
|
||||
<div class='row-fluid'>
|
||||
<h1>Member landing page</h1>
|
||||
|
||||
{{name}}
|
||||
<h3>{{name}}</h3>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% block content_header '' %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'BodyRep:Member:navbar.html.twig' %}
|
||||
{% include 'BodyRep:Auth:navbar.html.twig' %}
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
|
||||
12
src/BodyRep/Resources/views/Profile/comment.html.twig
Normal file
12
src/BodyRep/Resources/views/Profile/comment.html.twig
Normal file
@@ -0,0 +1,12 @@
|
||||
{% for comment in comments %}
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user1'></div>
|
||||
<a>{{ comment.author }}</a>
|
||||
<p>{{ comment.text }} </p>
|
||||
<div class="like-comment-time">
|
||||
{{ comment.thumbs }}
|
||||
<i class="icon-comment"></i>
|
||||
<span>{{ comment.dateHuman }} </span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
@@ -1,11 +1,18 @@
|
||||
{% extends 'BodyRep::layout.html.twig' %}
|
||||
|
||||
{% block title %}BodyRep{% endblock %}
|
||||
{% block documentReady %}
|
||||
$('#rep').live('click', function() {
|
||||
$.get('{{ path("_profile_reputation", { 'username': app.request.get('username') }) }}', {}, function (data) {
|
||||
$('#mcnt').html(data);
|
||||
});
|
||||
});
|
||||
{% endblock %}
|
||||
|
||||
{% block content_header '' %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'BodyRep:Member:navbar.html.twig' %}
|
||||
{% include 'BodyRep:Auth:navbar.html.twig' %}
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
@@ -13,7 +20,7 @@
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Profile</li>
|
||||
<li class="active"><a href="#">Body Stats</a></li>
|
||||
<li><a href="#">Body Reputation</a></li>
|
||||
<li><a href="#" id='rep'>Body Reputation</a></li>
|
||||
<li><a href="#">Challenges</a></li>
|
||||
<li class="nav-header">Workouts</li>
|
||||
<li class="nav-header">Meals</li>
|
||||
|
||||
10
src/BodyRep/Resources/views/Profile/reputation.html.twig
Normal file
10
src/BodyRep/Resources/views/Profile/reputation.html.twig
Normal file
@@ -0,0 +1,10 @@
|
||||
{% block js %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content_header '' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row-fluid">
|
||||
Reputation page
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<title>{% block title %}BodyRep{% endblock %}</title>
|
||||
<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}" media="all" />
|
||||
<style type="text/css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-top: 60px;
|
||||
padding-bottom: 40px;
|
||||
@@ -17,22 +17,35 @@
|
||||
padding: 9px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('css/bootstrap-responsive.css') }}" />
|
||||
<link rel="stylesheet" href="{{ asset('css/site.css') }}" />
|
||||
<link rel="stylesheet" href="{{ asset('css/chosen.css') }}" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/application.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/jquery.chosen.min.js') }}"></script>
|
||||
{% block javascripts %}
|
||||
<script type="text/javascript" src="{{ asset('js/LAB.js') }}"></script>
|
||||
|
||||
<script type="text/javascript" src="{{ asset('js/bootstrap.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var loadb;
|
||||
$LAB.script('https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js')
|
||||
.script('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js')
|
||||
.script("{{ asset('js/application.js') }}")
|
||||
.script("{{ asset('js/jquery.chosen.min.js') }}")
|
||||
.script("{{ asset('js/bootstrap.js') }}").wait(function() {
|
||||
|
||||
{% block documentReady %}
|
||||
|
||||
{% endblock %}
|
||||
clearTimeout(loadb);
|
||||
$('#loadmast').hide();
|
||||
$('#mast').removeClass('hidden');
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id='mast' class='hidden'>
|
||||
<div class="container-fluid symfony-content">
|
||||
|
||||
{% block content %}
|
||||
@@ -46,8 +59,9 @@
|
||||
<p>© BodyRep 2012</p>
|
||||
</footer>
|
||||
|
||||
</div><!--/.fluid-container-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id='loadmast'><img align="absmiddle" style="margin-left: 10px; margin-bottom: 3px;" src="/img/progress.gif"> Loading</div>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user