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)
|
days_since_1970(DateTime.current + 30.days)
|
||||||
|
|
||||||
more_url = url_for(activities_url(format: :json,
|
more_url = url_for(activities_url(format: :json,
|
||||||
from: @activities.last.id))
|
from: @activities.last.id)) if @overflown
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json {
|
format.json {
|
||||||
render :json => {
|
render :json => {
|
||||||
|
|
|
@ -37,6 +37,8 @@ class ProjectsController < ApplicationController
|
||||||
@projects_by_teams = current_user.projects_by_teams(@current_team_id,
|
@projects_by_teams = current_user.projects_by_teams(@current_team_id,
|
||||||
@current_sort,
|
@current_sort,
|
||||||
@filter_by_archived)
|
@filter_by_archived)
|
||||||
|
else
|
||||||
|
@projects_by_teams = []
|
||||||
end
|
end
|
||||||
|
|
||||||
@teams = current_user.teams
|
@teams = current_user.teams
|
||||||
|
|
|
@ -860,9 +860,7 @@ class ProtocolsController < ApplicationController
|
||||||
def check_view_all_permissions
|
def check_view_all_permissions
|
||||||
load_team_and_type
|
load_team_and_type
|
||||||
|
|
||||||
unless can_view_team_protocols(@current_team)
|
render_403 unless can_view_team_protocols(@current_team)
|
||||||
render_403
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_view_permissions
|
def check_view_permissions
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
<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") %>
|
<%= 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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,21 @@
|
||||||
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.projects') %></span>
|
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.projects') %></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<% if current_team %>
|
||||||
<li>
|
<li>
|
||||||
<a id="protocol-link" href="<%= protocols_path %>">
|
<a id="protocol-link" href="<%= protocols_path %>">
|
||||||
<span class="glyphicon glyphicon-list-alt"></span>
|
<span class="glyphicon glyphicon-list-alt"></span>
|
||||||
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.protocols') %></span>
|
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.protocols') %></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</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 %>
|
<% if false %>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">
|
<a href="#">
|
||||||
|
|
Loading…
Reference in a new issue