diff --git a/internal/server/http/public/images/usage.png b/internal/server/http/public/images/usage-internal.png similarity index 100% rename from internal/server/http/public/images/usage.png rename to internal/server/http/public/images/usage-internal.png diff --git a/internal/server/http/public/images/usage@2x.png b/internal/server/http/public/images/usage-internal@2x.png similarity index 100% rename from internal/server/http/public/images/usage@2x.png rename to internal/server/http/public/images/usage-internal@2x.png diff --git a/internal/server/http/public/images/usage-public.png b/internal/server/http/public/images/usage-public.png new file mode 100644 index 0000000..1cf2cc6 Binary files /dev/null and b/internal/server/http/public/images/usage-public.png differ diff --git a/internal/server/http/public/images/usage-public@2x.png b/internal/server/http/public/images/usage-public@2x.png new file mode 100644 index 0000000..e4237c6 Binary files /dev/null and b/internal/server/http/public/images/usage-public@2x.png differ diff --git a/internal/server/http/server.go b/internal/server/http/server.go index 37c57d6..00ad14b 100644 --- a/internal/server/http/server.go +++ b/internal/server/http/server.go @@ -36,6 +36,9 @@ func (s *HttpServer) Setup(cfg *config.Config) { c.Locals("branding_thanks_message", cfg.Branding.ThanksMessage) c.Locals("branding_footer_extra", cfg.Branding.FooterExtraMessage) c.Locals("calendar_cache_time", cfg.Routes.Calendar.CacheExpiration.String()) + c.Locals("notion_integration_type", cfg.Notion.IntegrationType) + c.Locals("notion_oauth_id", cfg.Notion.OAuthID) + c.Locals("notion_oauth_secret", cfg.Notion.OAuthSecret) return c.Next() }). Use(recover.New()). diff --git a/internal/server/http/views/auth_internal.django b/internal/server/http/views/auth_internal.django new file mode 100644 index 0000000..e4f8864 --- /dev/null +++ b/internal/server/http/views/auth_internal.django @@ -0,0 +1,26 @@ +

1.

+ +

+ Give access to Notion2iCal to your Notion database by using the Share button + on the top right of your database and searching for Notion2iCal. Only read permissions + are required. +

+ +

+ +

+ +

2.

+ +
+

+ + +

+ +

3.

+ {% if error %} +

ERROR: {{ error }}

+ {% endif %} + +
diff --git a/internal/server/http/views/auth_public.django b/internal/server/http/views/auth_public.django new file mode 100644 index 0000000..73c44e4 --- /dev/null +++ b/internal/server/http/views/auth_public.django @@ -0,0 +1,10 @@ +

1.

+

First, you need to authenticate youself with Notion2iCal, you will authorize the application within your workspace and then you will select to which databases Notion2iCal can read individually.

+

+

+ + + + + +
diff --git a/internal/server/http/views/index.django b/internal/server/http/views/index.django index cd175b0..e63d2b8 100644 --- a/internal/server/http/views/index.django +++ b/internal/server/http/views/index.django @@ -6,27 +6,10 @@ Online tool to convert a Notion database into an iCalendar subscription URL or downloadable ICS file.

How it works

-

1.

-

- Give access to Notion2iCal to your Notion database by using the Share button - on the top right of your database and searching for Notion2iCal. Only read permissions - are required. -

-

- -

-
-

2.

-

- - -

- -

3.

- {% if error %} -

ERROR: {{ error }}

- {% endif %} - -
+ {% if notion_integration_type == "internal" %} + {% include "auth_internal.django" %} + {% else %} + {% include "auth_public.django" %} + {% endif %} {% endblock %}