mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-02 09:54:37 +08:00
fixed project overview
This commit is contained in:
parent
176aad4c6d
commit
5f3a5cb845
7 changed files with 29 additions and 18 deletions
|
@ -409,14 +409,16 @@ li.module-hover {
|
|||
|
||||
// EXPERIMENT PANEL
|
||||
|
||||
.experiment-panel{
|
||||
.experiment-panel {
|
||||
max-width: 650px;
|
||||
margin: 0 auto;
|
||||
margin-top: 25px;
|
||||
margin-bottom: 15px;
|
||||
@include box-shadow(0px 4px 8px 0px $color-dove-gray);
|
||||
|
||||
}
|
||||
|
||||
.workflowimg-container {
|
||||
margin: 15px 0 15px 0;
|
||||
}
|
||||
// SHOW
|
||||
.center-btn{
|
||||
margin: 0 auto;
|
||||
|
|
|
@ -232,7 +232,7 @@ class CanvasController < ApplicationController
|
|||
end
|
||||
|
||||
# Create workflow image
|
||||
@experiment.generate_workflow_img
|
||||
@experiment.delay.generate_workflow_img
|
||||
|
||||
flash[:success] = t(
|
||||
"experiments.canvas.update.success_flash")
|
||||
|
|
|
@ -57,8 +57,8 @@ class ExperimentsController < ApplicationController
|
|||
if @experiment.save
|
||||
flash[:success] = t('experiments.update.success_flash',
|
||||
experiment: @experiment.name)
|
||||
|
||||
redirect_to canvas_experiment_path(@experiment)
|
||||
|
||||
redirect_to project_path(@experiment.project)
|
||||
else
|
||||
flash[:alert] = t('experiments.update.error_flash')
|
||||
redirect_to :back
|
||||
|
|
|
@ -268,6 +268,7 @@ class Organization < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
# project.experiments.each |experiment|
|
||||
self.space_taken = [st, MINIMAL_ORGANIZATION_SPACE_TAKEN].max
|
||||
Rails::logger.info "Organization #{self.id}: " +
|
||||
"space (re)calculated to: " +
|
||||
|
|
|
@ -105,7 +105,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def active_experiments
|
||||
experiments.is_archived(false)
|
||||
experiments.is_archived(false).order('created_at DESC')
|
||||
end
|
||||
|
||||
def project_my_modules
|
||||
|
|
|
@ -16,10 +16,12 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% @project.active_experiments.each do |experiment| %>
|
||||
<%= render partial: 'projects/show/experiment',
|
||||
locals: { experiment: experiment } %>
|
||||
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<% @project.active_experiments.each_with_index do |experiment, index| %>
|
||||
<%= render partial: 'projects/show/experiment',
|
||||
locals: { experiment: experiment } %>
|
||||
|
||||
<%= content_tag(:div, '', class: 'clearfix visible-lg-block') if (index + 1) % 2 == 0 %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= javascript_include_tag("projects/show") %>
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
<div class="panel panel-default experiment-panel"
|
||||
data-id="<%= experiment.id %>">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><%= link_to experiment.name, canvas_experiment_path(experiment) %></h3>
|
||||
|
||||
<span class="dropdown pull-right">
|
||||
<button class="btn btn-default dropdown-toggle"
|
||||
<div class="dropdown pull-right">
|
||||
<button class="btn btn-link dropdown-toggle"
|
||||
type="button"
|
||||
id="exActionsMenu-<%= experiment.id %>"
|
||||
data-toggle="dropdown"
|
||||
|
@ -29,15 +28,22 @@
|
|||
data: { confirm: t('experiments.canvas.archive_confirm') } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<h3 class="panel-title"><%= link_to experiment.name, canvas_experiment_path(experiment) %></h3>
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<% 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 %>
|
||||
<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>
|
||||
<p><%= experiment.description %></p>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue