Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app/issues/687
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanminutillo committed Aug 28, 2023
1 parent d6613b6 commit fef26c5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
37 changes: 25 additions & 12 deletions lib/components/settings/instance/config/instance_config_live.sface
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<div class="pb-6">
{#if Bonfire.Boundaries.can?(@__context__, :configure, :instance)}
<div class="!mt-8 m-3 text-xs font-medium tracking-wide uppercase text-base-content/70">{l("Appearance")}</div>

<div class="m-3 divide-y rounded-lg bg-base-content/5 divide-base-300">
{#if Bonfire.Me.Users.is_admin?(@current_user) ||
Bonfire.Boundaries.can?(@__context__, :describe, :instance)}
<!-- <div class="p-4 m-2 bg-info/10 border-info/30 border text-info rounded flex flex-col">
<div class="font-bold">{l("Appeareance")}</div>
<div class="text-info/70 text-sm">{l "Customise the general look and feel of the instance"}</div>
</div> -->

<div class="divide-y divide-base-content/10 border-b border-base-content/10">
<div x-data="{open: false}" class="p-4">
<div x-on:click="open = !open" class="flex items-center justify-between">
<div class="flex flex-col gap-1">
Expand All @@ -20,7 +25,7 @@
<form name="settings" phx-submit="Bonfire.Me.Settings:save">
<input name="scope" value={:instance} type="hidden">

<div class="w-full mt-6 form-control">
<div class="w-full mt-4 form-control">
<label for="instance_name" class="label">
<span class="label-text text-base-content/70">{l("The name of your instance")}</span>
</label>
Expand All @@ -41,7 +46,7 @@
</div>
</div>

<div class="w-full max-w-lg mt-2 form-control">
<div class="w-full form-control">
<label for="instance_description" class="label">
<span class="label-text text-base-content/70">{l("A short summary shown in various places")}</span>
</label>
Expand Down Expand Up @@ -84,8 +89,8 @@
<div class="mt-1 sm:mt-0 sm:col-span-2">
<Bonfire.Files.Web.UploadIconLive
id={:upload_icon}
container_class="relative flex-shrink-0 block w-8 h-8 overflow-hidden"
class="inline-block overflow-hidden w-8 h-8"
container_class="relative flex-shrink-0 block w-12 h-12 overflow-hidden"
class="inline-block overflow-hidden w-12 h-12"
label_on_hover={false}
label={l("icon")}
object={:instance}
Expand All @@ -102,7 +107,7 @@
</div>
</div>

<div class="w-full max-w-lg mt-2 form-control">
<div class="w-full max-w-lg mt-4 form-control">
<div class="mt-1 sm:mt-0 sm:col-span-2">
<Bonfire.Files.Web.UploadBannerLive
id={:upload_banner}
Expand Down Expand Up @@ -214,8 +219,8 @@
<form phx-change="Bonfire.Me.Settings:set">
<input name="scope" value={:instance} type="hidden">

<div class="!mt-8 m-3 text-xs tracking-wide uppercase text-base-content/70 font-medium">{l("Instance behaviour")}</div>
<div class="m-3 divide-y rounded-lg bg-base-content/5 divide-base-300">
<!-- <div class="!mt-8 m-3 text-xs tracking-wide uppercase text-base-content/70 font-medium">{l("Instance behaviour")}</div> -->
<div class="divide-y divide-base-content/10">
<div class="p-4">
<div class="flex items-center justify-between">
<div class="flex flex-col gap-1">
Expand All @@ -233,6 +238,14 @@
</div>
</div>

<Bonfire.UI.Common.Settings.NumberLive
scope={:instance}
name={l("Maximum number of users per account")}
keys={[Bonfire.UI.Me.SwitchUserViewLive.AccountUsersLive, :max_users]}
unit={l("users")}
default_value={4}
/>

<Bonfire.UI.Common.Settings.NumberLive
scope={:instance}
name={l("Maximum length of text inputs (e.g. posts)")}
Expand Down Expand Up @@ -444,11 +457,11 @@ class="flex items-center justify-between cursor-pointer">
</div>
</form>

<div class="!mt-8 m-3 text-xs tracking-wide uppercase text-base-content/70 font-medium">{l("Advanced settings")}</div>
<!-- <div class="!mt-8 m-3 text-xs tracking-wide uppercase text-base-content/70 font-medium">{l("Advanced settings")}</div> -->
<form phx-change="Bonfire.Me.Settings:set">
<input name="scope" value={:instance} type="hidden">

<div class="m-3 divide-y rounded-lg bg-base-content/5 divide-base-300">
<div class="divide-y divide-base-content/10">
<Bonfire.UI.Common.SettingsToggleLive
name={l("Enable federation")}
description={l("Push local activities to the fediverse, and accept remote activities?")}
Expand Down
4 changes: 3 additions & 1 deletion lib/components/switch_user/account_users_live.sface
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<Bonfire.UI.Common.UserPreviewLive user={user} path_prefix="/switch-user/" go={@go} />
</div>
{/for}
<div class="flex flex-col col-span-1 text-center divide-y divide-gray-200 place-content-center group">
<div
:if={length(@current_account_users) < Bonfire.Me.Settings.get([Bonfire.UI.Me.SwitchUserViewLive.AccountUsersLive, :max_users], 4, @__context__[:instance_settings])}
class="flex flex-col col-span-1 text-center divide-y divide-gray-200 place-content-center group">
<LiveRedirect to={path(:create_user)}>
<div class="flex flex-col items-center flex-1">
<div class="w-32 h-32">
Expand Down
7 changes: 6 additions & 1 deletion lib/views/switch_user/switch_user_live.sface
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<main id="switch-user">
<Bonfire.UI.Common.LogoLinkLive
container_class="flex items-center my-8 justify-center gap-2"
name_class="text-2xl font-bold tracking-wider"
href="/"
/>
<div class="flex-1 mt-3 max-w-[680px] mx-auto">
<div class="p-4 my-6 rounded-md bg-info/10">
<div class="flex">
Expand All @@ -8,7 +13,7 @@
<div class="flex-1 ml-3 md:flex md:justify-between">
<p class="text-sm text-info">
{l(
"You can have multiple user profiles for different online identities, or for your organizations or projects."
"You can have up to %{max_users} user profiles for different online identities, or for your organizations or projects.", max_users: Bonfire.Me.Settings.get([Bonfire.UI.Me.SwitchUserViewLive.AccountUsersLive, :max_users], 4, @__context__[:instance_settings])
)}</p>
</div>
</div>
Expand Down

0 comments on commit fef26c5

Please sign in to comment.