use ng-fullcalendar

pull/6827/head
Jens Ulferts 6 years ago
parent 0f2b692202
commit 2d4ebf9428
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 2
      app/controllers/my_projects_overviews_controller.rb
  2. 2
      app/views/my_projects_overviews/_block.html.erb
  3. 26
      app/views/my_projects_overviews/blocks/_calendar.html.erb

@ -64,7 +64,7 @@ class MyProjectsOverviewsController < ApplicationController
def add_block
block = params[:block]
if MyProjectsOverviewsController.available_blocks.keys.include? block
render partial: "block", locals: { block_name: block, editing: true }
render partial: "block", locals: { block_name: block, edit: true }
elsif block == "custom_element"
render_new_custom_block
else

@ -34,7 +34,7 @@ See doc/COPYRIGHT.md for more details.
<% end %>
<div class="handle">
<%= render partial: "my_projects_overviews/blocks/#{block_name}", locals: { block_name_id: block_name_id } %>
<%= render partial: "my_projects_overviews/blocks/#{block_name}", locals: { block_name_id: block_name_id, edit: defined?(edit) ? edit : false } %>
</div>
</div>

@ -25,23 +25,13 @@ See doc/COPYRIGHT.md for more details.
<h3 class="widget-box--header">
<%= op_icon('icon-context icon-calendar') %>
<span class="widget-box--header-title"><%=l(:label_calendar)%></span>
<span class="widget-box--header-title"><%=t(:label_calendar)%></span>
</h3>
<%
calendar = Redmine::Helpers::Calendar.new(Date.today, current_language, :week)
wps = WorkPackage.table_name
calendar.events = WorkPackage.visible
.where(project: current_user.projects)
.where(
"
(#{wps}.start_date >= ? AND #{wps}.start_date <= ?) OR
(#{wps}.due_date >= ? AND #{wps}.due_date <= ?)
",
calendar.startdt, calendar.enddt, calendar.startdt, calendar.enddt
)
.includes(:project, :type, :priority, :assigned_to) unless current_user.projects.empty?
%>
<%= render :partial => 'common/calendar', :locals => {:calendar => calendar } %>
<% if edit %>
<div class="macro -embedded-table ck-widget">
<%= t('js.editor.macro.embedded_calendar.text') %>
</div>
<% else %>
<wp-embedded-calendar></wp-embedded-calendar>
<% end %>

Loading…
Cancel
Save