New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #1

Open
wants to merge 4 commits into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+24 −9
Diff settings

Always

Just for now

Copy path View file
@@ -45,9 +45,9 @@ displayPosition position =
listDict.get position renamings
|> Maybe.withDefaultReplace (freeze position)
|> (\posForDisplay ->
let (posForDisplay2, title, class) =
let (posForDisplay2, title, class, buttons) =
if Dict.get position personByPositionDict /= Nothing then
(posForDisplay, position + " - can be renamed", "position")
(posForDisplay, position + " - can be renamed", "position", [])
else
let suggestions = List.filterMap (\(existingPosition, _) ->
if Regex.matchIn position existingPosition then
@@ -56,11 +56,18 @@ displayPosition position =
Nothing
) personByPosition
suggestion =
"Position not found. Did you mean " ++ String.join ", " suggestions
"Position not found. Remove some characters or click on suggestions."
buttons =
List.map (\suggestion ->
Html.button suggestion "Is this the correct position?"
(post, renamings) (\_ ->
(suggestion, renamings ++ [(suggestion, position)]))
) suggestions
in
(position, suggestion, "position notfound")
(pos, suggestion, "post notfound")
(position, suggestion, "position notfound", buttons)
in
[<span class=@class title=@title>@posForDisplay2</span>]
[<span class=@class title=@title>@posForDisplay2</span>] ++ buttons
)

type OrgChart = Leader String (List OrgChart)
@@ -101,14 +108,21 @@ renderOrgChart istop nosiblings orgChart =
<div class="leader vacant">@( buildpic <span></span>)<div class="picinfo">@displayPosition(position)<br>Vacant</div></div>
children =
Html.div [] [["class", "leaderchildren"]] (List.map (renderOrgChart False childNoSiblings) ministers)
editactions =
if edit then
[Html.button "+" "Add a child" ministers (\x -> x ++ [Leader "TODO" []])] ++
(if List.length ministers >= 1 then
[Html.button "-" "Remove children" ministers (\x -> [])]
else [])
else []
in
<div class=@(
"orgChart" +
(if istop then " top" else "") +
(if nosiblings then " nosiblings" else "") +
(if childNoSiblings then " left" else "") +
(if List.length ministers == 0 then " nochildren" else ""))
>@([leader] ++ [children
>@([leader] ++ editactions ++ [children
])</div>

renderTopOrgChart (name, style, attrs, orgCharts) =
Copy path View file
@@ -2,9 +2,9 @@
(" ", [], [],
[Leader "Project Manager" [
Leader "Research Manager" [
Leader "Apprentice" []
Leader "Research Apprentice" []
],
Leader "Research Manager" []
Leader "Research Manager2" []
]
])
]
Copy path View file
@@ -1,2 +1,3 @@
[
[ ("Research Manager2", "Research Manager"),
("Research Apprentice", "Apprentice")
]
ProTip! Use n and p to navigate between commits in a pull request.