Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

Commit

Permalink
default route basic ui improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rlbaltha committed Apr 3, 2015
1 parent dcd877a commit f106876
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions app/Resources/FOSUserBundle/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
<script language="javascript">
$(document).ready(function()
{
$("input:submit").addClass("btn btn-primary btn-lg btn-block");
$("input:text").addClass("form-control");
$("input:password").addClass("form-control");
$("#fos_user_registration_form_email").addClass("form-control");
$("#fos_user_registration_form_share_email").addClass("checkbox");
$("#fos_user_registration_form_institution").addClass("form-control");
});
</script>
</head>


Expand Down Expand Up @@ -47,17 +58,6 @@
</nav>


<div class="col-sm-offset-1 col-lg-10">
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{{ 'layout.logged_in_as'|trans({'%username%': app.user.username}, 'FOSUserBundle') }} |
<a href="{{ path('fos_user_security_logout') }}">
{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
</a>
{% else %}
<a href="{{ path('fos_user_security_login') }}">{{ 'layout.login'|trans({}, 'FOSUserBundle') }}</a>
{% endif %}
</div>

{% for type, messages in app.session.flashBag.all %}
{% for message in messages %}
<div class="{{ type }}">
Expand All @@ -66,7 +66,7 @@
{% endfor %}
{% endfor %}

<div class="col-sm-offset-1 col-lg-10">
<div class="col-sm-offset-4 col-lg-4">
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>

<div class="col-sm-12">
{% block body %}{% endblock %}
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
root:
path: /
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: fos_user_security_login
permanent: true

fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"

Expand Down
55 changes: 25 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/AppBundle/Controller/PointController.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function updateAction(Request $request, $id)
if ($editForm->isValid()) {
$em->flush();

return $this->redirect($this->generateUrl('point_edit', array('id' => $id)));
return $this->redirect($this->generateUrl('point_show', array('id' => $id)));
}

return array(
Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Entity/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Location
/**
* @var string
*
* @ORM\Column(name="description", type="text")
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;

Expand Down
4 changes: 2 additions & 2 deletions src/AppBundle/Entity/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class Map
/**
* @var string
*
* @ORM\Column(name="description", type="text")
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;

/**
* @var string
*
* @ORM\Column(name="background", type="text")
* @ORM\Column(name="background", type="text", nullable=true)
*/
private $background;

Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Entity/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Point
/**
* @var string
*
* @ORM\Column(name="body", type="text")
* @ORM\Column(name="body", type="text", nullable=true)
*/
private $body;

Expand Down
4 changes: 2 additions & 2 deletions src/AppBundle/Resources/views/Location/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<div class="list-group">
<a href="{{ path('location_show', { 'id': entity.id }) }}" class="list-group-item active">
<h4 class="list-group-item-heading">{{ entity.title }}</h4>
<p class="list-group-item-text">{{ entity.description }}</p>
<p class="list-group-item-text">{{ entity.description|raw }}</p>
</a>
</div>
{% endfor %}

<a href="{{ path('location_new') }}">
Create a new entry
Create a new location
</a>

{% endblock %}
1 change: 0 additions & 1 deletion src/AppBundle/Resources/views/Location/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<div class="list-group">
<a href="{{ path('point_show', { 'id': entity.id }) }}" class="list-group-item active">
<h4 class="list-group-item-heading">{{ entity.title }}</h4>
<p class="list-group-item-text">{{ entity.body }}</p>
</a>
</div>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Resources/views/Map/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endfor %}

<a href="{{ path('map_new') }}">
Create a new entry
Create a new map
</a>


Expand Down
39 changes: 9 additions & 30 deletions src/AppBundle/Resources/views/Point/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,19 @@
{% block body -%}
<h1>Point list</h1>

<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Title</th>
<th>Body</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('point_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.title }}</td>
<td>{{ entity.body }}</td>
<td>
<ul>
<li>
<a href="{{ path('point_show', { 'id': entity.id }) }}">show</a>
</li>
<li>
<a href="{{ path('point_edit', { 'id': entity.id }) }}">edit</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% for entity in entities %}
<div class="list-group">
<a href="{{ path('point_show', { 'id': entity.id }) }}" class="list-group-item active">
<h4 class="list-group-item-heading">{{ entity.title }}</h4>
<p class="list-group-item-text">{{ entity.body|raw }}</p>
</a>
</div>
{% endfor %}

<ul>
<li>
<a href="{{ path('point_new') }}">
Create a new entry
Create a new point on the map
</a>
</li>
</ul>
Expand Down
24 changes: 7 additions & 17 deletions src/AppBundle/Resources/views/Point/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,17 @@
{% block body -%}
<h1>Point</h1>

<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
</tr>
<tr>
<th>Title</th>
<td>{{ entity.title }}</td>
</tr>
<tr>
<th>Body</th>
<td>{{ entity.body }}</td>
</tr>
</tbody>
</table>
<div class="list-group">
<a href="{{ path('point_show', { 'id': entity.id }) }}" class="list-group-item active">
<h4 class="list-group-item-heading">{{ entity.title }}</h4>
<p class="list-group-item-text">{{ entity.body|raw }}</p>
</a>
</div>

<ul class="record_actions">
<li>
<a href="{{ path('point') }}">
Back to the list
List points
</a>
</li>
<li>
Expand Down

0 comments on commit f106876

Please sign in to comment.