1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

fix project step images height bug

This commit is contained in:
Peng DU 2016-11-03 11:26:01 +01:00
parent f1b749d5f2
commit 9dca65786a
3 changed files with 5 additions and 3 deletions

View File

@ -101,7 +101,8 @@
<summernote ng-model="step.description" placeholder="" config="summernoteOpts" name=project[project_steps_attributes][][description]></summernote>
<div class="row">
<div class="col-md-4" ng-repeat="image in step.project_step_images_attributes" ng-show="!image._destroy">
<div ng-repeat-start="image in step.project_step_images_attributes" class="clearfix" ng-if="$index % 3 == 0"></div>
<div class="col-md-4" ng-repeat-end ng-show="!image._destroy">
<input type="hidden" name="project[project_steps_attributes][][project_step_images_attributes][][id]" ng-value="image.id" />
<input type="hidden" name="project[project_steps_attributes][][project_step_images_attributes][][_destroy]" ng-value="image._destroy" />

View File

@ -42,7 +42,8 @@
<div class="col-md-12 m-b-xs">
<h3 class="well well-simple step-title">{{ 'step_N' | translate:{INDEX:step.step_nb} }} : {{step.title}}</h3>
</div>
<div class="col-md-4" ng-repeat="image in step.project_step_images_attributes">
<div ng-repeat-start="image in step.project_step_images_attributes" class="clearfix" ng-if="$index % 3 == 0"></div>
<div class="col-md-4" ng-repeat-end>
<a href="{{image.attachment_full_url}}" target="_blank"><img class="img-responsive m-b" ng-src="{{image.attachment_url}}" alt="{{image.attachment}}" ></a>
</div>
<div class="col-md-8" ng-class="{'col-md-12' : step.project_step_images_attributes.length > 1 || step.project_step_images_attributes.length == 0}">

View File

@ -51,7 +51,7 @@ json.project_steps_attributes @project.project_steps.order('project_steps.step_n
json.id s.id
json.description s.description
json.title s.title
json.project_step_images_attributes s.project_step_images do |si|
json.project_step_images_attributes s.project_step_images.order('created_at ASC') do |si|
json.id si.id
json.attachment si.attachment_identifier
json.attachment_url si.attachment.medium.url