mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 06:56:54 +08:00
Merge pull request #466 from okriuchykhin/ok_SCI_934
Make sciNote work for users without any teams [SCI_934]
This commit is contained in:
commit
6c28ab0b4c
5 changed files with 14 additions and 5 deletions
|
@ -20,7 +20,7 @@ class ActivitiesController < ApplicationController
|
|||
days_since_1970(DateTime.current + 30.days)
|
||||
|
||||
more_url = url_for(activities_url(format: :json,
|
||||
from: @activities.last.id))
|
||||
from: @activities.last.id)) if @overflown
|
||||
respond_to do |format|
|
||||
format.json {
|
||||
render :json => {
|
||||
|
|
|
@ -37,6 +37,8 @@ class ProjectsController < ApplicationController
|
|||
@projects_by_teams = current_user.projects_by_teams(@current_team_id,
|
||||
@current_sort,
|
||||
@filter_by_archived)
|
||||
else
|
||||
@projects_by_teams = []
|
||||
end
|
||||
|
||||
@teams = current_user.teams
|
||||
|
|
|
@ -860,9 +860,7 @@ class ProtocolsController < ApplicationController
|
|||
def check_view_all_permissions
|
||||
load_team_and_type
|
||||
|
||||
unless can_view_team_protocols(@current_team)
|
||||
render_403
|
||||
end
|
||||
render_403 unless can_view_team_protocols(@current_team)
|
||||
end
|
||||
|
||||
def check_view_permissions
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<%= form.text_field :name, label: t("projects.index.modal_new_project.name"), autofocus: true, placeholder: t("projects.index.modal_new_project.name_placeholder") %>
|
||||
<%= hidden_field :project, :team_id, value: current_team.id %>
|
||||
<%= hidden_field :project, :team_id, value: current_team.id if current_team %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -37,12 +37,21 @@
|
|||
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.projects') %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% if current_team %>
|
||||
<li>
|
||||
<a id="protocol-link" href="<%= protocols_path %>">
|
||||
<span class="glyphicon glyphicon-list-alt"></span>
|
||||
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.protocols') %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="disabled">
|
||||
<a id="protocol-link" href="#">
|
||||
<span class="glyphicon glyphicon-list-alt"></span>
|
||||
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.protocols') %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if false %>
|
||||
<li>
|
||||
<a href="#">
|
||||
|
|
Loading…
Reference in a new issue