Merge pull request #722 from mlorb/ml-sci-1396

Fix bugs on projects page [SCI-1396]
This commit is contained in:
mlorb 2017-07-03 15:37:16 +02:00 committed by GitHub
commit 1b2884c1b7
7 changed files with 14 additions and 14 deletions

View file

@ -60,7 +60,6 @@ function initFormSubmitLinks(el) {
}
/* Enable loading bars */
Turbolinks.enableProgressBar();
$(document)
.bind("ajaxSend", function(){
animateLoading();

View file

@ -18,6 +18,7 @@
<li>
<a href="#"
data-action="edit-comment"
data-remote="true"
data-url="<%= edit_project_project_comment_path(comment.project, comment, format: :json) %>">
<%= t('comments.options_dropdown.edit') %>
</a>

View file

@ -45,7 +45,7 @@
</div>
<div>
<div class="col-xs-12">
<%= link_to t("projects.index.back_to_projects_index"), projects_path %>
<%= link_to t("projects.index.back_to_projects_index"), projects_path, data: { turbolinks: 'false' } %>
</div>
</div>
<% end %>

View file

@ -59,7 +59,7 @@
<div class="form-group">
<!-- project archive button -->
<a class="btn btn-default pull-right" href="<%= url_for projects_archive_path %>" id="project-archive-btn" title="">
<a class="btn btn-default pull-right" href="<%= url_for projects_archive_path %>" id="project-archive-btn" data-turbolinks="false" title="">
<span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>
</a>

View file

@ -100,7 +100,7 @@
</li>
<% end %>
<% if can_view_project_archive(@project) then %>
<li id="project-archive-nav-tab" class="<%= "active" if is_project_archive? %>">
<li id="project-archive-nav-tab" data-turbolinks="false" class="<%= "active" if is_project_archive? %>">
<a href="<%= experiment_archive_project_url(@project) %>"><span class="glyphicon glyphicon-briefcase"></span></a>
</li>
<% end %>
@ -135,7 +135,7 @@
</li>
<% end %>
<% if can_view_experiment_archive(@experiment) then %>
<li id="project-archive-nav-tab" class="<%= "active" if is_experiment_archive? %>">
<li id="project-archive-nav-tab" data-turbolinks="false" class="<%= "active" if is_experiment_archive? %>">
<a href="<%= module_archive_experiment_url(@experiment) %>"><span class="glyphicon glyphicon-briefcase"></span></a>
</li>
<% end %>
@ -211,7 +211,7 @@
</li>
<% end %>
<% if can_view_module_archive(@my_module) then %>
<li id="archive-nav-tab" class="<%= "active" if is_module_archive? %>">
<li id="archive-nav-tab" data-turbolinks="false" class="<%= "active" if is_module_archive? %>">
<a href="<%= archive_my_module_url(@my_module) %>">
<span class="glyphicon glyphicon-briefcase" title="<%= t'nav2.modules.archive' %>"></span></a>
</li>

View file

@ -4,7 +4,7 @@
<% if @users.size == 0 then %>
<li><em><%= t 'projects.index.no_users' %></em></li>
<% else %>
<% @users.each_index do |i| user = @users[i].user %>
<% @users.each_with_index do |user_proj, i| user = user_proj.user %>
<li>
<% if i > 0 %><hr><% end %>
<div class="row">
@ -13,9 +13,9 @@
</div>
<div class="col-xs-10">
<span><%= user.full_name %></span>
<br><span class="text-muted"><%= t('user_projects.enums.role.'<<@users[i].role.to_s) %></span>
<br><span class="text-muted"><%= t('user_projects.enums.role.'<< user_proj.role.to_s) %></span>
</div>
</div>
</div>
</li>
<% end %>
<% end %>

View file

@ -3,7 +3,7 @@
<% if @users.size == 0 then %>
<li><em><%= t 'projects.index.modal_manage_users.no_users' %></em></li>
<% else %>
<% @users.each_index do |i| user = @users[i].user %>
<% @users.each_with_index do |user_proj, i| user = user_proj.user %>
<li>
<% if i > 0 %><hr><% end %>
<div class="row">
@ -14,15 +14,15 @@
<div class="col-xs-10 col-sm-4">
<span><%= user.full_name %></span>
<br><span class="text-muted"><%= t('user_projects.enums.role.'<<@users[i].role) %></span>
<br><span class="text-muted"><%= t('user_projects.enums.role.'<< user_proj.role) %></span>
</div>
<% unless user.id == current_user.id %>
<div class="visible-xs">&nbsp;</div>
<div class="col-xs-7 col-xs-offset-2 col-sm-4 col-sm-offset-0">
<%= form_for @up, url: project_user_project_path(@project, @users[i].id, method: :put, format: :json), format: :json, method: 'put', remote: true, html: { class: 'update-user-form' } do |f| %>
<%= form_for @up, url: project_user_project_path(@project, user_proj.id, method: :put, format: :json), format: :json, method: 'put', remote: true, html: { class: 'update-user-form' } do |f| %>
<% # TODO replace with form helper %>
<input type="hidden" name="user_project[user_id]" value="<%= @users[i].id %>">
<input type="hidden" name="user_project[user_id]" value="<%= user_proj.id %>">
<% # TODO replace hardcoded select html with rails helper %>
<select class="selectpicker" name="user_project[role]">
<option value=""><%= t('user_projects.edit.update_role') %></option>
@ -34,7 +34,7 @@
<% end %>
</div>
<div class="col-xs-3 col-sm-2">
<%= link_to project_user_project_path(@project, @users[i], format: :json), method: :delete, remote: true, class: 'btn btn-link remove-user-link' do %>
<%= link_to project_user_project_path(@project, user_proj, format: :json), method: :delete, remote: true, class: 'btn btn-link remove-user-link' do %>
<span class="glyphicon glyphicon-remove"></span>
<% end %>
</div>