Use preference label instead of attribute.

For admins and resellers, show label in addition to attribute.
For subscribers, only show label.
agranig/peering-route
Andreas Granig 12 years ago
parent de73436174
commit 8a194e5055

@ -24,6 +24,9 @@ has_block 'fields' => (
sub field_list {
my $self = shift;
my $is_subscriber = ($self->ctx->user_in_realm('subscriber') ||
$self->ctx->user_in_realm('subscriberadmin'));
my @field_list;
my $fields_data = $self->fields_data;
@ -95,7 +98,8 @@ sub field_list {
};
}
}
$field->{label} = $meta->attribute;
$field->{label} = $is_subscriber ? $meta->label : $meta->attribute;
push @field_list, $field;
}

@ -158,6 +158,7 @@ sub create_preference_form {
}
my $form = NGCP::Panel::Form::Preferences->new({
ctx => $c,
fields_data => [{
meta => $c->stash->{preference_meta},
enums => $enums,

@ -33,6 +33,9 @@
<tr>
[% # one for description -%]
<th></th>
[% UNLESS c.user_in_realm('subscriber') || c.user_in_realm('subscriberadmin') -%]
<th>Attribute</th>
[% END -%]
<th>Name</th>
<th>Value</th>
[% # one for actions -%]
@ -53,8 +56,11 @@
]
}); return false;"><i class="icon-question-sign"></i></a>
</td>
[% UNLESS c.user_in_realm('subscriber') || c.user_in_realm('subscriberadmin') -%]
<td>[% r.attribute %]</td>
[% END -%]
<td>
[% r.attribute %]
[% r.label %]
</td>
<td>
[% IF r.attribute == "rewrite_rule_set" -%]
@ -138,7 +144,7 @@
[%
PROCESS "helpers/modal.tt";
modal_header(m.create_flag=0,
m.name = "Preference " _ helper.preference_meta.attribute);
m.name = "Preference '" _ helper.preference_meta.label _"'");
-%]
[% IF helper.preference_meta.attribute == "allowed_ips" %]

Loading…
Cancel
Save