diff --git a/templates/org/follow_unfollow.tmpl b/templates/org/follow_unfollow.tmpl index ba0bd01efe..9175088da4 100644 --- a/templates/org/follow_unfollow.tmpl +++ b/templates/org/follow_unfollow.tmpl @@ -1,4 +1,4 @@ - + {{$moderationEntryNeeded := and .IsModerationEnabled .IsSigned (not .IsOrganizationOwner)}} + {{if or .EnableFeed $moderationEntryNeeded}} + {{end}} diff --git a/tests/integration/org_profile_test.go b/tests/integration/org_profile_test.go index 2211a8b3d2..8125c3e6ba 100644 --- a/tests/integration/org_profile_test.go +++ b/tests/integration/org_profile_test.go @@ -104,5 +104,51 @@ quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequa assert.NotContains(t, resp.Body.String(), "veniam") }) }) + + t.Run("More actions - feeds only", func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + defer test.MockVariableValue(&setting.Other.EnableFeed, true)() + defer test.MockVariableValue(&setting.Moderation.Enabled, false)() + + // Both guests and logged in users should see the feed option + doc := NewHTMLParser(t, MakeRequest(t, NewRequest(t, "GET", "/org3"), http.StatusOK).Body) + doc.AssertElement(t, "details.dropdown a[href='/org3.rss']", true) + doc.AssertElement(t, "details.dropdown a[href^='/report_abuse']", false) + + doc = NewHTMLParser(t, loginUser(t, "user10").MakeRequest(t, NewRequest(t, "GET", "/org3"), http.StatusOK).Body) + doc.AssertElement(t, "details.dropdown a[href='/org3.rss']", true) + doc.AssertElement(t, "details.dropdown a[href^='/report_abuse']", false) + }) + + t.Run("More actions - none", func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + defer test.MockVariableValue(&setting.Other.EnableFeed, false)() + defer test.MockVariableValue(&setting.Moderation.Enabled, false)() + + // The dropdown won't appear if no entries are available, for both guests and logged in users + doc := NewHTMLParser(t, MakeRequest(t, NewRequest(t, "GET", "/org3"), http.StatusOK).Body) + doc.AssertElement(t, "details.dropdown", false) + + doc = NewHTMLParser(t, loginUser(t, "user10").MakeRequest(t, NewRequest(t, "GET", "/org3"), http.StatusOK).Body) + doc.AssertElement(t, "details.dropdown", false) + }) + + t.Run("More actions - moderation", func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + defer test.MockVariableValue(&setting.Other.EnableFeed, false)() + defer test.MockVariableValue(&setting.Moderation.Enabled, true)() + + // The report option shouldn't be available to a guest + doc := NewHTMLParser(t, MakeRequest(t, NewRequest(t, "GET", "/org3"), http.StatusOK).Body) + doc.AssertElement(t, "details.dropdown", false) + + // But should be available to a logged in user + doc = NewHTMLParser(t, loginUser(t, "user10").MakeRequest(t, NewRequest(t, "GET", "/org3"), http.StatusOK).Body) + doc.AssertElement(t, "details.dropdown a[href^='/report_abuse']", true) + + // But the org owner shouldn't see the report option + doc = NewHTMLParser(t, loginUser(t, "user1").MakeRequest(t, NewRequest(t, "GET", "/org3"), http.StatusOK).Body) + doc.AssertElement(t, "details.dropdown", false) + }) }) } diff --git a/web_src/css/modules/dropdown.css b/web_src/css/modules/dropdown.css index 66762ac45c..22920c9f67 100644 --- a/web_src/css/modules/dropdown.css +++ b/web_src/css/modules/dropdown.css @@ -99,7 +99,13 @@ details.dropdown > summary + ul > li:last-child { /* Note: https://css-tricks.com/css-anchor-positioning-guide/ * looks like a great thing but FF still doesn't support it. */ -/* Note: dropdown.dir-rtl can be implemented when needed, e.g. for navbar profile dropdown on desktop layout. */ +details.dropdown.dir-rtl > summary + ul { + inset-inline: 0 auto; + direction: rtl; +} +details.dropdown.dir-rtl > summary + ul > li { + direction: ltr; +} details.dropdown > summary + ul > li > .item { padding: var(--dropdown-item-padding); diff --git a/web_src/css/org.css b/web_src/css/org.css index 6853a26bf7..05eb0c5476 100644 --- a/web_src/css/org.css +++ b/web_src/css/org.css @@ -89,28 +89,29 @@ text-align: center; } -.page-content.organization .org-avatar { - margin-right: 15px; -} - .page-content.organization #org-info { overflow-wrap: anywhere; flex: 1; } -.page-content.organization #org-info .ui.header { +.page-content.organization #org-info .org-title { display: flex; + column-gap: 1rem; align-items: center; - font-size: 36px; - margin-bottom: 0; +} + +.page-content.organization #org-info .org-title h1 { + margin: 0; + font-size: 2.5rem; } @media (max-width: 767.98px) { - .page-content.organization #org-info .ui.header { + .page-content.organization #org-info .org-header { flex-direction: column; margin-bottom: 1rem; } .page-content.organization #org-info .org-title { + flex-wrap: wrap; width: 100%; margin-bottom: 0.5rem; }