liquid_feedback_frontend / app / main / draft / diff.lua

Diff from to

app/main/draft/diff.lua

-slot.put_into("title", _"Diff")
-
 local old_draft_id = param.get("old_draft_id", atom.integer)
 local new_draft_id = param.get("new_draft_id", atom.integer)
 
 local old_draft = Draft:by_id(old_draft_id)
 local new_draft = Draft:by_id(new_draft_id)
 
+local initiative = new_draft.initiative
+local issue = initiative.issue
+
+slot.select("title", function()
+  ui.link{
+    content = issue.area.name,
+    module = "area",
+    view = "show",
+    id = issue.area.id
+  }
+  slot.put(" · ")
+  ui.link{
+    content = _("Issue ##{id}", { id = issue.id }),
+    module = "issue",
+    view = "show",
+    id = issue.id
+  }
+  slot.put(" · ")
+  ui.link{
+    content = _("Initiative: ")..initiative.name,
+    module = "initiative",
+    view = "show",
+    id = initiative.id
+  }
+  slot.put(" · ")
+  slot.put_into("title", _"Diff")
+
+end)
+
+if app.session.member_id and not new_draft.initiative.revoked then
+  local supporter = Supporter:new_selector():add_where{"member_id = ?", app.session.member_id}:count()
+  if supporter then
+    ui.container{
+      attr = { class = "draft_updated_info" },
+      content = function()
+        slot.put(_"The draft of this initiative has been updated!")
+        slot.put(" ")
+        ui.link{
+          text   = _"Refresh support to current draft",
+          module = "initiative",
+          action = "add_support",
+          id     = new_draft.initiative.id,
+          routing = {
+            default = {
+              mode = "redirect",
+              module = "initiative",
+              view = "show",
+              id = new_draft.initiative.id
+            }
+          }
+        }
+      end
+    }
+  end
+end
+
 local old_draft_content = string.gsub(string.gsub(old_draft.content, "\n", " ###ENTER###\n"), " ", "\n")
 local new_draft_content = string.gsub(string.gsub(new_draft.content, "\n", " ###ENTER###\n"), " ", "\n")
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.