Skip to content

Commit

Permalink
Mod: Formulario para traducción de conclusiones de preguntas abiertas…
Browse files Browse the repository at this point in the history
… en beneficios
  • Loading branch information
elyambay committed Oct 21, 2019
1 parent 058ded8 commit 643c174
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/Http/Controllers/BeneficiosAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ public function storeConclusion(Request $request){
$dbData->rubro_id = $request->rubro;
$dbData->periodo = $request->periodo;
$dbData->conclusion = $request->conclusion;
$dbData->conclusion_en = $request->conclusion_en;
$dbData->save();

return redirect()->route('home');
Expand All @@ -287,7 +288,7 @@ public function getConclusion(Request $request)
if(!$dbData){
return null;
}
return $dbData->conclusion;
return $dbData;
}

public function panel($id){
Expand Down
2 changes: 1 addition & 1 deletion app/beneficios_conclusion_abierta.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class beneficios_conclusion_abierta extends Model
{
protected $table = "beneficios_conclusion_abiertas";

protected $fillable = ["beneficios_pregunta_id", "rubro_id", "conclusion", "periodo"];
protected $fillable = ["beneficios_pregunta_id", "rubro_id", "conclusion", "conclusion_en", "periodo"];

public function pregunta(){
return $this->belongsTo("App\beneficios_pregunta");
Expand Down
13 changes: 11 additions & 2 deletions resources/views/beneficios_admin/create_conclusion.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
<textarea name="conclusion" id="conclusion" class="materialize-textarea"></textarea>
</div>
</div>
<div class="row">
<div class="input-field cols 12">
<label for="conclusion_en">Conclusión (Inglés)</label>
<textarea name="conclusion_en" id="conclusion_en" class="materialize-textarea"></textarea>
</div>
</div>
<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
<div class="button-group">
<button class="btn waves-effect waves-light" type="submit" name="submit">Guardar
Expand Down Expand Up @@ -112,8 +118,11 @@ function getConclusion(){
'_token':'{{ csrf_token() }}'
},
function(data){
$("#conclusion").text(data);
$('label[for="conclusion"]').addClass('active');
console.log(data);
$("#conclusion").text(data.conclusion);
$('label[for="conclusion"]').addClass('active');
$("#conclusion_en").text(data.conclusion_en);
$('label[for="conclusion_en"]').addClass('active');
}
);
Expand Down

0 comments on commit 643c174

Please sign in to comment.