Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 633 - Remove dependency of portal_calendar tool #653

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rodfersou
Copy link
Member

closes #633


def getEventTypes(self):
types = self.calendar.getCalendarTypes()
return ''.join(map(lambda x: 'Type={0}&'.format(self.url_quote_plus(x)), types))
return 'Type=Event&'
Copy link
Member

@hvelarde hvelarde Aug 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou do not hard-code this neither; create a getCalendarTypes() method for both cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hvelarde I didn't finish the changes. My first step is to remove portal_calendar, after I'll refactor the code and these methods will be removed.

@rodfersou rodfersou force-pushed the issue_633 branch 8 times, most recently from ade5431 to 00741ca Compare August 19, 2016 14:17
start = DateTime(self.year, self.month, day['day'])
end = start + 1
query = dict(
portal_type='Event', review_state='published',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou as mentioned before, this can't be hard coded: the query must search for all contenty types providing the IEvent interface.

day['eventstring'] = '\n'.join(localized_date + [
' {0}'.format(self.getEventString(e)) for e in day['eventslist']])
day['date_string'] = '{0}-{1}-{2}'.format(year, month, daynumber)
def addEvents(self, day):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou please add a doc string.

@@ -169,11 +187,13 @@ def isToday(self, day):
self.now[2] == day and self.now[1] == self.month and self.now[0] == self.year)

def getReviewStateString(self):
states = self.calendar.getCalendarStates()
states = ['published']
return ''.join(map(lambda x: 'review_state={0}&'.format(self.url_quote_plus(x)), states))

def getEventTypes(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou this method must be memoized now.

@rodfersou rodfersou force-pushed the issue_633 branch 2 times, most recently from dff29f0 to 93fd065 Compare August 22, 2016 12:58
rodfersou and others added 4 commits August 22, 2016 09:58
Code simplification by using the calendar portlet as a helper view; we need to generalize this approach.
@rodfersou rodfersou force-pushed the issue_633 branch 2 times, most recently from 2ffebf0 to bad27b5 Compare August 23, 2016 14:24
$('body').undelegate('#calendar-next, #calendar-previous', 'click')
.delegate(
'.portletWrapper #calendar-next, ' +
'.portletWrapper #calendar-previous',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this override, I just set the selector to target just portlets with the .portletWrapper class (maybe we should create a PR for plone.app.portlets package)

Copy link
Member

@hvelarde hvelarde Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou maybe you can avoid that using a different selector.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hvelarde the problem here is that I am getting the html from the portlet without change, this has the benefit to don't have to maintain this code, but the javascript from this portlet has this problem, the selector to refresh portlet is looking out of the portlet too. It would be no problem if there were a <div> with class .portletWrapper and the portlet id as data attribute to make it work with the original javascript of the portlet, but we don't have it.

@rodfersou rodfersou force-pushed the issue_633 branch 2 times, most recently from abd7644 to 20a4ee2 Compare August 24, 2016 18:53
@@ -249,30 +249,23 @@ table.invisible
}

/* Tile Calendar */
.cover-calendar-tile .calendar-tile-header
.cover-calendar-tile .portletCalendar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou I think this is a bad idea.

@agnogueira comments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hvelarde I don't understand your concern here with this css code.. this selector is restrict to our calendar tile because of the .cover-calendar-tile class. It will not affect the portlet calendar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar tile does not work under Plone 5
2 participants