diff --git a/Changelog.md b/Changelog.md index aa7fbe8500dada108ce413bc63450b587426aab0..11f045a1669cbdbaf9b340b452d4f65aa134319d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,7 @@ ## Features * Change email without confirmation when mail is disabled [#7455](https://github.com/diaspora/diaspora/pull/7455) * Warn users if they leave the profile editing page with unsaved changes [#7473](https://github.com/diaspora/diaspora/pull/7473) +* Add admin pages to the mobile interface [#7295](https://github.com/diaspora/diaspora/pull/7295) # 0.6.6.0 diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index e85694a08ede8cf74cbddd0f91be25923c2648df..078edf674db17aafb4a6c30fac119e473124101a 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -2,9 +2,9 @@ @import 'bootstrap-variables'; @import 'animations'; -/** ADMIN STYlES **/ -/** user search **/ +// ADMIN STYlES +// user search .users { li.user { border-bottom: 1px solid $light-grey; @@ -23,7 +23,7 @@ } } -/** Invites panel **/ +// Invites panel .more_invites{ #add-invites-section{ line-height: 34px; @@ -31,9 +31,13 @@ } } +.invite-emails { + margin-bottom: 10px; +} + // Weekly stats .week-selector { - margin-top: 18px; + margin-top: 10px; } // Pod stats @@ -44,8 +48,17 @@ } } -/** reported posts **/ +.percent-change { + &.increase { + color: $increase; + } + &.decrease { + color: $decrease; + } +} + +// reported posts .reports { .reason-label { font-weight: bold; @@ -60,8 +73,7 @@ } } -/** pod list **/ - +// pod list #pod-list { .pod-title { max-width: 200px; diff --git a/app/assets/stylesheets/color-variables.scss b/app/assets/stylesheets/color-variables.scss index 40acec470f6fe0e5f63ad8e6783cf5fe1e866a56..e69540df5bd517022d6bef67d1e607bd1496693a 100644 --- a/app/assets/stylesheets/color-variables.scss +++ b/app/assets/stylesheets/color-variables.scss @@ -32,3 +32,6 @@ $left-navbar-drawer-background: darken($white, 6%) !default; $hovercard-background: $white !default; $card-shadow: 0 1px 2px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12) !default; + +$increase: #008000; +$decrease: #fe0000; diff --git a/app/views/admins/_stats.haml b/app/views/admins/_stats.haml index c06ce26e8372ce290d564291b5aebe100101a8c2..ad74a7ab6b585a72665f202524bd029411cf22c1 100644 --- a/app/views/admins/_stats.haml +++ b/app/views/admins/_stats.haml @@ -1,49 +1,52 @@ - content_for :head do = stylesheet_link_tag :admin -%h1= t(".usage_statistic") +.container-fluid + .row + .col-sm-9 + %h1= t(".usage_statistic") + .col-sm-3 + = form_tag("/admins/stats", method: "get", class: "row form-inline segment-selection") do + .col-sm-8 + %select.form-control{name: "range"} + - %w(daily week 2weeks month).each do |range| + %option{value: range, selected: ("selected" if params[:range] == range)} + = t(".#{range}") + .col-sm-4 + = submit_tag t(".go"), class: "btn btn-primary btn-block" -.row - = form_tag("/admins/stats", method: "get", class: "col-sm-12 form-inline segment-selection") do - .col-sm-2.col-sm-push-8 - %select.form-control{name: "range"} - - %w(daily week 2weeks month).each do |range| - %option{value: range, selected: ("selected" if params[:range] == range)} - = t(".#{range}") - .col-sm-2.col-sm-push-8 - = submit_tag t(".go"), class: "btn btn-primary btn-block" - - .col-sm-8.col-sm-pull-4 - %h4 - != t("admins.stats.display_results", segment: content_tag(:strong, segment)) + .row + .col-xs-12 + %h4 + != t("admins.stats.display_results", segment: content_tag(:strong, segment)) -.row - - %i(posts comments aspect_memberships users).each do |name| - :ruby - model = instance_variable_get("@#{name}") - count = model[:yesterday] - name = name == :aspect_memberships ? t(".shares", count: count) : t(".#{name}", count: count) + .row + - %i(posts comments aspect_memberships users).each do |name| + :ruby + model = instance_variable_get("@#{name}") + count = model[:yesterday] + label_with_count = name == :aspect_memberships ? t(".shares", count: count) : t(".#{name}", count: count) - .col-md-3 - %h2{style: "font-weight:bold;"} - = name.to_s - %h4 - = model[:day_before] - %span.percent_change{class: (model[:change] > 0 ? "green" : "red")} - = "(#{model[:change]}%)" + .col-md-3 + %h2{style: "font-weight:bold;"} + = label_with_count + %h4 + = model[:day_before] + %span.percent-change{class: (model[:change] > 0 ? "increase" : "decrease")} + = "(#{model[:change]}%)" -.row - %p.col-md-12.alert.alert-info.text-center{role: "alert"} - != t("admins.stats.current_segment", - post_yest: content_tag(:strong, posts[:yesterday] / user_count), - post_day: content_tag(:strong, posts[:day_before] / user_count)) + .row + %p.col-md-12.alert.alert-info.text-center{role: "alert"} + != t("admins.stats.current_segment", + post_yest: content_tag(:strong, posts[:yesterday] / user_count), + post_day: content_tag(:strong, posts[:day_before] / user_count)) -.row - .col-md-12 - %h3= t(".50_most") - %ul - - @popular_tags.each do |name, count| - %li - != t("admins.stats.tag_name", - name_tag: content_tag(:strong, name), - count_tag: content_tag(:strong, count)) + .row + .col-md-12 + %h3= t(".50_most") + %ul + - @popular_tags.each do |name, count| + %li + != t("admins.stats.tag_name", + name_tag: content_tag(:strong, name), + count_tag: content_tag(:strong, count)) diff --git a/app/views/admins/_user_search.haml b/app/views/admins/_user_search.haml index e190708825d0f2a65184924595129085bbf589de..33e02cee85afecb89d0a8afa4ebafeee3b3a912c 100644 --- a/app/views/admins/_user_search.haml +++ b/app/views/admins/_user_search.haml @@ -52,6 +52,6 @@ %label.col-xs-12.col-md-2.control-label = t(".email_to") .col-xs-12.col-md-8 - = text_field_tag "identifier", nil, class: "form-control" + = text_field_tag "identifier", nil, class: "form-control invite-emails" .col-xs-12.col-md-2 = submit_tag t(".invite"), class: "btn btn-block btn-primary" diff --git a/app/views/admins/_weekly_user_stats.haml b/app/views/admins/_weekly_user_stats.haml index f61b04eb87da0aa80814579b9df9f825cab640c5..a3a9eff0770a5b6d7b1a361bbefe0431addd11d6 100644 --- a/app/views/admins/_weekly_user_stats.haml +++ b/app/views/admins/_weekly_user_stats.haml @@ -10,12 +10,12 @@ = form_tag("/admins/weekly_user_stats", method: "get", class: "form-inline week-selector row") do .col-xs-9.center = select_tag(:week, - options_for_select(created_users_by_week, selected_week), + options_for_select(created_users_by_week.keys.reverse, selected_week), class: "form-control") .col-xs-3.center = submit_tag t("admins.stats.go"), class: "btn btn-primary" = t(".amount_of", count: counter) %br -- @created_users_by_week[selected_week].each do |m| +- created_users_by_week[selected_week].each do |m| = link_to m, "/u/#{m}" diff --git a/app/views/admins/weekly_user_stats.haml b/app/views/admins/weekly_user_stats.haml index aea22eba1ae18454b7c3423f76884d0cb2669a64..264f27eaaf7ec03d0ad238e52904b3cebb50d636 100644 --- a/app/views/admins/weekly_user_stats.haml +++ b/app/views/admins/weekly_user_stats.haml @@ -4,5 +4,4 @@ = render partial: "admins/admin_bar" .col-md-9 = render partial: "admins/weekly_user_stats", - locals: {created_users_by_week: @created_users_by_week.keys.reverse, - selected_week: @selected_week, counter: @counter} + locals: {created_users_by_week: @created_users_by_week, selected_week: @selected_week, counter: @counter} diff --git a/app/views/admins/weekly_user_stats.mobile.haml b/app/views/admins/weekly_user_stats.mobile.haml index 98e7edc4e9217788af24f55e515b8f5ee7904476..054f1468fc1d5b1e86b8ac6927a87f1a2ee31b24 100644 --- a/app/views/admins/weekly_user_stats.mobile.haml +++ b/app/views/admins/weekly_user_stats.mobile.haml @@ -1,2 +1,2 @@ = render partial: "admins/weekly_user_stats", - locals: {created_users_by_week: @created_users_by_week.keys.reverse, selected_week: @selected_week, counter: @counter} + locals: {created_users_by_week: @created_users_by_week, selected_week: @selected_week, counter: @counter} diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index f1242cfe33178ae990912a8a33d47ef7f4158b2f..dc1a1f961c1fe012f06d63c2f51d90f60dfdb01f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -117,7 +117,7 @@ en: id: "ID" guid: "GUID" email: "Email" - diaspora_handle: "diaspora* handle" + diaspora_handle: "diaspora* ID" last_seen: "Last seen" account_closed: "Account closed" nsfw: "#nsfw"