fixed project overview

This commit is contained in:
zmagod 2016-08-09 14:26:08 +02:00
parent 176aad4c6d
commit 5f3a5cb845
7 changed files with 29 additions and 18 deletions

View file

@ -413,10 +413,12 @@ li.module-hover {
max-width: 650px; max-width: 650px;
margin: 0 auto; margin: 0 auto;
margin-top: 25px; margin-top: 25px;
margin-bottom: 15px;
@include box-shadow(0px 4px 8px 0px $color-dove-gray); @include box-shadow(0px 4px 8px 0px $color-dove-gray);
} }
.workflowimg-container {
margin: 15px 0 15px 0;
}
// SHOW // SHOW
.center-btn{ .center-btn{
margin: 0 auto; margin: 0 auto;

View file

@ -232,7 +232,7 @@ class CanvasController < ApplicationController
end end
# Create workflow image # Create workflow image
@experiment.generate_workflow_img @experiment.delay.generate_workflow_img
flash[:success] = t( flash[:success] = t(
"experiments.canvas.update.success_flash") "experiments.canvas.update.success_flash")

View file

@ -58,7 +58,7 @@ class ExperimentsController < ApplicationController
flash[:success] = t('experiments.update.success_flash', flash[:success] = t('experiments.update.success_flash',
experiment: @experiment.name) experiment: @experiment.name)
redirect_to canvas_experiment_path(@experiment) redirect_to project_path(@experiment.project)
else else
flash[:alert] = t('experiments.update.error_flash') flash[:alert] = t('experiments.update.error_flash')
redirect_to :back redirect_to :back

View file

@ -268,6 +268,7 @@ class Organization < ActiveRecord::Base
end end
end end
end end
# project.experiments.each |experiment|
self.space_taken = [st, MINIMAL_ORGANIZATION_SPACE_TAKEN].max self.space_taken = [st, MINIMAL_ORGANIZATION_SPACE_TAKEN].max
Rails::logger.info "Organization #{self.id}: " + Rails::logger.info "Organization #{self.id}: " +
"space (re)calculated to: " + "space (re)calculated to: " +

View file

@ -105,7 +105,7 @@ class Project < ActiveRecord::Base
end end
def active_experiments def active_experiments
experiments.is_archived(false) experiments.is_archived(false).order('created_at DESC')
end end
def project_my_modules def project_my_modules

View file

@ -16,10 +16,12 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<% @project.active_experiments.each do |experiment| %> <div class="row">
<% @project.active_experiments.each_with_index do |experiment, index| %>
<%= render partial: 'projects/show/experiment', <%= render partial: 'projects/show/experiment',
locals: { experiment: experiment } %> locals: { experiment: experiment } %>
<%= content_tag(:div, '', class: 'clearfix visible-lg-block') if (index + 1) % 2 == 0 %>
<% end %> <% end %>
</div>
<%= javascript_include_tag("projects/show") %> <%= javascript_include_tag("projects/show") %>

View file

@ -2,10 +2,9 @@
<div class="panel panel-default experiment-panel" <div class="panel panel-default experiment-panel"
data-id="<%= experiment.id %>"> data-id="<%= experiment.id %>">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"><%= link_to experiment.name, canvas_experiment_path(experiment) %></h3>
<span class="dropdown pull-right"> <div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" <button class="btn btn-link dropdown-toggle"
type="button" type="button"
id="exActionsMenu-<%= experiment.id %>" id="exActionsMenu-<%= experiment.id %>"
data-toggle="dropdown" data-toggle="dropdown"
@ -29,15 +28,22 @@
data: { confirm: t('experiments.canvas.archive_confirm') } %></li> data: { confirm: t('experiments.canvas.archive_confirm') } %></li>
<% end %> <% end %>
</ul> </ul>
</span> </div>
<h3 class="panel-title"><%= link_to experiment.name, canvas_experiment_path(experiment) %></h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<% if experiment.workflowimg? %> <% if experiment.workflowimg? %>
<%= image_tag experiment.workflowimg, class: 'img-responsive center-block' %> <div class="workflowimg-container">
<%= link_to image_tag(experiment.workflowimg,
class: 'img-responsive center-block'),
canvas_experiment_path(experiment) %>
</div>
<% end %> <% end %>
<span> <span>
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> <span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
<%= localize(experiment.created_at, format: t('time.formats.full_date')) %> <%= localize(experiment.created_at, format: t('time.formats.full_date')) %> - <%= localize(experiment.updated_at, format: t('time.formats.full_date')) %>
</span> </span>
<p><%= experiment.description %></p> <p><%= experiment.description %></p>
</div> </div>