mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 15:13:21 +08:00
171 lines
7.5 KiB
Text
171 lines
7.5 KiB
Text
<% provide(:head_title, t("projects.index.head_title")) %>
|
|
|
|
<% if current_team %>
|
|
<%= render partial: "shared/sidebar", locals: { page: 'project' } %>
|
|
<%= render partial: "shared/secondary_navigation" %>
|
|
|
|
<% if can_create_projects?(current_team) %>
|
|
<!-- New project modal -->
|
|
<div class="modal" id="new-project-modal" tabindex="-1" role="dialog" aria-labelledby="new-project-modal-label">
|
|
<%= bootstrap_form_for @project, remote: true do |f| %>
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title" id="new-project-modal-label"><%= t("projects.index.modal_new_project.modal_title") %></h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<%= render partial: "new.html.erb", locals: { form: f, teams: @teams } %>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%=t "general.cancel" %></button>
|
|
<%= f.submit t("projects.index.modal_new_project.create"), class: "btn btn-success help_tooltips",
|
|
data: {
|
|
tooltiplink: I18n.t('tooltips.link.new_project'),
|
|
tooltipcontent: I18n.t('tooltips.text.new_project')
|
|
} %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<!-- Edit project modal -->
|
|
<div class="modal" id="edit-project-modal" tabindex="-1" role="dialog" aria-labelledby="edit-project-modal-label">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title" id="edit-project-modal-label"></h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%=t "general.cancel" %></button>
|
|
<button type="button" class="btn btn-success" data-action="submit"><%=t "projects.index.modal_edit_project.submit" %></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Manage users modal -->
|
|
<div class="modal" id="project-actions-modal" tabindex="-1" role="dialog" aria-labelledby="project-actions-modal-label">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title" id="project-actions-modal-label"></h4>
|
|
</div>
|
|
<div class="modal-body"></div>
|
|
<div class="modal-footer"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Export projects modal -->
|
|
<div class="modal" id="export-projects-modal" tabindex="-1" role="dialog" aria-labelledby="export-projects-modal-label">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title" id="export-projects-modal-label"></h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button id="export-projects-modal-close" type="button" class="btn btn-default" data-dismiss="modal"><%=t "general.close" %></button>
|
|
<button id="export-projects-modal-cancel" type="button" class="btn btn-default" data-dismiss="modal"><%=t "general.cancel" %></button>
|
|
<button id="export-projects-modal-submit"
|
|
type="button"
|
|
class="btn btn-success"
|
|
data-export-projects-submit-url="<%= export_projects_team_path(current_team) %>">
|
|
<%=t "projects.export_projects.modal_submit" %>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content-pane" id="projects-index">
|
|
|
|
<div id="projects-absent" style="display:none">
|
|
<div class="jumbotron text-center" style="margin-top:12%">
|
|
<strong><%=t 'projects.index.no_projects.text' %></strong>
|
|
<% if @teams.exists? && can_create_projects?(current_team) %>
|
|
<h2><strong><%=t 'projects.index.no_projects.title' %></strong></h2>
|
|
<br />
|
|
<a class="btn btn-primary btn-lg new-project-btn">
|
|
<span class="fas fa-plus"></span>
|
|
<span class="hidden-xs"><%= t('projects.index.no_projects.create_new_button') %></span>
|
|
</a>
|
|
<% else %>
|
|
<p><strong><%=t 'projects.index.no_projects.no_permission_title' %></strong></p>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<div id="projects-present" style="display:none">
|
|
<div id="projects-toolbar">
|
|
|
|
<form class="form-inline" action="<%= projects_path %>">
|
|
|
|
<div class="form-group">
|
|
|
|
<% if @teams.exists? && can_create_projects?(current_team) %>
|
|
<!-- new project button -->
|
|
<a class="btn btn-primary new-project-btn">
|
|
<span class="fas fa-plus" aria-hidden="true"></span>
|
|
<span class="hidden-xs"><%=t "projects.index.new" %></span>
|
|
</a>
|
|
<% end %>
|
|
|
|
<!-- project sort -->
|
|
<div class="dropdown">
|
|
<button class="btn btn-default dropdown-toggle" type="button" id="sortMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
|
<span class="hidden-xs"><%= t'projects.index.sort' %></span>
|
|
<span class="visible-xs-inline"><i class="fas fa-sort"></i></span>
|
|
<span class="caret"></span>
|
|
</button>
|
|
<ul id="sortMenuDropdown" class="dropdown-menu" aria-labelledby="sortMenu">
|
|
<% ["new", "old", "atoz", "ztoa"].each do |sort| %>
|
|
<li>
|
|
<% if @current_sort != sort %>
|
|
<a href="#" data-sort="<%= sort %>"><%= t('projects.index.sort_' + sort) %></a>
|
|
<% else %>
|
|
<a class="disabled" href="#" data-sort="<%= sort %>"><%= t('projects.index.sort_' + sort) %></a>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- export projects button -->
|
|
<button type="button" class="btn btn-default pull-right"
|
|
id="export-projects-button"
|
|
data-export-projects-modal-url="<%= export_projects_modal_team_path(current_team) %>"
|
|
disabled>
|
|
<span class="fas fa-file-export"></span>
|
|
<span class="hidden-xs-custom"><%= t("projects.export_projects.export_button") %></span>
|
|
</button>
|
|
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="tab-content">
|
|
<div class="tab-pane active"
|
|
id="projects-cards-view"
|
|
data-projects-url="<%= projects_path %>"
|
|
data-projects-sidebar-url="<%= projects_sidebar_path %>">
|
|
</div>
|
|
<div class="tab-pane" id="projects-table-view">
|
|
<%= render partial: "projects/index/team_projects_table" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<%= javascript_include_tag "projects/index" %>
|