2016-02-12 23:52:43 +08:00
|
|
|
|
2019-12-01 03:04:28 +08:00
|
|
|
<% provide(:head_title, t("projects.index.head_title")) %>
|
2020-03-13 22:04:56 +08:00
|
|
|
|
2018-05-25 23:14:22 +08:00
|
|
|
<% if current_team %>
|
2018-11-29 18:28:36 +08:00
|
|
|
<%= render partial: "shared/sidebar", locals: { page: 'project' } %>
|
2018-05-25 23:14:22 +08:00
|
|
|
<%= render partial: "shared/secondary_navigation" %>
|
|
|
|
|
2020-03-13 22:04:56 +08:00
|
|
|
<span style="display: none;" data-hook="projects-index-html"></span>
|
|
|
|
|
2018-06-06 23:23:22 +08:00
|
|
|
<% 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">
|
2020-01-07 23:13:34 +08:00
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%=t "general.cancel" %></button>
|
2020-04-28 18:30:43 +08:00
|
|
|
<%= f.submit t("projects.index.modal_new_project.create"), class: "btn btn-primary" %>
|
2018-05-25 23:14:22 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-06 23:23:22 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2018-11-14 18:33:27 +08:00
|
|
|
<!-- 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">
|
2020-01-07 23:13:34 +08:00
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%=t "general.cancel" %></button>
|
|
|
|
<button type="button" class="btn btn-primary" data-action="submit"><%=t "projects.index.modal_edit_project.submit" %></button>
|
2018-11-14 18:33:27 +08:00
|
|
|
</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">
|
2020-01-07 23:13:34 +08:00
|
|
|
<button id="export-projects-modal-close" type="button" class="btn btn-secondary" data-dismiss="modal"><%=t "general.close" %></button>
|
|
|
|
<button id="export-projects-modal-cancel" type="button" class="btn btn-secondary" data-dismiss="modal"><%=t "general.cancel" %></button>
|
2018-11-15 22:53:58 +08:00
|
|
|
<button id="export-projects-modal-submit"
|
|
|
|
type="button"
|
2020-01-07 23:13:34 +08:00
|
|
|
class="btn btn-primary"
|
2018-11-15 22:53:58 +08:00
|
|
|
data-export-projects-submit-url="<%= export_projects_team_path(current_team) %>">
|
|
|
|
<%=t "projects.export_projects.modal_submit" %>
|
|
|
|
</button>
|
2018-11-14 18:33:27 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2018-06-06 23:23:22 +08:00
|
|
|
<div class="content-pane" id="projects-index">
|
|
|
|
|
2018-11-07 20:45:46 +08:00
|
|
|
<div id="projects-absent" style="display:none">
|
2018-06-06 23:23:22 +08:00
|
|
|
<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) %>
|
2018-11-14 18:33:27 +08:00
|
|
|
<h2><strong><%=t 'projects.index.no_projects.title' %></strong></h2>
|
2018-06-06 23:23:22 +08:00
|
|
|
<br />
|
2020-01-07 23:13:34 +08:00
|
|
|
<a class="btn btn-primary new-project-btn">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-plus"></span>
|
2018-06-06 23:23:22 +08:00
|
|
|
<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>
|
2018-05-25 23:14:22 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2018-10-24 09:34:13 +08:00
|
|
|
</div>
|
2018-11-07 20:45:46 +08:00
|
|
|
<div id="projects-present" style="display:none">
|
2018-06-06 23:23:22 +08:00
|
|
|
<div id="projects-toolbar">
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2018-06-06 23:23:22 +08:00
|
|
|
<form class="form-inline" action="<%= projects_path %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2018-06-06 23:23:22 +08:00
|
|
|
<div class="form-group">
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2018-06-06 23:23:22 +08:00
|
|
|
<% if @teams.exists? && can_create_projects?(current_team) %>
|
|
|
|
<!-- new project button -->
|
2020-01-07 23:13:34 +08:00
|
|
|
<a class="btn btn-primary new-project-btn">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-plus" aria-hidden="true"></span>
|
2018-06-06 23:23:22 +08:00
|
|
|
<span class="hidden-xs"><%=t "projects.index.new" %></span>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2018-06-06 23:23:22 +08:00
|
|
|
<!-- project sort -->
|
|
|
|
<div class="dropdown">
|
2020-01-07 23:13:34 +08:00
|
|
|
<button class="btn btn-light dropdown-toggle" type="button" id="sortMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
2019-09-16 20:43:12 +08:00
|
|
|
<span><%= t("general.sort.#{@current_sort}_html") %></span>
|
2018-06-06 23:23:22 +08:00
|
|
|
<span class="caret"></span>
|
|
|
|
</button>
|
2018-09-27 16:43:44 +08:00
|
|
|
<ul id="sortMenuDropdown" class="dropdown-menu" aria-labelledby="sortMenu">
|
2018-06-06 23:23:22 +08:00
|
|
|
<% ["new", "old", "atoz", "ztoa"].each do |sort| %>
|
2018-10-10 22:11:52 +08:00
|
|
|
<li>
|
|
|
|
<% if @current_sort != sort %>
|
2019-09-16 20:43:12 +08:00
|
|
|
<a href="#" data-sort="<%= sort %>"><%= t("general.sort.#{sort}_html") %></a>
|
2018-10-10 22:11:52 +08:00
|
|
|
<% else %>
|
2019-09-16 20:43:12 +08:00
|
|
|
<a class="disabled" href="#" data-sort="<%= sort %>"><%= t("general.sort.#{sort}_html") %></a>
|
2018-10-10 22:11:52 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
2018-05-25 23:14:22 +08:00
|
|
|
<% end %>
|
2018-06-06 23:23:22 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2018-10-12 04:55:35 +08:00
|
|
|
<!-- export projects button -->
|
2020-01-07 23:13:34 +08:00
|
|
|
<button type="button" class="btn btn-secondary pull-right"
|
2018-10-12 04:55:35 +08:00
|
|
|
id="export-projects-button"
|
2018-11-15 22:53:58 +08:00
|
|
|
data-export-projects-modal-url="<%= export_projects_modal_team_path(current_team) %>"
|
2018-11-12 22:51:03 +08:00
|
|
|
disabled>
|
2018-10-12 04:55:35 +08:00
|
|
|
<span class="fas fa-file-export"></span>
|
|
|
|
<span class="hidden-xs-custom"><%= t("projects.export_projects.export_button") %></span>
|
|
|
|
</button>
|
|
|
|
|
2018-05-25 23:14:22 +08:00
|
|
|
</div>
|
2018-06-06 23:23:22 +08:00
|
|
|
</form>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2018-09-27 16:43:44 +08:00
|
|
|
<div class="tab-content">
|
2018-11-29 21:20:20 +08:00
|
|
|
<div class="tab-pane active"
|
|
|
|
id="projects-cards-view"
|
|
|
|
data-projects-url="<%= projects_path %>"
|
|
|
|
data-projects-sidebar-url="<%= projects_sidebar_path %>">
|
|
|
|
</div>
|
2018-10-01 21:39:42 +08:00
|
|
|
<div class="tab-pane" id="projects-table-view">
|
|
|
|
<%= render partial: "projects/index/team_projects_table" %>
|
|
|
|
</div>
|
2018-09-27 16:43:44 +08:00
|
|
|
</div>
|
2018-10-24 09:34:13 +08:00
|
|
|
</div>
|
2016-10-21 15:06:19 +08:00
|
|
|
|
2018-05-25 23:14:22 +08:00
|
|
|
</div>
|
2018-06-06 23:23:22 +08:00
|
|
|
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2018-05-08 22:33:42 +08:00
|
|
|
|
2018-07-19 23:56:42 +08:00
|
|
|
<%= javascript_include_tag "projects/index" %>
|