]> jfr.im git - irc/freenode/gms.git/commitdiff
Display all requested channel namespaces on the approval page
authormniip <redacted>
Sat, 27 Feb 2016 21:00:55 +0000 (21:00 +0000)
committermniip <redacted>
Sat, 27 Feb 2016 21:00:55 +0000 (21:00 +0000)
lib/GMS/Domain/Group.pm
lib/GMS/Schema/Result/Group.pm
root/static/js/constants.js
root/static/js/format.js

index 896ccf7fd35164e45dd56b8423bc73963b24c90a..5950bb6cc9ae2f7829e1cdce5b8429db86bc8832 100644 (file)
@@ -185,7 +185,6 @@ sub TO_JSON {
 
     my $accountname = undef;
     my $dropped = undef;
-    my $initial = undef;
     my $id      = undef;
 
     if ($first) {
@@ -194,8 +193,9 @@ sub TO_JSON {
         $id      = $first->contact->account->id;
     }
 
-    if ($self->channel_namespaces->first) {
-        $initial = $self->channel_namespaces->first->namespace;
+    my @namespaces;
+    foreach my $ns ($self->channel_namespaces) {
+        push @namespaces, $ns->namespace
     }
 
     return {
@@ -207,7 +207,7 @@ sub TO_JSON {
         'initial_contact_account_name'    => $accountname,
         'initial_contact_account_id'      => $id,
         'initial_contact_account_dropped' => $dropped,
-        'initial_namespace_name'          => $initial,
+        'channel_namespaces'              => \@namespaces
     }
 }
 
index 1f35c82171e48528ea6da7e5cc5b0f3007ac3ad8..44430bab25948d22f3891568e8cb24fb4f9f6fc1 100644 (file)
@@ -1088,6 +1088,11 @@ sub TO_JSON {
         $dropped = $first->contact->account->is_dropped;
     }
 
+    my @namespaces;
+    foreach my $ns ($self->channel_namespaces) {
+        push @namespaces, $ns->namespace
+    }
+
     return {
         'id'                              => $self->id,
         'name'                            => $self->group_name,
@@ -1097,7 +1102,7 @@ sub TO_JSON {
         'initial_contact_account_name'    => $accountname,
         'initial_contact_account_id'      => $id,
         'initial_contact_account_dropped' => $dropped,
-        'initial_namespace_name'          => $self->channel_namespaces->first->namespace,
+        'channel_namespaces'              => \@namespaces
     }
 }
 
index 5c9be98dce574773960dfdb47796cd0e6a7206a7..1cd324292eb1e18a184b839a5dbb502714735c82 100644 (file)
@@ -118,7 +118,7 @@ var __GROUP_TYPE              = ' group';
 var __GROUP                   = 'Group: ';
 var __GROUPS                  = 'groups';
 var __INITIAL_CONTACT         = 'Initial contact: ';
-var __INITIAL_NAMESPACE       = 'Initial namespace: ';
+var __INITIAL_CHANNEL_NAMESPACES = 'Initial namespaces: ';
 var __HIDDEN_PLACEHOLDER      = 'Optional freetext about the change.';
 var __MARK                    = '<b>Note:</b> the account has been <b>marked</b> by <b>%setter</b> on %time:' + __BR + '<b>%mark</b>';
 var __NAME                    = 'Name: ';
@@ -550,7 +550,7 @@ var __TEMPLATE_GROUP_INFO     =
         "</small>" +
         "%group_type" + __GROUP_TYPE + __BR +
         __INITIAL_CONTACT + "<a target='_blank' href='" + __URL_USER + "'>%group_initial_contact</a>" + __BR +
-        __INITIAL_NAMESPACE + "#%group_initial_namespace / #%group_initial_namespace-*" + __BR +
+        __INITIAL_CHANNEL_NAMESPACES + "%initial_channel_namespaces" + __BR +
         "%requestor_account_dropped" +
     "</blockquote>" +
 "</div>";
index 791b90690b20a940dcb5e3108be179a6504b135a..0e23aabb19d8259deb509c48a9665d7d52f6d410 100644 (file)
@@ -302,7 +302,7 @@ function format_group ( group ) {
     html = html.replace (/\%group_name/g, escapeHtml(group.name));
     html = html.replace (/\%group_initial_contact/g, escapeHtml(group.initial_contact_account_name));
     html = html.replace (/\%account_id/g, escapeHtml(group.initial_contact_account_id));
-    html = html.replace (/\%group_initial_namespace/g, escapeHtml(group.initial_namespace_name));
+    html = html.replace (/\%initial_channel_namespaces/g, escapeHtml(group.channel_namespaces.map(function(ns) { return "#" + ns; }).join(", ")));
     html = html.replace (/\%group_url/g, escapeHtml(group.url));
     html = html.replace (/\%group_type/g, escapeHtml(group.type));