# HG changeset patch
# User bsw
# Date 1340138658 -7200
# Node ID 418b590fa9ed3c11c0609d5757ccd825c6b60e3c
# Parent 774d8804ce65e35266c64ba9231f16c62acfd1de
Optical enhancements, cleanup
diff -r 774d8804ce65 -r 418b590fa9ed app/main/_layout/default.html
--- a/app/main/_layout/default.html Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/_layout/default.html Tue Jun 19 22:44:18 2012 +0200
@@ -26,6 +26,9 @@
+
+
+
@@ -39,27 +42,8 @@
-
-
-
-
-
diff -r 774d8804ce65 -r 418b590fa9ed app/main/contact/list.lua
--- a/app/main/contact/list.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/contact/list.lua Tue Jun 19 22:44:18 2012 +0200
@@ -3,8 +3,7 @@
order = "name"
}
-
-slot.put_into("title", _"Contacts")
+ui.title(_"Contacts")
util.help("contact.list")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/index/_index_member.lua
--- a/app/main/index/_index_member.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/index/_index_member.lua Tue Jun 19 22:44:18 2012 +0200
@@ -28,9 +28,6 @@
label = _"Open issues",
module = "issue",
view = "_list",
- link_params = {
- filter_interest = not show_as_homepage and "issue" or nil,
- },
params = {
for_state = "open",
issues_selector = Issue:new_selector()
diff -r 774d8804ce65 -r 418b590fa9ed app/main/index/email_unconfirmed.lua
--- a/app/main/index/email_unconfirmed.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/index/email_unconfirmed.lua Tue Jun 19 22:44:18 2012 +0200
@@ -7,8 +7,11 @@
:optional_object_mode()
:exec()
- slot.select("title", function()
- ui.tag{ content = _"Notification address unconfirmed" }
+ slot.select("head", function()
+ ui.container{
+ attr = { class = "title" },
+ content = _"Notification address unconfirmed"
+ }
end )
if current then
diff -r 774d8804ce65 -r 418b590fa9ed app/main/initiative/new.lua
--- a/app/main/initiative/new.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/initiative/new.lua Tue Jun 19 22:44:18 2012 +0200
@@ -12,9 +12,9 @@
end
if issue_id then
- slot.put_into("title", _"Add alternative initiative to issue")
+ ui.title(_"Add alternative initiative to issue")
else
- slot.put_into("title", _"Create new issue")
+ ui.title(_"Create new issue")
end
ui.form{
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/developer_settings.lua
--- a/app/main/member/developer_settings.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/developer_settings.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,108 +1,96 @@
-slot.put_into("title", _"Developer settings")
+ui.title(_"Developer settings")
+
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
-
- local setting_key = "liquidfeedback_frontend_developer_features"
- local setting = Setting:by_pk(app.session.member.id, setting_key)
+local setting_key = "liquidfeedback_frontend_developer_features"
+local setting = Setting:by_pk(app.session.member.id, setting_key)
- if setting then
- ui.form{
- attr = { class = "vertical" },
- module = "member",
- action = "update_stylesheet_url",
- routing = {
- ok = {
- mode = "redirect",
- module = "index",
- view = "index"
- }
- },
- content = function()
- local setting_key = "liquidfeedback_frontend_stylesheet_url"
- local setting = Setting:by_pk(app.session.member.id, setting_key)
- local value = setting and setting.value
- ui.field.text{
- label = _"Stylesheet URL",
- name = "stylesheet_url",
- value = value
- }
- ui.submit{ value = _"Set URL" }
- end
- }
- end
+if setting then
+ ui.form{
+ attr = { class = "vertical" },
+ module = "member",
+ action = "update_stylesheet_url",
+ routing = {
+ ok = {
+ mode = "redirect",
+ module = "index",
+ view = "index"
+ }
+ },
+ content = function()
+ local setting_key = "liquidfeedback_frontend_stylesheet_url"
+ local setting = Setting:by_pk(app.session.member.id, setting_key)
+ local value = setting and setting.value
+ ui.field.text{
+ label = _"Stylesheet URL",
+ name = "stylesheet_url",
+ value = value
+ }
+ ui.submit{ value = _"Set URL" }
+ end
+ }
+end
+
+ui.heading{ content = _"API keys" }
- ui.heading{ content = _"API keys" }
+local member_applications = MemberApplication:new_selector()
+ :add_where{ "member_id = ?", app.session.member.id }
+ :add_order_by("name, id")
+ :exec()
--- util.help("member.developer_settings.api_key", _"API key")
-
- local member_applications = MemberApplication:new_selector()
- :add_where{ "member_id = ?", app.session.member.id }
- :add_order_by("name, id")
- :exec()
-
- if #member_applications > 0 then
+if #member_applications > 0 then
- ui.list{
- records = member_applications,
- columns = {
- {
- name = "name",
- label = _"Name"
- },
- {
- name = "access_level",
- label = _"Access level"
- },
- {
- name = "key",
- label = _"API Key"
- },
- {
- name = "last_usage",
- label = "Last usage"
- },
- {
- content = function(member_application)
- ui.link{
- text = _"Delete",
- module = "member", action = "update_api_key", id = member_application.id,
- params = { delete = true },
- routing = {
- default = {
- mode = "redirect",
- module = "member",
- view = "developer_settings"
- }
+ ui.list{
+ records = member_applications,
+ columns = {
+ {
+ name = "name",
+ label = _"Name"
+ },
+ {
+ name = "access_level",
+ label = _"Access level"
+ },
+ {
+ name = "key",
+ label = _"API Key"
+ },
+ {
+ name = "last_usage",
+ label = "Last usage"
+ },
+ {
+ content = function(member_application)
+ ui.link{
+ text = _"Delete",
+ module = "member", action = "update_api_key", id = member_application.id,
+ params = { delete = true },
+ routing = {
+ default = {
+ mode = "redirect",
+ module = "member",
+ view = "developer_settings"
}
}
- end
- },
+ }
+ end
+ },
+ }
+ }
+
+else
+
+ slot.put(_"Currently no API key is set.")
+ slot.put(" ")
+ ui.link{
+ text = _"Generate API key",
+ module = "member",
+ action = "update_api_key",
+ routing = {
+ default = {
+ mode = "redirect",
+ module = "member",
+ view = "developer_settings"
}
}
-
- else
-
- slot.put(_"Currently no API key is set.")
- slot.put(" ")
- ui.link{
- text = _"Generate API key",
- module = "member",
- action = "update_api_key",
- routing = {
- default = {
- mode = "redirect",
- module = "member",
- view = "developer_settings"
- }
- }
- }
- end
+ }
+end
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/edit.lua
--- a/app/main/member/edit.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/edit.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,15 +1,4 @@
-slot.put_into("title", _"Edit my profile")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
+ui.title(_"Edit my profile")
util.help("member.edit", _"Edit my page")
@@ -21,8 +10,9 @@
routing = {
ok = {
mode = "redirect",
- module = "index",
- view = "index"
+ module = "member",
+ view = "show",
+ id = app.session.member_id
}
},
content = function()
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/edit_images.lua
--- a/app/main/member/edit_images.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/edit_images.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,15 +1,4 @@
-slot.put_into("title", _"Upload images")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
+ui.title(_"Upload images")
util.help("member.edit_images", _"Images")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/history.lua
--- a/app/main/member/history.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/history.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,17 +1,21 @@
local member = Member:by_id(param.get_id())
-slot.put_into("title", encode.html(_("Member name history for '#{name}'", { name = member.name })))
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Back")
- end,
- module = "member",
- view = "show",
- id = member.id
+slot.select("head", function()
+ ui.container{
+ attr = { class = "title" },
+ content = _("Member name history for '#{name}'", { name = member.name })
}
+ ui.container{ attr = { class = "actions" }, content = function()
+ ui.link{
+ content = function()
+ ui.image{ static = "icons/16/cancel.png" }
+ slot.put(_"Back")
+ end,
+ module = "member",
+ view = "show",
+ id = member.id
+ }
+ end }
end)
ui.form{
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/settings.lua
--- a/app/main/member/settings.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/settings.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,15 +1,4 @@
-slot.put_into("title", _"Settings")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "index",
- view = "index"
- }
-end)
+ui.title(_"Settings")
local pages = {}
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/settings_display.lua
--- a/app/main/member/settings_display.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/settings_display.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,16 +1,4 @@
-slot.put_into("title", _"Display settings")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
-
+ui.title(_"Display settings")
util.help("member.settings.display", _"Display settings")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/settings_email.lua
--- a/app/main/member/settings_email.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/settings_email.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,15 +1,4 @@
-slot.put_into("title", _"Change your notification email address")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
+ui.title(_"Change your notification email address")
util.help("member.settings.email_address", _"Change email")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/settings_login.lua
--- a/app/main/member/settings_login.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/settings_login.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,15 +1,4 @@
-slot.put_into("title", _"Change your login")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
+ui.title(_"Change your login")
util.help("member.settings.login", _"Change login")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/settings_name.lua
--- a/app/main/member/settings_name.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/settings_name.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,15 +1,4 @@
-slot.put_into("title", _"Change your name")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
+ui.title(_"Change your screen name")
util.help("member.settings.name", _"Change name")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/settings_notification.lua
--- a/app/main/member/settings_notification.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/settings_notification.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,16 +1,4 @@
-slot.put_into("title", _"Notification settings")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
-
+ui.title(_"Notification settings")
util.help("member.settings.notification", _"Notification settings")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/settings_password.lua
--- a/app/main/member/settings_password.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/settings_password.lua Tue Jun 19 22:44:18 2012 +0200
@@ -1,15 +1,4 @@
-slot.put_into("title", _"Change your password")
-
-slot.select("actions", function()
- ui.link{
- content = function()
- ui.image{ static = "icons/16/cancel.png" }
- slot.put(_"Cancel")
- end,
- module = "member",
- view = "settings"
- }
-end)
+ui.title(_"Change your password")
util.help("member.settings.password", _"Change password")
diff -r 774d8804ce65 -r 418b590fa9ed app/main/member/show.lua
--- a/app/main/member/show.lua Tue Jun 19 22:39:57 2012 +0200
+++ b/app/main/member/show.lua Tue Jun 19 22:44:18 2012 +0200
@@ -7,50 +7,99 @@
app.html_title.title = member.name
app.html_title.subtitle = _("Member")
-slot.select("title", function()
- execute.view{
- module = "member_image",
- view = "_show",
- params = {
- member = member,
- image_type = "avatar"
- }
- }
-end)
-
-slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name)))
-
-slot.select("actions", function()
- ui.link{
- content = function()
- slot.put(encode.html(_"Show member history"))
- end,
- module = "member",
- view = "history",
- id = member.id
+slot.select("head", function()
+ ui.container{
+ attr = { class = "title" },
+ content = _("Member '#{member}'", { member = member.name })
}
- if not member.active then
- ui.tag{
- tag = "div",
- attr = { class = "interest deactivated_member_info" },
- content = _"This member is deactivated."
+
+ ui.container{ attr = { class = "actions" }, content = function()
+
+ if member.id == app.session.member_id then
+ ui.link{
+ content = function()
+ slot.put(encode.html(_"Edit profile"))
+ end,
+ module = "member",
+ view = "edit"
+ }
+ slot.put(" · ")
+ ui.link{
+ content = function()
+ slot.put(encode.html(_"Upload avatar/photo"))
+ end,
+ module = "member",
+ view = "edit_images"
+ }
+ slot.put(" · ")
+ end
+ ui.link{
+ content = function()
+ slot.put(encode.html(_"Show member history"))
+ end,
+ module = "member",
+ view = "history",
+ id = member.id
}
- slot.put(" ")
- end
- if not (member.id == app.session.member.id) then
+ if not member.active then
+ slot.put(" · ")
+ ui.tag{
+ attr = { class = "interest deactivated_member_info" },
+ content = _"This member is deactivated."
+ }
+ end
+ if not (member.id == app.session.member.id) then
+ slot.put(" · ")
+ --TODO performance
+ local contact = Contact:by_pk(app.session.member.id, member.id)
+ if contact then
+ ui.link{
+ text = _"Remove from contacts",
+ module = "contact",
+ action = "remove_member",
+ id = contact.other_member_id,
+ routing = {
+ default = {
+ mode = "redirect",
+ module = request.get_module(),
+ view = request.get_view(),
+ id = param.get_id_cgi(),
+ params = param.get_all_cgi()
+ }
+ }
+ }
+ elseif member.activated then
+ ui.link{
+ text = _"Add to my contacts",
+ module = "contact",
+ action = "add_member",
+ id = member.id,
+ routing = {
+ default = {
+ mode = "redirect",
+ module = request.get_module(),
+ view = request.get_view(),
+ id = param.get_id_cgi(),
+ params = param.get_all_cgi()
+ }
+ }
+ }
+ end
+ end
+ local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id)
slot.put(" · ")
- --TODO performance
- local contact = Contact:by_pk(app.session.member.id, member.id)
- if contact then
- ui.container{
+ if ignored_member then
+ ui.tag{
attr = { class = "interest" },
- content = _"You have saved this member as contact."
+ content = _"You have ignored this member"
}
+ slot.put(" · ")
ui.link{
- text = _"Remove from contacts",
- module = "contact",
- action = "remove_member",
- id = contact.other_member_id,
+ text = _"Stop ignoring member",
+ module = "member",
+ action = "update_ignore_member",
+ id = member.id,
+ params = { delete = true },
routing = {
default = {
mode = "redirect",
@@ -63,9 +112,10 @@
}
elseif member.activated then
ui.link{
- text = _"Add to my contacts",
- module = "contact",
- action = "add_member",
+ attr = { class = "interest" },
+ text = _"Ignore member",
+ module = "member",
+ action = "update_ignore_member",
id = member.id,
routing = {
default = {
@@ -78,49 +128,7 @@
}
}
end
- end
- local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id)
- slot.put(" · ")
- if ignored_member then
- ui.container{
- attr = { class = "interest" },
- content = _"You have ignored this member"
- }
- slot.put(" · ")
- ui.link{
- text = _"Stop ignoring member",
- module = "member",
- action = "update_ignore_member",
- id = member.id,
- params = { delete = true },
- routing = {
- default = {
- mode = "redirect",
- module = request.get_module(),
- view = request.get_view(),
- id = param.get_id_cgi(),
- params = param.get_all_cgi()
- }
- }
- }
- elseif member.activated then
- ui.link{
- attr = { class = "interest" },
- text = _"Ignore member",
- module = "member",
- action = "update_ignore_member",
- id = member.id,
- routing = {
- default = {
- mode = "redirect",
- module = request.get_module(),
- view = request.get_view(),
- id = param.get_id_cgi(),
- params = param.get_all_cgi()
- }
- }
- }
- end
+ end }
end)
util.help("member.show", _"Member page")
diff -r 774d8804ce65 -r 418b590fa9ed env/ui/title.lua
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/env/ui/title.lua Tue Jun 19 22:44:18 2012 +0200
@@ -0,0 +1,5 @@
+function ui.title(content)
+ slot.select("head", function()
+ ui.container{ attr = { class = "title" }, content = content }
+ end)
+end
\ No newline at end of file
diff -r 774d8804ce65 -r 418b590fa9ed static/style.css
--- a/static/style.css Tue Jun 19 22:39:57 2012 +0200
+++ b/static/style.css Tue Jun 19 22:44:18 2012 +0200
@@ -175,7 +175,7 @@
}
.topbar .logolf {
- margin-left: 1%;
+ margin-left: 6px;
font-weight: bold;
}
@@ -274,38 +274,31 @@
margin-top: 1ex;
}
-.slot_actions {
+.page_head .actions {
margin-left: 10px;
margin-top: 0.5ex;
margin-bottom: 1ex;
}
-.page_head {
+.slot_head {
background-color: #fff;
margin: 0px 10px 2ex 10px;
border: 1px solid #aaa;
border-radius: 0 0 8px 8px;
}
-
-.page_head .area_head,
-.page_head .issue {
- xborder-top: 1px solid #000;
-}
-
-.page_head .unit_head .title,
-.page_head .area_head .title,
+.page_head .title,
.issue .context,
.issue .title,
.initiative_head .title {
- padding: 8px 16px 2px 16px;
+ padding: 8px 10px 2px 10px;
}
.page_head .unit_head .content,
.page_head .area_head .content,
.issue .content,
.initiative_head .content {
- padding: 2px 16px 8px 16px;
+ padding: 2px 10px 8px 10px;
}
.page_head .initiative_list,
@@ -319,8 +312,7 @@
-.page_head .unit_head .title,
-.page_head .area_head .title,
+.page_head .title,
.issue .title,
.initiative_head .title {
font-weight: bold;
@@ -423,6 +415,9 @@
/*************************************************************************
* ui.tab
*/
+.ui_tabs {
+ margin: 10px 0px;
+}
.ui_tabs_links a {
padding: 0.75ex 0.6em;
@@ -1165,7 +1160,6 @@
.slot_help_hidden {
float: right;
- margin-right: 1em;
margin-top: 1ex;
}
@@ -1383,7 +1377,7 @@
padding: 0;
}
-.page_head,
+.slot_head,
.initiative_head,
.issues .issue,
.ui_tabs_links a,