]> granicus.if.org Git - ejabberd/commitdiff
* src/web/ejabberd_web_admin.erl: Bugfix
authorAlexey Shchepin <alexey@process-one.net>
Fri, 27 May 2005 22:52:50 +0000 (22:52 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Fri, 27 May 2005 22:52:50 +0000 (22:52 +0000)
SVN Revision: 369

ChangeLog
src/web/ejabberd_web_admin.erl

index 8c27406e0255f4de63ce135a322e0848d0292b9d..afbdb36b15383ed3d202bf21601d22ccb621aa1a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-05-28  Alexey Shchepin  <alexey@sevcom.net>
+
+       * src/web/ejabberd_web_admin.erl: Bugfix
+
 2005-05-25  Alexey Shchepin  <alexey@sevcom.net>
 
        * src/msgs/pt-br.msg: New Brazilian Portuguese translation (thanks
index dacbf7817378a90f8637fd20bce4717ee8d7569b..354dc2d0a958333c89ff216b1d0fd36708385ac3 100644 (file)
@@ -1556,7 +1556,7 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
     nothing.
 
 
-list_last_activity(_Lang, Integral, Period) ->
+list_last_activity(Lang, Integral, Period) ->
     {MegaSecs, Secs, _MicroSecs} = now(),
     TimeStamp = MegaSecs * 1000000 + Secs,
     case Period of
@@ -1580,26 +1580,32 @@ list_last_activity(_Lang, Integral, Period) ->
            [];
        Vals ->
            Hist = histogram(Vals, Integral),
-           Left = case Days of
-                      infinity ->
-                          0;
-                      _ ->
-                          Days - length(Hist)
-                  end,
-           Tail = case Integral andalso Hist /= [] of
-                      true ->
-                          lists:duplicate(Left, lists:last(Hist));
-                      _ ->
-                          lists:duplicate(Left, 0)
-                  end,
-           Max = lists:max(Hist),
-           [?XAE("ol",
-                 [{"id", "lastactivity"}, {"start", "0"}],
-                 [?XAE("li",
-                       [{"style", "width:" ++ integer_to_list(
-                                                trunc(90 * V / Max)) ++ "%;"}],
-                       [{xmlcdata, integer_to_list(V)}])
-                  || V <- Hist ++ Tail])]
+           if
+               Hist == [] ->
+                   [?CT("No data")];
+               true ->
+                   Left = if
+                              Days == infinity ->
+                                  0;
+                              true ->
+                                  Days - length(Hist)
+                          end,
+                   Tail = if
+                              Integral ->
+                                  lists:duplicate(Left, lists:last(Hist));
+                              true ->
+                                  lists:duplicate(Left, 0)
+                          end,
+                   Max = lists:max(Hist),
+                   [?XAE("ol",
+                         [{"id", "lastactivity"}, {"start", "0"}],
+                         [?XAE("li",
+                               [{"style",
+                                 "width:" ++ integer_to_list(
+                                               trunc(90 * V / Max)) ++ "%;"}],
+                               [{xmlcdata, integer_to_list(V)}])
+                          || V <- Hist ++ Tail])]
+           end
     end.
 
 histogram(Values, Integral) ->