Change from Daily to Monthly

Asked by James Moore

Hi
I been able to customise the look and feel of Schooltool to fit our school's logo and colors;( www.lauerateschool.org). It would be extremely helpful to have the opening page show the monthly calendar , not the daily calendar.

I have traced the TAL block to \usr\share\pyshare\schootool\calendar\browser\templates\calendar_tertiary_nav.pt

    <tal:block repeat="mode view/modes">
      <li tal:attributes="class mode/class">
        <a tal:attributes="href mode/url"
           tal:content="mode/title">Daily/a>
      </li>
    </tal:block>

How do I get the monthly's <li class="calendar-current">... </li> set as a default.

Is it set in zope?
i am stuck please help

Jim Moore

head weed picker and IT guy

Question information

Language:
English Edit question
Status:
Solved
For:
SchoolTool Edit question
Assignee:
No assignee Edit question
Solved by:
James Moore
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Tom Hoffman (tom-hoffman) said :
#1

You are very persistent, Jim. I'll get an answer for you.

Revision history for this message
James Moore (n41076jem-2) said :
#2

Tom

Now I feel bad.

Jim

Revision history for this message
Tom Hoffman (tom-hoffman) said :
#3

No... I feel bad for making you work so hard! You're not the only one who would like these things to be more flexible.

Revision history for this message
Douglas Cerna (replaceafill) said :
#4

James:

The file you need to edit is /usr/share/pyshared/schooltool/basicperson/browser/flourish.zcml

In this directive (around line 789) :

  <flourish:viewlet
      name="calendar"
      after="home"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      class=".person.UserLinkViewlet"
      title="Calendar"
      link="calendar"
      permission="schooltool.view"
      />

you need to modify the link attribute to have /montly.html at the end:

  <flourish:viewlet
      name="calendar"
      after="home"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      class=".person.UserLinkViewlet"
      title="Calendar"
      link="calendar/monthly.html"
      permission="schooltool.view"
      />

I think that'll get you what you need. Let me know if it works.

Revision history for this message
James Moore (n41076jem-2) said :
#5

I made the change in
/usr/share/pyshared/schooltool/basicperson/browser/flourish.zcml

<flourish:viewlet
      name="calendar"
      after="home"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      class=".person.UserLinkViewlet"
      title="Calendar"
      link="calendar/monthly.html "
      permission="schooltool.view"
      />

It did not change my default page. I still open to "Daily"

Thanks for trying

Jim

Revision history for this message
Douglas Cerna (replaceafill) said :
#6

Oh, I'm sorry. I forgot to tell you to restart your service:

$ sudo service schooltool restart

for SchoolTool to pick up the change.

Revision history for this message
James Moore (n41076jem-2) said :
#7

Nice getting there . I default to monthly after a user logon in. Would it be possible to have the opening page default to monthly, without anyone log in?

Jim

Revision history for this message
Douglas Cerna (replaceafill) said :
#8

You can edit /usr/share/pyshared/schooltool/app/browser/app.py. In line 94, just before the "else", insert a new line like this:

url += '/monthly.html'

This is in the ApplicationView.update method. It should look like this: http://pastebin.com/7h1e5B60

After making the change you'll need to restart the service again.

Revision history for this message
James Moore (n41076jem-2) said :
#9

T H A N K Y O U !

It was exactly what I was looking for, now I can getting back to weeding the soccer field.

Jim