Make sciNote work for users without any teams [SCI_934]

This commit is contained in:
Oleksii Kriuchykhin 2017-01-30 16:54:22 +01:00
parent 5c9954bb89
commit c119b7c014
4 changed files with 6 additions and 3 deletions

View file

@ -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 => {

View file

@ -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

View file

@ -860,7 +860,8 @@ class ProtocolsController < ApplicationController
def check_view_all_permissions
load_team_and_type
unless can_view_team_protocols(@current_team)
if @current_team &&
!can_view_organization_protocols(@current_organization)
render_403
end
end

View file

@ -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>