Package: aa-opcalendar
Operation CalendarAn operation calendar app for Alliance Auth to display fleet operations and other events.Includes:Calendar type view of different eventsManual eventsUser createdDefailed viewIcal feed for exporting eventsPublic NPSI eventsAutomatic syncing with supported NPSI community events over APIsIngame eventsAutomatic syncing with ingame eventsPersonal, Corporation and Alliance calendarsSupportsstructure timersSupportsaa-moonminingSupportsaa-discordbotEvent visibility optionsCustom names and colorsRestrict to groupsRestrict to statesWebhook for sending event notificationsFilter to include in ical feedEvent categoriesCustom namesCustom tickersCustom colorsPre-fill text to add on events with the categoryMultihost supportDiscord notificationsWebhookFor: new, edited and deleted eventsDark and white themesaa-moonmining supportaa-structuretimers supportCustom event visibility filters and categoriesdetails for manual eventsSupports importing public NPSI events right into opcalendarPull ingame events from personal, corporation and allianceDiscord feed based on visibility filterSupports aa-discordbot to fetch events over discordInstallationInstall the Repopip install aa-opcalendarAdd'opcalendar',to yourINSTALLED_APPSin your projectslocal.pyRun migrationspython manage.py migrateCollect static filespython manage.py collectstaticRestart supervisorsupervisorctl reload myauth:Setup permissionsPermissionsPermAuth SiteExample Target Groupopcalendar basic_accessCan access this app and see operations based on visibility rulesEveryoneopcalendar create_eventCan create and edit eventsLeadership, FCsopcalendar manage_eventCan delete and manage signupsLeadership, FCsopcalendar see_signupsCan see all signups for eventLeadership, FCs, MembersSettingsNameDescriptionDefaultOPCALENDAR_NOTIFY_IMPORTSWheter to send out discord notifications for ingame and public NPSI eventsTrueOPCALENDAR_DISPLAY_STRUCTURETIMERSwhether we should inculde timers from the structuretimers plugin in the calendar. Inherits view permissions from aa-structuretimersTrueOPCALENDAR_DISPLAY_MOONMININGwhether we should inculde extractions from the aa-moonmining plugin in the calendar. Inherits view permissions from aa-moonminingTrueOPCALENDAR_DISCORD_OPS_DISPLAY_EXTERNALwhether we display external hosts such as ingame hosts in the discord ops command filtersFalseOPCALENDAR_DISPLAY_MOONMINING_TAGSDisplay the rarity tag of aa-moonmining moons if the moonmining plugin is installedTrueOPCALENDAR_DISPLAY_MOONMINING_ARRIVAL_TIMEDisplays aa-moonmining extraction time based on arrival time. Set to False to display as auto fracture timeTrueSetupBefore you are able to create new events on the front end you will need to setup the needed categories and visibility filters for your events.1. HostHosts are for identifying reasons. If you run a single corporation or alliance entity you most likely only want one host. If you want to extend the calendar with other hosts such as NPSI communities you can create a host for each different entity.Host name is shown on the event and on discord notificationsYou can customize host logosGo to the admin site2. Visibility filterThese filters will determine who is able to see the events that are labeled with each different visibility filter.Can be restricted to groups and statesIf no groups or states are selected the events will be visible for everyoneYou can determine a custom color tag that will be shown on the top right corner of the eventEach visibility filter will be displayed on the calendar and can be used for filtering events on the calendarDiscord notification webhooks can be assigned for each visibility filter. Events created, deleted or edited under this filter will then be sent over to discord.3. CategoriesCategories are displayed as a ticker infront of manually created events. Most common categories are: PvP, Stratop, Mining, CTA etc...Ticker displayed on eventCustom colors4. Discord webhookIf you want to receive notifications about your events (created/modified/deleted) on your discord you can add a webhook for the channel in discord you want to receive the notifications to. The webhooks you create will be used in the visibility filters.Adding manual eventsTo add a manual event simply go to the calendar page and press on the new event button. Fill in and select the needed information.Importing NPSI fleetsOpcalendar has  the ability to import predetermined NPSI fleets directly into your calendar from public NPSI community APIs.Supported NPSI communitiesOpcalendar is currently supporting imports for the following NPSI fleets:EVE LinkNetSpectre FleetEVE University (classes)Fun Inc.FRIDAY YARRRRRedemption RoadCASFwaming DwagonsFREE RANGE CHIKUNSSetupGo to admin panel and select NPSI Event ImportsCreate a hostfor each import and fill in the needed details for them.Add a new importby pressing on the add event import buttonSelect the sourcewhere you want to fetch the fleets.Determine operation typefor each fetched fleet.Determine operation visibilityfor each fetched fleet.To schedule the import runs either add the following line in your local.py file or set up a perioduc task for theopcalendar.tasks.import_all_npsi_fleetstask on your admin menu to fetch fleets every hour.CELERYBEAT_SCHEDULE['import_all_npsi_fleets'] = {
    'task': 'opcalendar.tasks.import_all_npsi_fleets',
    'schedule': crontab(minute=0, hour='*'),
}Importing fleets from ingame calendarYou can import events that have been created in the ingame calendar. As the fields on the ingame calendar are limited the events will not be as detailed as when created directly from the calendar.Give theadd_ingame_calendar_ownerrole for the wanter groupsNavigate to the opcalendar page and press theAdd Ingame Calendar FeedbuttonLog in with the character that holds the calendarAdd the following line into your local.py setting file or set up a periodic task for theopcalendar.tasks.update_all_ingame_eventsto pull fleets from ingame every 5 minutes.CELERYBEAT_SCHEDULE['update_all_ingame_events'] = {
    'task': 'opcalendar.tasks.update_all_ingame_events',
    'schedule': crontab(minute='*/5'),
}Ingame event visibility and categoriesOn default the ingame events you import have no visibility filter and no category. This means theywill be visible for everyone.If you wish to add a visibility filter or a category similar to the manual events simply go to theadmin panel -> Ingame event ownersand select a filter and a category for the owner.After selecing a visibility filter and a category the ingame events will behave similar to the manual events and respect the group and state restrictions set for the visibility filters.Ical feed setup (optional)Opcalendar has the ability to generate a standard ical formated feed for pushing out events. To push out evets to the feed without login requirement requires editing the allianceauth url file as on default all pages are locked behind a login requirement.Feed setupOpen up the event visibility category and check the box to include it in the ical feed.Open the alliance authurls.pyfile that is located on default in the following path/home/allianceserver/myauth/myauth/urls.pyOn default the file looks something like this:from django.conf.urls import include, url
from allianceauth import urls

urlpatterns = [
    url(r'', include(urls)),
]

handler500 = 'allianceauth.views.Generic500Redirect'
handler404 = 'allianceauth.views.Generic404Redirect'
handler403 = 'allianceauth.views.Generic403Redirect'
handler400 = 'allianceauth.views.Generic400Redirect'Include the following 2 lines in the file:from opcalendar.views import EventFeed #Added import for opcalendar ical feedbellow the imports on top of the fileurl(r'^opcalendar/feed.ics', EventFeed()), #Opcalendar feed urlin theurlpatternsbeforetheurl(r'', include(urls)),line
Your fileurls.pyfile should now look like this:from django.conf.urls import include, url
from allianceauth import urls
from opcalendar.views import EventFeed #Added import for opcalendar ical feed

urlpatterns = [
    url(r'^opcalendar/feed.ics', EventFeed()), #Opcalendar feed url
    url(r'', include(urls)),
]

handler500 = 'allianceauth.views.Generic500Redirect'
handler404 = 'allianceauth.views.Generic404Redirect'
handler403 = 'allianceauth.views.Generic403Redirect'
handler400 = 'allianceauth.views.Generic400Redirect'You can now access the ical feed atauth.example.com/opcalendar/feed.icsContributingMake sure you have signed theLicense Agreementby logging in athttps://developers.eveonline.combefore submitting any pull requests. All bug fixes or features must not include extra superfluous formatting changes.