Skip to content
Snippets Groups Projects
Commit 12ad040d authored by Camille Simiand's avatar Camille Simiand
Browse files

Add Create a caspule button link

parent 2727bb9f
No related branches found
No related tags found
1 merge request!32tuleap-50-create-a-capsule-for-an-unexisting-project-in-the-legacy
......@@ -8,11 +8,6 @@ body {
width:100%;
}
//.container {
// width: 60%;
// margin: 0 auto;
//}
form label {
color: rgba(255,255,255,.5)
}
......@@ -52,6 +47,24 @@ button[type=submit]{
opacity: 1;
}
#btn-orange {
background: #FA772E;
color: white;
border: none;
border-radius: 3px;
line-height: 1.5;
font-size: 1rem;
margin: 30px 0 0 0;
padding: .5rem 1rem;
text-align: center;
text-transform: uppercase;
box-shadow: 0 -2px 0 #f05b2b inset;
}
#btn-orange:hover {
background: #f05b2b;
}
#user-block {
position: absolute;
right: 0;
......@@ -71,11 +84,8 @@ button[type=submit]{
box-shadow: 0 0 10px rgba(0,0,0,.5);
border-radius: 2px;
margin-bottom: 40px;
//display: inline-flex;
align-items: center;
justify-content: center;
//width: 100%;
//position: absolute;
}
.elements-left {
......
......@@ -36,13 +36,14 @@ class CapsuleController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) {
$capsulePass = $request->request->get('p');
$new_date_time = new \DateTime();
$video_url = $form->get('video_url')->getData();
$capsule->setName($this->sanitize($form->get('name')->getData()));
$capsule->setVideoUrl($form->get('video_url')->getData());
$capsule->setVideoUrl($video_url);
$capsule->setCreationAuthor($this->getUser());
$capsule->setCreationDate($new_date_time);
$capsule->setUpdatedDate($new_date_time);
$capsule->setEditionLink($request->get('video_url') . '/?p=' . $capsulePass);
$capsule->setEditionLink($video_url . '/?p=' . $capsulePass);
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($capsule);
......
......@@ -3,18 +3,12 @@
{% block title %}Hello CapsuleController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ '/sites/memorekall/www/web_dev/src/Controller/CapsuleController.php'|file_link(0) }}">src/Controller/CapsuleController.php</a></code></li>
<li>Your template at <code><a href="{{ '/sites/memorekall/www/web_dev/templates/capsule/index.html.twig'|file_link(0) }}">templates/capsule/index.html.twig</a></code></li>
</ul>
<div class="d-flex justify-content-center align-items-center">
<form>
<button id="btn-orange" formaction="/create">
+ {{ 'capsule.create_capsule'|trans }}
</button>
</form>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment