mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
Merge pull request #95 from ZmagoD/zd_SCI_374
adds edit workflow link if no workflow [fixes SCI-374]
This commit is contained in:
commit
b090fd8d5b
|
@ -3263,6 +3263,13 @@ function initJsPlumb(containerSel, containerChildSel, modulesSel, params) {
|
|||
jsPlumb.fire("jsPlumbLoaded", instance);
|
||||
}
|
||||
|
||||
// Opens edit mode if redirected from empty experiment
|
||||
(function noWorkflowimgEditMode(){
|
||||
if( getParam('editMode') ){
|
||||
$("#edit-canvas-button").click();
|
||||
}
|
||||
})();
|
||||
|
||||
// Initialize first-time tutorial
|
||||
function initializeTutorial(isEditMode) {
|
||||
if (showTutorial()) {
|
||||
|
|
|
@ -407,40 +407,63 @@ li.module-hover {
|
|||
}
|
||||
}
|
||||
|
||||
/* EXPERIMENT PANEL */
|
||||
// EXPERIMENT PANEL
|
||||
.experiment-panel {
|
||||
@include box-shadow(0 4px 8px 0 $color-dove-gray);
|
||||
height: 550px;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 35px;
|
||||
margin-top: 45px;
|
||||
max-width: 700px;
|
||||
height: 550px;
|
||||
@include box-shadow(0px 4px 8px 0px $color-dove-gray);
|
||||
|
||||
.experiment-description {
|
||||
margin-top:20px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.no-description {
|
||||
color: $color-alto;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
|
||||
a {
|
||||
color: $color-alto;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.no-workflowimg {
|
||||
color: $color-alto;
|
||||
display: block;
|
||||
font-size: 26px;
|
||||
font-weight: bold;
|
||||
height: 300px;
|
||||
margin: 15px 0;
|
||||
padding-top: 150px;
|
||||
text-align: center;
|
||||
|
||||
a {
|
||||
color: $color-alto;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.workflowimg-container {
|
||||
margin: 15px 0;
|
||||
height: 300px;
|
||||
margin: 15px 0;
|
||||
|
||||
img {
|
||||
max-width:100%;
|
||||
max-height: 300px;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* SHOW */
|
||||
// SHOW
|
||||
.center-btn {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
|
@ -452,10 +475,10 @@ li.module-hover {
|
|||
text-align: center;
|
||||
|
||||
&:hover {
|
||||
color:$color-alto;
|
||||
color: $color-alto;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
color:$color-alto;
|
||||
color: $color-alto;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ class ExperimentsController < ApplicationController
|
|||
@experiment.update_attributes(experiment_params)
|
||||
@experiment.last_modified_by = current_user
|
||||
if @experiment.save
|
||||
@experiment.touch(:workflowimg_updated_at)
|
||||
flash[:success] = t('experiments.update.success_flash',
|
||||
experiment: @experiment.name)
|
||||
redirect_to canvas_experiment_path(@experiment)
|
||||
|
|
|
@ -29,7 +29,15 @@
|
|||
>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="workflowimg-container"></div>
|
||||
<div class="no-workflowimg">
|
||||
<% if can_edit_experiment(experiment) %>
|
||||
<p><%= link_to( t('experiments.edit.add_task'),
|
||||
canvas_experiment_path(experiment,
|
||||
editMode: true)) %></p>
|
||||
<% else %>
|
||||
<p><%= t('experiments.edit.no_workflowimg') %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<span>
|
||||
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
|
||||
|
@ -39,13 +47,13 @@
|
|||
<p class="experiment-description"><%= experiment.description %></p>
|
||||
<% else %>
|
||||
<% if can_edit_experiment(experiment) %>
|
||||
<p class="experiment-description"><i class="no-description"><%= link_to t('experiments.edit.add-description'),
|
||||
<p class="experiment-description"><span class="no-description"><%= link_to t('experiments.edit.add-description'),
|
||||
edit_project_experiment_url(@project, experiment),
|
||||
remote: true,
|
||||
data: { id: experiment.id },
|
||||
class: 'no-description-experiment' %></i></p>
|
||||
class: 'no-description-experiment' %></span></p>
|
||||
<% else %>
|
||||
<p class="experiment-description"><i class="no-description"><%= t('experiments.edit.no-description') %></i></p>
|
||||
<p class="experiment-description"><span class="no-description"><%= t('experiments.edit.no-description') %></span></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -606,8 +606,10 @@ en:
|
|||
modal_create: 'Save'
|
||||
label_title: "Edit details"
|
||||
panel_label: 'Change details'
|
||||
add-description: 'Add description'
|
||||
add-description: 'Add description...'
|
||||
no-description: 'No description'
|
||||
no_workflowimg: 'No workflow'
|
||||
add_task: 'Add a task to experiment...'
|
||||
create:
|
||||
success_flash: "Successfully created experiment %{experiment}"
|
||||
error_flash: 'Could not create a new experiment.'
|
||||
|
|
Loading…
Reference in a new issue