From 276b640418f8cefb103d3e8003f4d264793bb35d Mon Sep 17 00:00:00 2001 From: SansPseudoFix Date: Wed, 25 Jan 2017 18:17:57 +0100 Subject: [PATCH 01/12] Add admin views to mobile, use partials for common code with desktop --- app/assets/stylesheets/mobile/admins.scss | 14 ++++ app/assets/stylesheets/mobile/mobile.scss | 1 + app/controllers/admin/pods_controller.rb | 4 +- app/views/admins/_admin_bar.haml | 5 +- app/views/admins/_user_entry.mobile.haml | 76 +++++++++++++++++++ app/views/admins/dashboard.mobile.haml | 9 +++ app/views/admins/pods.mobile.haml | 9 +++ app/views/admins/stats.mobile.haml | 56 ++++++++++++++ app/views/admins/user_search.mobile.haml | 56 ++++++++++++++ .../admins/weekly_user_stats.mobile.haml | 17 +++++ app/views/layouts/_drawer.mobile.haml | 2 + app/views/report/index.mobile.haml | 39 ++++++++++ config/locales/diaspora/en.yml | 2 + 13 files changed, 285 insertions(+), 5 deletions(-) create mode 100644 app/assets/stylesheets/mobile/admins.scss create mode 100644 app/views/admins/_user_entry.mobile.haml create mode 100644 app/views/admins/dashboard.mobile.haml create mode 100644 app/views/admins/pods.mobile.haml create mode 100644 app/views/admins/stats.mobile.haml create mode 100644 app/views/admins/user_search.mobile.haml create mode 100644 app/views/admins/weekly_user_stats.mobile.haml create mode 100644 app/views/report/index.mobile.haml diff --git a/app/assets/stylesheets/mobile/admins.scss b/app/assets/stylesheets/mobile/admins.scss new file mode 100644 index 000000000..11c10674e --- /dev/null +++ b/app/assets/stylesheets/mobile/admins.scss @@ -0,0 +1,14 @@ +#app { + .btn-block, + input { + margin-bottom: 5px; + margin-top: 5px; + } +} + +#admin-nav li a { + &:hover, + &:focus { + background-color: $gray-light; + } +} diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index 54d01870e..fbc4873ef 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -16,6 +16,7 @@ @import "mobile/stream_element"; @import "mobile/comments"; @import 'mobile/openid_connect_error_page'; +@import 'mobile/admins'; @import 'typography'; diff --git a/app/controllers/admin/pods_controller.rb b/app/controllers/admin/pods_controller.rb index 1b4d2bf2f..739740831 100644 --- a/app/controllers/admin/pods_controller.rb +++ b/app/controllers/admin/pods_controller.rb @@ -1,7 +1,7 @@ module Admin class PodsController < AdminController - respond_to :html, :json + respond_to :html, :json, :mobile def index pods_json = PodPresenter.as_collection(Pod.all) @@ -15,6 +15,7 @@ module Admin render "admins/pods" end + format.mobile { render "admins/pods" } format.json { render json: pods_json } end end @@ -26,6 +27,7 @@ module Admin respond_with do |format| format.html { redirect_to admin_pods_path } format.json { render json: PodPresenter.new(pod).as_json } + format.mobile { redirect_to admin_pods_path } end end end diff --git a/app/views/admins/_admin_bar.haml b/app/views/admins/_admin_bar.haml index 43ab0a8a4..dd9be53b8 100644 --- a/app/views/admins/_admin_bar.haml +++ b/app/views/admins/_admin_bar.haml @@ -1,9 +1,7 @@ - content_for :head do = stylesheet_link_tag :admin -%h2= t(".pages") - -%ul#admin_nav.nav.nav-pills.nav-stacked +%ul.nav.nav-pills.nav-stacked#admin-nav %li{role: "presentation", class: current_page?(admin_dashboard_path) && "active"} = link_to t(".dashboard"), admin_dashboard_path %li{role: "presentation", class: current_page?(user_search_path) && "active"} @@ -22,4 +20,3 @@ = link_to t(".pod_network"), admin_pods_path %li{role: "presentation", class: current_page?(sidekiq_path) && "active"} = link_to t(".sidekiq_monitor"), sidekiq_path - diff --git a/app/views/admins/_user_entry.mobile.haml b/app/views/admins/_user_entry.mobile.haml new file mode 100644 index 000000000..d9c876673 --- /dev/null +++ b/app/views/admins/_user_entry.mobile.haml @@ -0,0 +1,76 @@ + +%li.user.media + .pull-left + - if user.person + %span.media-object + = person_image_tag(user.person, size: :thumb_small) + + .media-body.row + %span.label.label-default + = t(".id") + = user.id + %span.label.label-info + = t(".guid") + = user.person.guid if user.person + + %h4.media-heading + = user.person.name if user.person + + %div + .unstyled.text-right.actions + = link_to t("admins.user_search.view_profile"), person_path(user.person), class: "btn btn-default btn-block" + = link_to t("admins.user_search.add_invites"), add_invites_path(user.invitation_code), + class: "btn btn-info btn-block" + - unless user.person.closed_account + = link_to t("admins.user_search.close_account"), admin_close_account_path(user), + method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, + class: "btn btn-danger btn-block" + + - unless user.closed_account? + - if !user.access_locked? + = link_to t("admins.user_search.lock_account"), admin_lock_account_path(user), method: :post, + data: {confirm: t("admins.user_search.are_you_sure_lock_account")}, + class: "btn btn-danger btn-block" + - else + = link_to t("admins.user_search.unlock_account"), admin_unlock_account_path(user), method: :post, + data: {confirm: t("admins.user_search.are_you_sure_unlock_account")}, + class: "btn btn-danger btn-block" + + .row + .col-md-5 + %dl.dl-horizontal + %dt= t("username") + %dd= user.username + %dt= t(".email") + %dd= user.email + %dt= t(".diaspora_handle") + %dd= user.person.diaspora_handle + %dt= t(".last_seen") + %dd= user.last_seen || t(".unknown") + - if user.invited_by.present? + %dt= t(".invite_token") + %dd= invite_code_url(user.invited_by.invitation_code) + %dt= t(".account_closed") + %dd + - if user.person.closed_account + %span.label.label-warning= t(".yes") + - else + %span.label.label-success= t(".no") + %dt= t(".nsfw") + %dd + - if user.person.profile.nsfw + %span.label.label-warning= t(".yes") + - else + %span.label.label-success= t(".no") + + %h4= t("layouts.header.profile") + + %dl.dl-horizontal + %dt= t("people.profile_sidebar.born") + %dd= user.person.profile.birthday + %dt= t("people.profile_sidebar.gender") + %dd= user.person.profile.gender + %dt= t("people.profile_sidebar.location") + %dd= user.person.profile.location + %dt= t("people.profile_sidebar.bio") + %dd= user.person.profile.bio diff --git a/app/views/admins/dashboard.mobile.haml b/app/views/admins/dashboard.mobile.haml new file mode 100644 index 000000000..52696e01b --- /dev/null +++ b/app/views/admins/dashboard.mobile.haml @@ -0,0 +1,9 @@ +.col-md-9 + #pod-status + %h2 + = t(".pod_status") + .alert.alert-info.pod-version{role: "alert"} + = t(".fetching_diaspora_version") + - if unreviewed_reports_count > 0 + .alert.alert-warning.reports-warning{role: "alert"} + = t("report.unreviewed_reports", count: unreviewed_reports_count) diff --git a/app/views/admins/pods.mobile.haml b/app/views/admins/pods.mobile.haml new file mode 100644 index 000000000..6ef234b2f --- /dev/null +++ b/app/views/admins/pods.mobile.haml @@ -0,0 +1,9 @@ +.container + .row + .col-md-9 + %h2 + = t(".pod_network") + + .alert.alert-warning + = t(".pod_desktop_view") + = link_to t(".pod_desktop_link"), toggle_mobile_path diff --git a/app/views/admins/stats.mobile.haml b/app/views/admins/stats.mobile.haml new file mode 100644 index 000000000..d4cf025b2 --- /dev/null +++ b/app/views/admins/stats.mobile.haml @@ -0,0 +1,56 @@ +.col-md-9 + %h1= t(".usage_statistic") + + %div + = form_tag("/admins/stats", method: "get", class: "form-inline") do + %select.form-control{name: "range"} + %option{value: "daily", selected: ("selected" if params[:range] == "daily")} + = t(".daily") + %option{value: "week", selected: ("selected" if params[:range] == "week")} + = t(".week") + %option{value: "2weeks", selected: ("selected" if params[:range] == "2weeks")} + = t(".2weeks") + %option{value: "month", selected: ("selected" if params[:range] == "month")} + = t(".month") + + = submit_tag t(".go"), class: "btn btn-primary btn-block" + + %h3 + != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) + + .row + - %i(posts comments aspect_memberships users).each do |name| + - model = instance_variable_get("@#{name}") + - if name == :aspect_memberships + - name = t(".shares", count: model[:yesterday]) + - if name == :posts + - name = t(".posts", count: model[:yesterday]) + - if name == :comments + - name = t(".comments", count: model[:yesterday]) + - if name == :users + - name = t(".users", count: model[:yesterday]) + + .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]}%)" + + .row + .col-md-12 + %p.alert.alert-info.text-center{role: "alert"} + != t("admins.stats.current_segment", + post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f), + post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) + + .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.mobile.haml b/app/views/admins/user_search.mobile.haml new file mode 100644 index 000000000..f7cc719e3 --- /dev/null +++ b/app/views/admins/user_search.mobile.haml @@ -0,0 +1,56 @@ +.col-md-9 + .row + .user_search.col-md-8 + %h3= t("admins.admin_bar.user_search") + = form_for @search, url: {action: "user_search"}, html: {method: :get, class: "form-horizontal"} do |f| + .form-group + = f.label :username, t("username"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :username, class: "form-control" + + .form-group + = f.label :email, t("email"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :email, class: "form-control" + + .form-group + = f.label :guid, t("admins.user_entry.guid"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :guid, class: "form-control" + + .form-group + .col-sm-offset-2.col-sm-10 + = f.label :under13 do + = f.check_box :under13 + = t(".under_13") + .form-group + .clearfix.col-sm-12 + = submit_tag t("admins.stats.go"), class: "btn btn-primary btn-block" + + .more_invites.col-md-4 + %h3= t("shared.invitations.invites") + .clearfix#add-invites-section + != t(".you_currently", count: current_user.invitation_code.count, + link: link_to(t(".add_invites"), add_invites_path(current_user.invitation_code), + class: "btn btn-link pull-right")) + + = form_tag "admin_inviter", method: :get, class: "form-horizontal" do + .form-group + %label.col-sm-4.control-label + = t(".email_to") + .col-sm-8 + = text_field_tag "identifier", nil, class: "form-control" + .form-group + .clearfix.col-md-12 + = submit_tag t(".invite"), class: "btn btn-default btn-block" + + .row + .col-md-12 + .alert.alert-info.text-center{role: "alert"} + = t(".users", count: @users.count) + + .row + .users.col-md-12 + %ul.media-list + - @users.each do |user| + = render partial: "user_entry", locals: {user: user} diff --git a/app/views/admins/weekly_user_stats.mobile.haml b/app/views/admins/weekly_user_stats.mobile.haml new file mode 100644 index 000000000..c2d9022b9 --- /dev/null +++ b/app/views/admins/weekly_user_stats.mobile.haml @@ -0,0 +1,17 @@ +.col-md-9 + %h2 + = t(".current_server", date: Time.zone.now.to_date) + + %div + = form_tag("/admins/weekly_user_stats", method: "get", class: "form-inline") do + = select_tag(:week, + options_for_select(@created_users_by_week.keys.reverse, + @selected_week), + class: "form-control") + = submit_tag t("admins.stats.go"), class: "btn btn-primary btn-block" + + = t(".amount_of", count: @counter) + %br + - @created_users_by_week[@selected_week].each do |m| + = link_to m, "/u/#{m}" + %br diff --git a/app/views/layouts/_drawer.mobile.haml b/app/views/layouts/_drawer.mobile.haml index c6d48424c..57230c446 100644 --- a/app/views/layouts/_drawer.mobile.haml +++ b/app/views/layouts/_drawer.mobile.haml @@ -35,5 +35,7 @@ = person_image_tag(current_user, size: :thumb_small) %li= link_to t("_contacts"), contacts_path %li= link_to t("layouts.header.settings"), edit_user_path + - if current_user.admin? + = render partial: "admins/admin_bar" %li= link_to t("layouts.application.toggle"), toggle_mobile_path %li= link_to t("layouts.header.logout"), destroy_user_session_path, method: :delete diff --git a/app/views/report/index.mobile.haml b/app/views/report/index.mobile.haml new file mode 100644 index 000000000..3f5902283 --- /dev/null +++ b/app/views/report/index.mobile.haml @@ -0,0 +1,39 @@ +.col-md-9 + #reports + %h1 + = t("report.title") + - @reports.each do |report| + - if report.item + .panel.panel-default + - username = report.user.username + .panel-heading + .reporter.pull-right + = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) + .reason + %span.reason-label + = t("report.reason_label") + %span + = report.text + .panel-body + .content + = report_content(report) + + = button_to t("report.reported_user_details"), + user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), + class: "btn pull-left btn-info btn-small", method: :post + = button_to t("report.review_link"), report_path(report.id, type: report.item_type), + class: "btn pull-left btn-info btn-small", method: :put + = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), + data: {confirm: t("report.confirm_deletion")}, + class: "btn pull-right btn-danger btn-small", method: :delete + - else + .panel.panel-default + - username = report.user.username + .panel-heading + .reporter.pull-right + = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) + .title + = report_content(report) + .panel-body + = button_to t("report.review_link"), report_path(report.id, type: report.item_type), + class: "btn pull-left btn-info btn-small", method: :put diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 3116e0c19..3d5f156f7 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -160,6 +160,8 @@ en: tag_name: "Tag name: %{name_tag} Count: %{count_tag}" pods: pod_network: "Pod network" + pod_desktop_view: "This page is not available on mobile view, please switch to" + pod_desktop_link: "desktop view." aspects: edit: confirm_remove_aspect: "Are you sure you want to delete this aspect?" From 5cb4c6e5df044eec6c5f49d16b1c3662671520ac Mon Sep 17 00:00:00 2001 From: SansPseudoFix Date: Tue, 31 Jan 2017 15:15:40 +0100 Subject: [PATCH 02/12] Refactor, more partials + No version check for mobile --- .../javascripts/mobile/mobile_drawer.js | 14 +--- app/assets/stylesheets/mobile/admins.scss | 16 +++- app/views/admins/_dashboard.haml | 12 +++ app/views/admins/_stats.haml | 55 ++++++++++++++ app/views/admins/_user_entry.haml | 75 ++++++++++-------- app/views/admins/_user_entry.mobile.haml | 76 ------------------- app/views/admins/_user_search.haml | 56 ++++++++++++++ app/views/admins/dashboard.html.haml | 10 +-- app/views/admins/dashboard.mobile.haml | 10 +-- app/views/admins/pods.mobile.haml | 3 +- app/views/admins/stats.html.haml | 57 +------------- app/views/admins/stats.mobile.haml | 57 +------------- app/views/admins/user_entry.mobile.haml | 1 + app/views/admins/user_search.html.haml | 57 +------------- app/views/admins/user_search.mobile.haml | 57 +------------- app/views/admins/weekly_user_stats.haml | 8 +- app/views/layouts/_drawer.mobile.haml | 17 ++++- app/views/report/_reports.haml | 39 ++++++++++ app/views/report/index.html.haml | 40 +--------- app/views/report/index.mobile.haml | 40 +--------- config/locales/diaspora/en.yml | 7 +- 21 files changed, 261 insertions(+), 446 deletions(-) create mode 100644 app/views/admins/_dashboard.haml create mode 100644 app/views/admins/_stats.haml delete mode 100644 app/views/admins/_user_entry.mobile.haml create mode 100644 app/views/admins/_user_search.haml create mode 100644 app/views/admins/user_entry.mobile.haml create mode 100644 app/views/report/_reports.haml diff --git a/app/assets/javascripts/mobile/mobile_drawer.js b/app/assets/javascripts/mobile/mobile_drawer.js index 7a96a37d4..4689c5660 100644 --- a/app/assets/javascripts/mobile/mobile_drawer.js +++ b/app/assets/javascripts/mobile/mobile_drawer.js @@ -1,17 +1,11 @@ -(function(){ +(function() { Diaspora.Mobile.Drawer = { - initialize: function(){ - $("#all_aspects").bind("tap click", function(evt){ - evt.preventDefault(); - $(this).find("+ li").toggleClass("hide"); - }); - - $("#menu-badge").bind("tap click", function(evt){ + initialize: function() { + $("#menu-badge").bind("tap click", function(evt) { evt.preventDefault(); $("#app").toggleClass("draw"); }); - - $("#followed_tags").bind("tap click", function(evt){ + $("#all_aspects, #followed_tags, #admin").bind("tap click", function(evt) { evt.preventDefault(); $(this).find("+ li").toggleClass("hide"); }); diff --git a/app/assets/stylesheets/mobile/admins.scss b/app/assets/stylesheets/mobile/admins.scss index 11c10674e..f59c091f3 100644 --- a/app/assets/stylesheets/mobile/admins.scss +++ b/app/assets/stylesheets/mobile/admins.scss @@ -1,5 +1,5 @@ #app { - .btn-block, + .pull-right, input { margin-bottom: 5px; margin-top: 5px; @@ -12,3 +12,17 @@ background-color: $gray-light; } } + +@media(max-width: $screen-xs-max) { + #app { + .block-admin { + display: block; + float: none; + font-size: 13px; + margin-bottom: 5px; + margin-top: 5px; + padding: 6px 12px; + width: 100%; + } + } +} diff --git a/app/views/admins/_dashboard.haml b/app/views/admins/_dashboard.haml new file mode 100644 index 000000000..f861448cb --- /dev/null +++ b/app/views/admins/_dashboard.haml @@ -0,0 +1,12 @@ +- content_for :head do + = stylesheet_link_tag :admin + +.col-md-9 + #pod-status + %h2 + = t(".pod_status") + .alert.alert-info.pod-version.hidden-xs{role: "alert"} + = t(".fetching_diaspora_version") + - if unreviewed_reports_count > 0 + .alert.alert-warning.reports-warning{role: "alert"} + = t("report.unreviewed_reports", count: unreviewed_reports_count) diff --git a/app/views/admins/_stats.haml b/app/views/admins/_stats.haml new file mode 100644 index 000000000..0c29ee991 --- /dev/null +++ b/app/views/admins/_stats.haml @@ -0,0 +1,55 @@ +.col-md-9 + %h1= t(".usage_statistic") + + .pull-right.block-admin + = form_tag("/admins/stats", method: "get", class: "form-inline") do + %select.form-control{name: "range"} + %option{value: "daily", selected: ("selected" if params[:range] == "daily")} + = t(".daily") + %option{value: "week", selected: ("selected" if params[:range] == "week")} + = t(".week") + %option{value: "2weeks", selected: ("selected" if params[:range] == "2weeks")} + = t(".2weeks") + %option{value: "month", selected: ("selected" if params[:range] == "month")} + = t(".month") + + = submit_tag t(".go"), class: "btn btn-primary block-admin" + %h3 + != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) + + .row + - %i(posts comments aspect_memberships users).each do |name| + - model = instance_variable_get("@#{name}") + - if name == :aspect_memberships + - name = t(".shares", count: model[:yesterday]) + - if name == :posts + - name = t(".posts", count: model[:yesterday]) + - if name == :comments + - name = t(".comments", count: model[:yesterday]) + - if name == :users + - name = t(".users", count: model[:yesterday]) + + .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]}%)" + + .row + .col-md-12 + %p.alert.alert-info.text-center{role: "alert"} + != t("admins.stats.current_segment", + post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f), + post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) + + .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_entry.haml b/app/views/admins/_user_entry.haml index 13ac091b0..24f3d3b3f 100644 --- a/app/views/admins/_user_entry.haml +++ b/app/views/admins/_user_entry.haml @@ -1,70 +1,85 @@ %li.user.media - %div.pull-left + .pull-left - if user.person %span.media-object = person_image_tag(user.person, size: :thumb_small) - %div.media-body.row - %div.pull-right + .media-body.row + .pull-right %span.label.label-default - = t('.id') + = t(".id") = user.id %span.label.label-info - = t('.guid') + = t(".guid") = user.person.guid if user.person %h4.media-heading = user.person.name if user.person - %div.pull-right + .pull-right.block-admin .unstyled.text-right.actions - = link_to t('admins.user_search.view_profile'), person_path(user.person), class: 'btn btn-default btn-block btn-xs' - = link_to t('admins.user_search.add_invites'), add_invites_path(user.invitation_code), class: 'btn btn-info btn-block btn-xs' + = link_to t("admins.user_search.view_profile"), + person_path(user.person), + class: "btn btn-default btn-block block-admin btn-xs" + = link_to t("admins.user_search.add_invites"), + add_invites_path(user.invitation_code), + class: "btn btn-info btn-block block-admin btn-xs" - unless user.person.closed_account - = link_to t('admins.user_search.close_account'), admin_close_account_path(user), method: :post, data: { confirm: t('admins.user_search.are_you_sure') }, class: 'btn btn-danger btn-block btn-xs' + = link_to t("admins.user_search.close_account"), + admin_close_account_path(user), + method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, + class: "btn btn-danger btn-block block-admin btn-xs" - unless user.closed_account? - unless user.access_locked? - = link_to t('admins.user_search.lock_account'), admin_lock_account_path(user), method: :post, data: { confirm: t('admins.user_search.are_you_sure_lock_account') }, class: 'btn btn-danger btn-block btn-xs' + = link_to t("admins.user_search.lock_account"), + admin_lock_account_path(user), + method: :post, + data: {confirm: t("admins.user_search.are_you_sure_lock_account")}, + class: "btn btn-danger btn-block block-admin btn-xs" - else - = link_to t('admins.user_search.unlock_account'), admin_unlock_account_path(user), method: :post, data: { confirm: t('admins.user_search.are_you_sure_unlock_account') }, class: 'btn btn-danger btn-block btn-xs' + = link_to t("admins.user_search.unlock_account"), + admin_unlock_account_path(user), + method: :post, + data: {confirm: t("admins.user_search.are_you_sure_unlock_account")}, + class: "btn btn-danger btn-block block-admin btn-xs" - %div.row - %div.col-md-5 + .row + .col-md-5 %dl.dl-horizontal - %dt= t('username') + %dt= t("username") %dd= user.username - %dt= t('.email') + %dt= t(".email") %dd= user.email - %dt= t('.diaspora_handle') + %dt= t(".diaspora_handle") %dd= user.person.diaspora_handle - %dt= t('.last_seen') - %dd= user.last_seen || t('.unknown') + %dt= t(".last_seen") + %dd= user.last_seen || t(".unknown") -if user.invited_by.present? - %dt= t('.invite_token') + %dt= t(".invite_token") %dd= invite_code_url(user.invited_by.invitation_code) - %dt= t('.account_closed') + %dt= t(".account_closed") %dd - if user.person.closed_account - %span.label.label-warning= t('.yes') + %span.label.label-warning= t(".yes") - else - %span.label.label-success= t('.no') - %dt= t('.nsfw') + %span.label.label-success= t(".no") + %dt= t(".nsfw") %dd - if user.person.profile.nsfw - %span.label.label-warning= t('.yes') + %span.label.label-warning= t(".yes") - else - %span.label.label-success= t('.no') + %span.label.label-success= t(".no") - %h4= t('layouts.header.profile') + %h4= t("layouts.header.profile") %dl.dl-horizontal - %dt= t('people.profile_sidebar.born') + %dt= t("people.profile_sidebar.born") %dd= user.person.profile.birthday - %dt= t('people.profile_sidebar.gender') + %dt= t("people.profile_sidebar.gender") %dd= user.person.profile.gender - %dt= t('people.profile_sidebar.location') + %dt= t("people.profile_sidebar.location") %dd= user.person.profile.location - %dt= t('people.profile_sidebar.bio') + %dt= t("people.profile_sidebar.bio") %dd= user.person.profile.bio diff --git a/app/views/admins/_user_entry.mobile.haml b/app/views/admins/_user_entry.mobile.haml deleted file mode 100644 index d9c876673..000000000 --- a/app/views/admins/_user_entry.mobile.haml +++ /dev/null @@ -1,76 +0,0 @@ - -%li.user.media - .pull-left - - if user.person - %span.media-object - = person_image_tag(user.person, size: :thumb_small) - - .media-body.row - %span.label.label-default - = t(".id") - = user.id - %span.label.label-info - = t(".guid") - = user.person.guid if user.person - - %h4.media-heading - = user.person.name if user.person - - %div - .unstyled.text-right.actions - = link_to t("admins.user_search.view_profile"), person_path(user.person), class: "btn btn-default btn-block" - = link_to t("admins.user_search.add_invites"), add_invites_path(user.invitation_code), - class: "btn btn-info btn-block" - - unless user.person.closed_account - = link_to t("admins.user_search.close_account"), admin_close_account_path(user), - method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, - class: "btn btn-danger btn-block" - - - unless user.closed_account? - - if !user.access_locked? - = link_to t("admins.user_search.lock_account"), admin_lock_account_path(user), method: :post, - data: {confirm: t("admins.user_search.are_you_sure_lock_account")}, - class: "btn btn-danger btn-block" - - else - = link_to t("admins.user_search.unlock_account"), admin_unlock_account_path(user), method: :post, - data: {confirm: t("admins.user_search.are_you_sure_unlock_account")}, - class: "btn btn-danger btn-block" - - .row - .col-md-5 - %dl.dl-horizontal - %dt= t("username") - %dd= user.username - %dt= t(".email") - %dd= user.email - %dt= t(".diaspora_handle") - %dd= user.person.diaspora_handle - %dt= t(".last_seen") - %dd= user.last_seen || t(".unknown") - - if user.invited_by.present? - %dt= t(".invite_token") - %dd= invite_code_url(user.invited_by.invitation_code) - %dt= t(".account_closed") - %dd - - if user.person.closed_account - %span.label.label-warning= t(".yes") - - else - %span.label.label-success= t(".no") - %dt= t(".nsfw") - %dd - - if user.person.profile.nsfw - %span.label.label-warning= t(".yes") - - else - %span.label.label-success= t(".no") - - %h4= t("layouts.header.profile") - - %dl.dl-horizontal - %dt= t("people.profile_sidebar.born") - %dd= user.person.profile.birthday - %dt= t("people.profile_sidebar.gender") - %dd= user.person.profile.gender - %dt= t("people.profile_sidebar.location") - %dd= user.person.profile.location - %dt= t("people.profile_sidebar.bio") - %dd= user.person.profile.bio diff --git a/app/views/admins/_user_search.haml b/app/views/admins/_user_search.haml new file mode 100644 index 000000000..54fa550cf --- /dev/null +++ b/app/views/admins/_user_search.haml @@ -0,0 +1,56 @@ +.col-md-9 + .row + .user_search.col-md-8 + %h3= t("admins.admin_bar.user_search") + = form_for @search, url: {action: "user_search"}, html: {method: :get, class: "form-horizontal"} do |f| + .form-group + = f.label :username, t("username"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :username, class: "form-control" + + .form-group + = f.label :email, t("email"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :email, class: "form-control" + + .form-group + = f.label :guid, t("admins.user_entry.guid"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :guid, class: "form-control" + + .form-group + .col-sm-offset-2.col-sm-10 + = f.label :under13 do + = f.check_box :under13 + = t(".under_13") + .form-group + .clearfix.col-sm-12 + = submit_tag t("admins.stats.go"), class: "btn btn-primary pull-right block-admin" + + .more_invites.col-md-4 + %h3= t("shared.invitations.invites") + .clearfix#add-invites-section + != t(".you_currently", count: current_user.invitation_code.count, + link: link_to(t(".add_invites"), add_invites_path(current_user.invitation_code), + class: "btn btn-link pull-right block-admin")) + + = form_tag "admin_inviter", method: :get, class: "form-horizontal" do + .form-group + %label.col-sm-4.control-label + = t(".email_to") + .col-sm-8 + = text_field_tag "identifier", nil, class: "form-control" + .form-group + .clearfix.col-md-12 + = submit_tag t(".invite"), class: "btn btn-default pull-right block-admin" + + .row + .col-md-12 + .alert.alert-info.text-center{role: "alert"} + = t(".users", count: @users.count) + + .row + .users.col-md-12 + %ul.media-list + - @users.each do |user| + = render partial: "user_entry", locals: {user: user} diff --git a/app/views/admins/dashboard.html.haml b/app/views/admins/dashboard.html.haml index 326758301..7a61e5fe3 100644 --- a/app/views/admins/dashboard.html.haml +++ b/app/views/admins/dashboard.html.haml @@ -2,12 +2,4 @@ .row .col-md-3 = render partial: "admins/admin_bar" - .col-md-9 - #pod-status - %h2 - = t(".pod_status") - .alert.alert-info.pod-version{role: "alert"} - = t(".fetching_diaspora_version") - - if unreviewed_reports_count > 0 - .alert.alert-warning.reports-warning{role: "alert"} - = t("report.unreviewed_reports", count: unreviewed_reports_count) + = render partial: "admins/dashboard" diff --git a/app/views/admins/dashboard.mobile.haml b/app/views/admins/dashboard.mobile.haml index 52696e01b..0dbc94e97 100644 --- a/app/views/admins/dashboard.mobile.haml +++ b/app/views/admins/dashboard.mobile.haml @@ -1,9 +1 @@ -.col-md-9 - #pod-status - %h2 - = t(".pod_status") - .alert.alert-info.pod-version{role: "alert"} - = t(".fetching_diaspora_version") - - if unreviewed_reports_count > 0 - .alert.alert-warning.reports-warning{role: "alert"} - = t("report.unreviewed_reports", count: unreviewed_reports_count) += render partial: "admins/dashboard" diff --git a/app/views/admins/pods.mobile.haml b/app/views/admins/pods.mobile.haml index 6ef234b2f..1808cfac2 100644 --- a/app/views/admins/pods.mobile.haml +++ b/app/views/admins/pods.mobile.haml @@ -5,5 +5,4 @@ = t(".pod_network") .alert.alert-warning - = t(".pod_desktop_view") - = link_to t(".pod_desktop_link"), toggle_mobile_path + != t(".pod_desktop_view", desktop_link: link_to(t(".pod_desktop_link"), toggle_mobile_path)) diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index d2d5fcc5e..e108b1bed 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -2,59 +2,4 @@ .row .col-md-3 = render partial: "admins/admin_bar" - .col-md-9 - %h1= t('.usage_statistic') - - .pull-right - = form_tag('/admins/stats', :method => 'get', class: 'form-inline') do - %select.form-control{name: "range"} - %option{:value => 'daily', :selected => ('selected' if params[:range] == 'daily')} - = t('.daily') - %option{:value => 'week', :selected => ('selected' if params[:range] == 'week')} - = t('.week') - %option{:value => '2weeks', :selected => ('selected' if params[:range] == '2weeks')} - = t('.2weeks') - %option{:value => 'month', :selected => ('selected' if params[:range] == 'month')} - = t('.month') - - = submit_tag t('.go'), class: 'btn btn-primary' - - %h3 - != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) - - .row - - [:posts, :comments, :aspect_memberships, :users].each do |name| - - model = eval("@#{name.to_s}") - - if name == :aspect_memberships - - name = t('.shares', :count => model[:yesterday]) - - if name == :posts - - name = t('.posts', :count => model[:yesterday]) - - if name == :comments - - name = t('.comments', :count => model[:yesterday]) - - if name == :users - - name = t('.users', :count => model[:yesterday]) - - .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]}%)" - - .row - .col-md-12 - %p.alert.alert-info.text-center{role: "alert"} - != t("admins.stats.current_segment", - post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f), - post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) - - .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)) + = render partial: "admins/stats" diff --git a/app/views/admins/stats.mobile.haml b/app/views/admins/stats.mobile.haml index d4cf025b2..da4455fae 100644 --- a/app/views/admins/stats.mobile.haml +++ b/app/views/admins/stats.mobile.haml @@ -1,56 +1 @@ -.col-md-9 - %h1= t(".usage_statistic") - - %div - = form_tag("/admins/stats", method: "get", class: "form-inline") do - %select.form-control{name: "range"} - %option{value: "daily", selected: ("selected" if params[:range] == "daily")} - = t(".daily") - %option{value: "week", selected: ("selected" if params[:range] == "week")} - = t(".week") - %option{value: "2weeks", selected: ("selected" if params[:range] == "2weeks")} - = t(".2weeks") - %option{value: "month", selected: ("selected" if params[:range] == "month")} - = t(".month") - - = submit_tag t(".go"), class: "btn btn-primary btn-block" - - %h3 - != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) - - .row - - %i(posts comments aspect_memberships users).each do |name| - - model = instance_variable_get("@#{name}") - - if name == :aspect_memberships - - name = t(".shares", count: model[:yesterday]) - - if name == :posts - - name = t(".posts", count: model[:yesterday]) - - if name == :comments - - name = t(".comments", count: model[:yesterday]) - - if name == :users - - name = t(".users", count: model[:yesterday]) - - .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]}%)" - - .row - .col-md-12 - %p.alert.alert-info.text-center{role: "alert"} - != t("admins.stats.current_segment", - post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f), - post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) - - .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)) += render partial: "admins/stats" diff --git a/app/views/admins/user_entry.mobile.haml b/app/views/admins/user_entry.mobile.haml new file mode 100644 index 000000000..65f32991a --- /dev/null +++ b/app/views/admins/user_entry.mobile.haml @@ -0,0 +1 @@ += render partial: "user_entry" diff --git a/app/views/admins/user_search.html.haml b/app/views/admins/user_search.html.haml index 4be69152f..ce5edef4a 100644 --- a/app/views/admins/user_search.html.haml +++ b/app/views/admins/user_search.html.haml @@ -2,59 +2,4 @@ .row .col-md-3 = render partial: "admins/admin_bar" - .col-md-9 - .row - .user_search.col-md-8 - %h3= t('admins.admin_bar.user_search') - = form_for @search, url: {action: 'user_search'}, html: {method: :get, class: 'form-horizontal'} do |f| - .form-group - = f.label :username, t('username'), class: 'col-sm-2 control-label' - .col-sm-10 - = f.text_field :username, class: "form-control" - - .form-group - = f.label :email, t('email'), class: 'col-sm-2 control-label' - .col-sm-10 - = f.text_field :email, class: "form-control" - - .form-group - = f.label :guid, t('admins.user_entry.guid'), class: 'col-sm-2 control-label' - .col-sm-10 - = f.text_field :guid, class: "form-control" - - .form-group - .col-sm-offset-2.col-sm-10 - = f.label :under13 do - = f.check_box :under13 - = t(".under_13") - .form-group - .clearfix.col-sm-12 - = submit_tag t("admins.stats.go"), class: "btn btn-primary pull-right" - - .more_invites.col-md-4 - %h3= t("shared.invitations.invites") - #add-invites-section.clearfix - != t(".you_currently", count: current_user.invitation_code.count, - link: link_to(t(".add_invites"), add_invites_path(current_user.invitation_code), - class: "btn btn-link pull-right")) - - = form_tag "admin_inviter", method: :get, class: "form-horizontal" do - .form-group - %label.col-sm-4.control-label - = t(".email_to") - .col-sm-8 - = text_field_tag "identifier", nil, class: "form-control" - .form-group - .clearfix.col-md-12 - = submit_tag t(".invite"), class: "btn btn-default pull-right" - - .row - .col-md-12 - .alert.alert-info.text-center{role: "alert"} - = t(".users", count: @users.count) - - .row - .users.col-md-12 - %ul.media-list - - @users.each do |user| - = render partial: 'user_entry', locals: { user: user } + = render partial: "admins/user_search" diff --git a/app/views/admins/user_search.mobile.haml b/app/views/admins/user_search.mobile.haml index f7cc719e3..c832069b2 100644 --- a/app/views/admins/user_search.mobile.haml +++ b/app/views/admins/user_search.mobile.haml @@ -1,56 +1 @@ -.col-md-9 - .row - .user_search.col-md-8 - %h3= t("admins.admin_bar.user_search") - = form_for @search, url: {action: "user_search"}, html: {method: :get, class: "form-horizontal"} do |f| - .form-group - = f.label :username, t("username"), class: "col-sm-2 control-label" - .col-sm-10 - = f.text_field :username, class: "form-control" - - .form-group - = f.label :email, t("email"), class: "col-sm-2 control-label" - .col-sm-10 - = f.text_field :email, class: "form-control" - - .form-group - = f.label :guid, t("admins.user_entry.guid"), class: "col-sm-2 control-label" - .col-sm-10 - = f.text_field :guid, class: "form-control" - - .form-group - .col-sm-offset-2.col-sm-10 - = f.label :under13 do - = f.check_box :under13 - = t(".under_13") - .form-group - .clearfix.col-sm-12 - = submit_tag t("admins.stats.go"), class: "btn btn-primary btn-block" - - .more_invites.col-md-4 - %h3= t("shared.invitations.invites") - .clearfix#add-invites-section - != t(".you_currently", count: current_user.invitation_code.count, - link: link_to(t(".add_invites"), add_invites_path(current_user.invitation_code), - class: "btn btn-link pull-right")) - - = form_tag "admin_inviter", method: :get, class: "form-horizontal" do - .form-group - %label.col-sm-4.control-label - = t(".email_to") - .col-sm-8 - = text_field_tag "identifier", nil, class: "form-control" - .form-group - .clearfix.col-md-12 - = submit_tag t(".invite"), class: "btn btn-default btn-block" - - .row - .col-md-12 - .alert.alert-info.text-center{role: "alert"} - = t(".users", count: @users.count) - - .row - .users.col-md-12 - %ul.media-list - - @users.each do |user| - = render partial: "user_entry", locals: {user: user} += render partial: "admins/user_search" diff --git a/app/views/admins/weekly_user_stats.haml b/app/views/admins/weekly_user_stats.haml index fe2f88e35..64834f1ac 100644 --- a/app/views/admins/weekly_user_stats.haml +++ b/app/views/admins/weekly_user_stats.haml @@ -4,14 +4,14 @@ = render partial: "admins/admin_bar" .col-md-9 %h2 - = t('.current_server', date: Time.now.to_date) + = t(".current_server", date: Time.zone.now.to_date) .pull-right - = form_tag('/admins/weekly_user_stats', method: 'get', class: 'form-inline') do + = form_tag("/admins/weekly_user_stats", method: "get", class: "form-inline") do = select_tag(:week, options_for_select(@created_users_by_week.keys.reverse, @selected_week), class: "form-control") - = submit_tag t('admins.stats.go'), class: 'btn btn-primary' + = submit_tag t("admins.stats.go"), class: "btn btn-primary" - = t('.amount_of', count: @counter) + = t(".amount_of", count: @counter) %br - @created_users_by_week[@selected_week].each do |m| = link_to m, "/u/#{m}" diff --git a/app/views/layouts/_drawer.mobile.haml b/app/views/layouts/_drawer.mobile.haml index 57230c446..a0bfc1e48 100644 --- a/app/views/layouts/_drawer.mobile.haml +++ b/app/views/layouts/_drawer.mobile.haml @@ -36,6 +36,21 @@ %li= link_to t("_contacts"), contacts_path %li= link_to t("layouts.header.settings"), edit_user_path - if current_user.admin? - = render partial: "admins/admin_bar" + %li#admin + = link_to t("streams.admin.title"), "#" + %li.no-border.hide + %ul + %li= link_to t("admins.admin_bar.dashboard"), admin_dashboard_path + %li= link_to t("admins.admin_bar.user_search"), user_search_path + %li= link_to t("admins.admin_bar.weekly_user_stats"), weekly_user_stats_path + %li= link_to t("admins.admin_bar.pod_stats"), pod_stats_path + %li{role: "presentation", class: current_page?(report_index_path)} + %a{href: report_index_path} + - if unreviewed_reports_count > 0 + .pull-right.badge + = unreviewed_reports_count + = t("admins.admin_bar.report") + %li= link_to t("admins.admin_bar.pod_network"), admin_pods_path + %li= link_to t("admins.admin_bar.sidekiq_monitor"), sidekiq_path %li= link_to t("layouts.application.toggle"), toggle_mobile_path %li= link_to t("layouts.header.logout"), destroy_user_session_path, method: :delete diff --git a/app/views/report/_reports.haml b/app/views/report/_reports.haml new file mode 100644 index 000000000..3f5902283 --- /dev/null +++ b/app/views/report/_reports.haml @@ -0,0 +1,39 @@ +.col-md-9 + #reports + %h1 + = t("report.title") + - @reports.each do |report| + - if report.item + .panel.panel-default + - username = report.user.username + .panel-heading + .reporter.pull-right + = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) + .reason + %span.reason-label + = t("report.reason_label") + %span + = report.text + .panel-body + .content + = report_content(report) + + = button_to t("report.reported_user_details"), + user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), + class: "btn pull-left btn-info btn-small", method: :post + = button_to t("report.review_link"), report_path(report.id, type: report.item_type), + class: "btn pull-left btn-info btn-small", method: :put + = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), + data: {confirm: t("report.confirm_deletion")}, + class: "btn pull-right btn-danger btn-small", method: :delete + - else + .panel.panel-default + - username = report.user.username + .panel-heading + .reporter.pull-right + = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) + .title + = report_content(report) + .panel-body + = button_to t("report.review_link"), report_path(report.id, type: report.item_type), + class: "btn pull-left btn-info btn-small", method: :put diff --git a/app/views/report/index.html.haml b/app/views/report/index.html.haml index 219ad34ba..2f6106793 100644 --- a/app/views/report/index.html.haml +++ b/app/views/report/index.html.haml @@ -6,42 +6,4 @@ .col-md-3 - if current_user.admin? = render partial: "admins/admin_bar" - .col-md-9 - #reports - %h1 - = t("report.title") - - @reports.each do |report| - - if report.item - .panel.panel-default - - username = report.user.username - .panel-heading - .reporter.pull-right - = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) - .reason - %span.reason-label - = t("report.reason_label") - %span - = report.text - .panel-body - .content - = report_content(report) - - = button_to t("report.reported_user_details"), - user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), - class: "btn pull-left btn-info btn-small", method: :post - = button_to t("report.review_link"), report_path(report.id, type: report.item_type), - class: "btn pull-left btn-info btn-small", method: :put - = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), - data: {confirm: t("report.confirm_deletion")}, - class: "btn pull-right btn-danger btn-small", method: :delete - - else - .panel.panel-default - - username = report.user.username - .panel-heading - .reporter.pull-right - = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) - .title - = report_content(report) - .panel-body - = button_to t("report.review_link"), report_path(report.id, type: report.item_type), - class: "btn pull-left btn-info btn-small", method: :put + = render partial: "report/reports" diff --git a/app/views/report/index.mobile.haml b/app/views/report/index.mobile.haml index 3f5902283..6f28a776d 100644 --- a/app/views/report/index.mobile.haml +++ b/app/views/report/index.mobile.haml @@ -1,39 +1 @@ -.col-md-9 - #reports - %h1 - = t("report.title") - - @reports.each do |report| - - if report.item - .panel.panel-default - - username = report.user.username - .panel-heading - .reporter.pull-right - = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) - .reason - %span.reason-label - = t("report.reason_label") - %span - = report.text - .panel-body - .content - = report_content(report) - - = button_to t("report.reported_user_details"), - user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), - class: "btn pull-left btn-info btn-small", method: :post - = button_to t("report.review_link"), report_path(report.id, type: report.item_type), - class: "btn pull-left btn-info btn-small", method: :put - = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), - data: {confirm: t("report.confirm_deletion")}, - class: "btn pull-right btn-danger btn-small", method: :delete - - else - .panel.panel-default - - username = report.user.username - .panel-heading - .reporter.pull-right - = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) - .title - = report_content(report) - .panel-body - = button_to t("report.review_link"), report_path(report.id, type: report.item_type), - class: "btn pull-left btn-info btn-small", method: :put += render partial: "report/reports" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 3d5f156f7..f1242cfe3 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -160,8 +160,8 @@ en: tag_name: "Tag name: %{name_tag} Count: %{count_tag}" pods: pod_network: "Pod network" - pod_desktop_view: "This page is not available on mobile view, please switch to" - pod_desktop_link: "desktop view." + pod_desktop_view: "This page is not available on mobile view, please switch to %{desktop_link}." + pod_desktop_link: "desktop view" aspects: edit: confirm_remove_aspect: "Are you sure you want to delete this aspect?" @@ -1134,6 +1134,9 @@ en: follow: "Follow" all: "All tags" + admin: + title: "Admin" + tags: title: "Posts tagged: %{tags}" From 7bdf33e1a8cf961ad52bd5bed257ab1f35e1ae50 Mon Sep 17 00:00:00 2001 From: flaburgan Date: Thu, 16 Mar 2017 12:46:59 +0100 Subject: [PATCH 03/12] Move invitation form under the user search in admin Indicates when there is no report to review to avoid a weird empty page --- app/views/admins/_dashboard.haml | 3 +++ app/views/admins/_user_search.haml | 27 ++++++++++++++------------- app/views/report/_reports.haml | 3 +++ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app/views/admins/_dashboard.haml b/app/views/admins/_dashboard.haml index f861448cb..180c5c062 100644 --- a/app/views/admins/_dashboard.haml +++ b/app/views/admins/_dashboard.haml @@ -10,3 +10,6 @@ - if unreviewed_reports_count > 0 .alert.alert-warning.reports-warning{role: "alert"} = t("report.unreviewed_reports", count: unreviewed_reports_count) + - else + %p + = t("report.unreviewed_reports", count: 0) diff --git a/app/views/admins/_user_search.haml b/app/views/admins/_user_search.haml index 54fa550cf..6860f0fd5 100644 --- a/app/views/admins/_user_search.haml +++ b/app/views/admins/_user_search.haml @@ -1,6 +1,6 @@ .col-md-9 .row - .user_search.col-md-8 + .user_search.col-md-12 %h3= t("admins.admin_bar.user_search") = form_for @search, url: {action: "user_search"}, html: {method: :get, class: "form-horizontal"} do |f| .form-group @@ -27,7 +27,19 @@ .clearfix.col-sm-12 = submit_tag t("admins.stats.go"), class: "btn btn-primary pull-right block-admin" - .more_invites.col-md-4 + .row + .col-md-12 + .alert.alert-info.text-center{role: "alert"} + = t(".users", count: @users.count) + + .row + .users.col-md-12 + %ul.media-list + - @users.each do |user| + = render partial: "user_entry", locals: {user: user} + + .row + .more_invites.col-md-12 %h3= t("shared.invitations.invites") .clearfix#add-invites-section != t(".you_currently", count: current_user.invitation_code.count, @@ -43,14 +55,3 @@ .form-group .clearfix.col-md-12 = submit_tag t(".invite"), class: "btn btn-default pull-right block-admin" - - .row - .col-md-12 - .alert.alert-info.text-center{role: "alert"} - = t(".users", count: @users.count) - - .row - .users.col-md-12 - %ul.media-list - - @users.each do |user| - = render partial: "user_entry", locals: {user: user} diff --git a/app/views/report/_reports.haml b/app/views/report/_reports.haml index 3f5902283..8af854238 100644 --- a/app/views/report/_reports.haml +++ b/app/views/report/_reports.haml @@ -2,6 +2,9 @@ #reports %h1 = t("report.title") + - if @reports.size == 0 + %p + = t("report.unreviewed_reports", count: 0) - @reports.each do |report| - if report.item .panel.panel-default From a7d97b7fd3f6f6455f8b04f4eea09b2c2d2ea623 Mon Sep 17 00:00:00 2001 From: flaburgan Date: Thu, 16 Mar 2017 17:46:16 +0100 Subject: [PATCH 04/12] Add mobile message confirmation on user invit action, Refactor admin responsive code to use bootstrap grid Hide pod version alert only in the mobile version, not depending on screen size --- app/assets/stylesheets/admin.scss | 21 +++++- app/assets/stylesheets/mobile/admins.scss | 28 ------- app/assets/stylesheets/mobile/mobile.scss | 7 +- app/assets/stylesheets/report.scss | 12 --- app/views/admins/_admin_bar.haml | 4 +- app/views/admins/_dashboard.haml | 5 +- app/views/admins/_stats.haml | 34 +++++---- app/views/admins/_user_entry.haml | 90 +++++++++++------------ app/views/admins/_user_search.haml | 19 ++--- app/views/admins/dashboard.mobile.haml | 3 + app/views/admins/pods.html.haml | 3 + app/views/admins/user_search.mobile.haml | 5 ++ app/views/report/_reports.haml | 30 ++++---- app/views/report/index.html.haml | 3 - 14 files changed, 128 insertions(+), 136 deletions(-) delete mode 100644 app/assets/stylesheets/mobile/admins.scss delete mode 100644 app/assets/stylesheets/report.scss diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index ea933e6e6..8d1d1cd3c 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -16,10 +16,9 @@ .avatar { width: 50px; height: 50px; + max-width: none; } - .actions{ width: 150px; } - .pull-right .label{ display: inline-block; } } } @@ -32,9 +31,25 @@ } } +// Pod stats +.segment-selection { + select, + [type=submit] { + margin-top: 10px; + } +} + /** reported posts **/ -@import 'report'; +.reports { + .reason-label { + font-weight: bold; + } + + .content { + padding-bottom: 20px; + } +} /** pod list **/ diff --git a/app/assets/stylesheets/mobile/admins.scss b/app/assets/stylesheets/mobile/admins.scss deleted file mode 100644 index f59c091f3..000000000 --- a/app/assets/stylesheets/mobile/admins.scss +++ /dev/null @@ -1,28 +0,0 @@ -#app { - .pull-right, - input { - margin-bottom: 5px; - margin-top: 5px; - } -} - -#admin-nav li a { - &:hover, - &:focus { - background-color: $gray-light; - } -} - -@media(max-width: $screen-xs-max) { - #app { - .block-admin { - display: block; - float: none; - font-size: 13px; - margin-bottom: 5px; - margin-top: 5px; - padding: 6px 12px; - width: 100%; - } - } -} diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index fbc4873ef..9b7d24466 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -16,7 +16,6 @@ @import "mobile/stream_element"; @import "mobile/comments"; @import 'mobile/openid_connect_error_page'; -@import 'mobile/admins'; @import 'typography'; @@ -886,3 +885,9 @@ select#aspect_ids_ { .form-control:active, .form-control:focus { border-color: #999999; } .tag_following_action { margin: 5px 0 10px 0; } + +/* --- Admin pages --- */ +.pod-version { + // The fetching of the pod version is not done on mobile currently so we hide this alert. + display: none; +} diff --git a/app/assets/stylesheets/report.scss b/app/assets/stylesheets/report.scss deleted file mode 100644 index c3a5f62eb..000000000 --- a/app/assets/stylesheets/report.scss +++ /dev/null @@ -1,12 +0,0 @@ -#reports { - .reason-label { - font-weight: bold; - } - - .content { - padding-bottom: 20px; - } - form input { - margin-right: 5px; - } -} diff --git a/app/views/admins/_admin_bar.haml b/app/views/admins/_admin_bar.haml index dd9be53b8..698fd2da9 100644 --- a/app/views/admins/_admin_bar.haml +++ b/app/views/admins/_admin_bar.haml @@ -1,6 +1,4 @@ -- content_for :head do - = stylesheet_link_tag :admin - +%h2= t(".pages") %ul.nav.nav-pills.nav-stacked#admin-nav %li{role: "presentation", class: current_page?(admin_dashboard_path) && "active"} = link_to t(".dashboard"), admin_dashboard_path diff --git a/app/views/admins/_dashboard.haml b/app/views/admins/_dashboard.haml index 180c5c062..0fcdc3568 100644 --- a/app/views/admins/_dashboard.haml +++ b/app/views/admins/_dashboard.haml @@ -1,11 +1,8 @@ -- content_for :head do - = stylesheet_link_tag :admin - .col-md-9 #pod-status %h2 = t(".pod_status") - .alert.alert-info.pod-version.hidden-xs{role: "alert"} + .alert.alert-info.pod-version{role: "alert"} = t(".fetching_diaspora_version") - if unreviewed_reports_count > 0 .alert.alert-warning.reports-warning{role: "alert"} diff --git a/app/views/admins/_stats.haml b/app/views/admins/_stats.haml index 0c29ee991..30f2293e4 100644 --- a/app/views/admins/_stats.haml +++ b/app/views/admins/_stats.haml @@ -1,21 +1,27 @@ +- content_for :head do + = stylesheet_link_tag :admin + .col-md-9 %h1= t(".usage_statistic") - .pull-right.block-admin - = form_tag("/admins/stats", method: "get", class: "form-inline") do - %select.form-control{name: "range"} - %option{value: "daily", selected: ("selected" if params[:range] == "daily")} - = t(".daily") - %option{value: "week", selected: ("selected" if params[:range] == "week")} - = t(".week") - %option{value: "2weeks", selected: ("selected" if params[:range] == "2weeks")} - = t(".2weeks") - %option{value: "month", selected: ("selected" if params[:range] == "month")} - = t(".month") + .row + = form_tag("/admins/stats", method: "get", class: "form-inline segment-selection") do + .col-sm-2.col-sm-push-8 + %select.form-control{name: "range"} + %option{value: "daily", selected: ("selected" if params[:range] == "daily")} + = t(".daily") + %option{value: "week", selected: ("selected" if params[:range] == "week")} + = t(".week") + %option{value: "2weeks", selected: ("selected" if params[:range] == "2weeks")} + = t(".2weeks") + %option{value: "month", selected: ("selected" if params[:range] == "month")} + = t(".month") + .col-sm-2.col-sm-push-8 + = submit_tag t(".go"), class: "btn btn-primary btn-block" - = submit_tag t(".go"), class: "btn btn-primary block-admin" - %h3 - != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) + .col-sm-8.col-sm-pull-4 + %h4 + != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) .row - %i(posts comments aspect_memberships users).each do |name| diff --git a/app/views/admins/_user_entry.haml b/app/views/admins/_user_entry.haml index 24f3d3b3f..e25294953 100644 --- a/app/views/admins/_user_entry.haml +++ b/app/views/admins/_user_entry.haml @@ -1,52 +1,23 @@ - %li.user.media - .pull-left + .media-left - if user.person - %span.media-object + .media-object = person_image_tag(user.person, size: :thumb_small) - - .media-body.row - .pull-right - %span.label.label-default - = t(".id") - = user.id - %span.label.label-info - = t(".guid") - = user.person.guid if user.person - - %h4.media-heading - = user.person.name if user.person - - .pull-right.block-admin - .unstyled.text-right.actions - = link_to t("admins.user_search.view_profile"), - person_path(user.person), - class: "btn btn-default btn-block block-admin btn-xs" - = link_to t("admins.user_search.add_invites"), - add_invites_path(user.invitation_code), - class: "btn btn-info btn-block block-admin btn-xs" - - unless user.person.closed_account - = link_to t("admins.user_search.close_account"), - admin_close_account_path(user), - method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, - class: "btn btn-danger btn-block block-admin btn-xs" - - - unless user.closed_account? - - unless user.access_locked? - = link_to t("admins.user_search.lock_account"), - admin_lock_account_path(user), - method: :post, - data: {confirm: t("admins.user_search.are_you_sure_lock_account")}, - class: "btn btn-danger btn-block block-admin btn-xs" - - else - = link_to t("admins.user_search.unlock_account"), - admin_unlock_account_path(user), - method: :post, - data: {confirm: t("admins.user_search.are_you_sure_unlock_account")}, - class: "btn btn-danger btn-block block-admin btn-xs" - + .media-body .row - .col-md-5 + .col-sm-7 + %h4.media-heading + = user.try(:person).try(:name) + .col-sm-5 + .pull-right + %span.label.label-default + = t(".id") + = user.id + %span.label.label-info + = t(".guid") + = user.try(:person).try(:guid) + .row + .col-sm-8 %dl.dl-horizontal %dt= t("username") %dd= user.username @@ -56,7 +27,7 @@ %dd= user.person.diaspora_handle %dt= t(".last_seen") %dd= user.last_seen || t(".unknown") - -if user.invited_by.present? + - if user.invited_by.present? %dt= t(".invite_token") %dd= invite_code_url(user.invited_by.invitation_code) %dt= t(".account_closed") @@ -83,3 +54,30 @@ %dd= user.person.profile.location %dt= t("people.profile_sidebar.bio") %dd= user.person.profile.bio + + .col-sm-4 + = link_to t("admins.user_search.view_profile"), + person_path(user.person), + class: "btn btn-default btn-block" + = link_to t("admins.user_search.add_invites"), + add_invites_path(user.invitation_code), + class: "btn btn-info btn-block" + - unless user.person.closed_account + = link_to t("admins.user_search.close_account"), + admin_close_account_path(user), + method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, + class: "btn btn-danger btn-block" + + - unless user.closed_account? + - if user.access_locked? + = link_to t("admins.user_search.unlock_account"), + admin_unlock_account_path(user), + method: :post, + data: {confirm: t("admins.user_search.are_you_sure_unlock_account")}, + class: "btn btn-danger btn-block" + - else + = link_to t("admins.user_search.lock_account"), + admin_lock_account_path(user), + method: :post, + data: {confirm: t("admins.user_search.are_you_sure_lock_account")}, + class: "btn btn-danger btn-block" diff --git a/app/views/admins/_user_search.haml b/app/views/admins/_user_search.haml index 6860f0fd5..8b61b30ef 100644 --- a/app/views/admins/_user_search.haml +++ b/app/views/admins/_user_search.haml @@ -1,3 +1,6 @@ +- content_for :head do + = stylesheet_link_tag :admin + .col-md-9 .row .user_search.col-md-12 @@ -19,13 +22,12 @@ = f.text_field :guid, class: "form-control" .form-group - .col-sm-offset-2.col-sm-10 + .col-md-offset-2.col-md-8.col-sm-12 = f.label :under13 do = f.check_box :under13 = t(".under_13") - .form-group - .clearfix.col-sm-12 - = submit_tag t("admins.stats.go"), class: "btn btn-primary pull-right block-admin" + .col-md-2.col-sm-12 + = submit_tag t("admins.stats.go"), class: "btn btn-block btn-primary" .row .col-md-12 @@ -48,10 +50,9 @@ = form_tag "admin_inviter", method: :get, class: "form-horizontal" do .form-group - %label.col-sm-4.control-label + %label.col-xs-12.col-md-2.control-label = t(".email_to") - .col-sm-8 + .col-xs-12.col-md-8 = text_field_tag "identifier", nil, class: "form-control" - .form-group - .clearfix.col-md-12 - = submit_tag t(".invite"), class: "btn btn-default pull-right block-admin" + .col-xs-12.col-md-2 + = submit_tag t(".invite"), class: "btn btn-block btn-primary" diff --git a/app/views/admins/dashboard.mobile.haml b/app/views/admins/dashboard.mobile.haml index 0dbc94e97..c04c63648 100644 --- a/app/views/admins/dashboard.mobile.haml +++ b/app/views/admins/dashboard.mobile.haml @@ -1 +1,4 @@ +- content_for :head do + = stylesheet_link_tag :admin + = render partial: "admins/dashboard" diff --git a/app/views/admins/pods.html.haml b/app/views/admins/pods.html.haml index cb7058543..d37e6e1db 100644 --- a/app/views/admins/pods.html.haml +++ b/app/views/admins/pods.html.haml @@ -1,3 +1,6 @@ +- content_for :head do + = stylesheet_link_tag :admin + .container .row .col-md-3 diff --git a/app/views/admins/user_search.mobile.haml b/app/views/admins/user_search.mobile.haml index c832069b2..f98ad6f6a 100644 --- a/app/views/admins/user_search.mobile.haml +++ b/app/views/admins/user_search.mobile.haml @@ -1 +1,6 @@ +- flash.each do |name, msg| + .expose#flash-container + .flash-message{class: "message alert alert-#{flash_class name}", role: "alert"} + = msg + = render partial: "admins/user_search" diff --git a/app/views/report/_reports.haml b/app/views/report/_reports.haml index 8af854238..86a6325cf 100644 --- a/app/views/report/_reports.haml +++ b/app/views/report/_reports.haml @@ -1,8 +1,12 @@ +- content_for :head do + = stylesheet_link_tag :admin + = stylesheet_link_tag :report + .col-md-9 - #reports + .reports %h1 = t("report.title") - - if @reports.size == 0 + - if @reports.empty? %p = t("report.unreviewed_reports", count: 0) - @reports.each do |report| @@ -11,7 +15,7 @@ - username = report.user.username .panel-heading .reporter.pull-right - = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) + != t("report.reported_label", person: link_to(username, user_profile_path(username))) .reason %span.reason-label = t("report.reason_label") @@ -20,21 +24,21 @@ .panel-body .content = report_content(report) - - = button_to t("report.reported_user_details"), - user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), - class: "btn pull-left btn-info btn-small", method: :post - = button_to t("report.review_link"), report_path(report.id, type: report.item_type), - class: "btn pull-left btn-info btn-small", method: :put - = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), - data: {confirm: t("report.confirm_deletion")}, - class: "btn pull-right btn-danger btn-small", method: :delete + .segment-selection + = button_to t("report.reported_user_details"), + user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), + class: "btn pull-left btn-info btn-small col-md-3 col-xs-12", method: :post + = button_to t("report.review_link"), report_path(report.id, type: report.item_type), + class: "btn pull-left btn-info btn-small col-md-3 col-xs-12", method: :put + = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), + data: {confirm: t("report.confirm_deletion")}, + class: "btn pull-right btn-danger btn-small col-md-3 col-xs-12", method: :delete - else .panel.panel-default - username = report.user.username .panel-heading .reporter.pull-right - = raw t("report.reported_label", person: link_to(username, user_profile_path(username))) + != t("report.reported_label", person: link_to(username, user_profile_path(username))) .title = report_content(report) .panel-body diff --git a/app/views/report/index.html.haml b/app/views/report/index.html.haml index 2f6106793..28956fba5 100644 --- a/app/views/report/index.html.haml +++ b/app/views/report/index.html.haml @@ -1,6 +1,3 @@ -- content_for :head do - = stylesheet_link_tag :admin - .container .row .col-md-3 From 2782edc780f9c737a6d5d459c51cc741ae632909 Mon Sep 17 00:00:00 2001 From: flaburgan Date: Wed, 10 May 2017 13:18:49 +0200 Subject: [PATCH 05/12] Refactor partials + pronto --- .../javascripts/mobile/mobile_drawer.js | 2 +- app/assets/stylesheets/admin.scss | 9 ++ app/assets/stylesheets/mobile/mobile.scss | 2 +- app/controllers/admin/pods_controller.rb | 1 - app/views/admins/_dashboard.haml | 23 +++-- app/views/admins/_stats.haml | 95 ++++++++----------- app/views/admins/_user_entry.haml | 2 - app/views/admins/_user_search.haml | 95 +++++++++---------- app/views/admins/_weekly_user_stats.haml | 21 ++++ app/views/admins/dashboard.html.haml | 3 +- app/views/admins/dashboard.mobile.haml | 3 - app/views/admins/pods.mobile.haml | 11 +-- app/views/admins/stats.html.haml | 3 +- app/views/admins/user_entry.mobile.haml | 1 - app/views/admins/user_search.html.haml | 3 +- app/views/admins/weekly_user_stats.haml | 14 +-- .../admins/weekly_user_stats.mobile.haml | 18 +--- app/views/layouts/_drawer.mobile.haml | 2 +- app/views/report/_reports.haml | 82 ++++++++-------- app/views/report/index.html.haml | 3 +- 20 files changed, 187 insertions(+), 206 deletions(-) create mode 100644 app/views/admins/_weekly_user_stats.haml delete mode 100644 app/views/admins/user_entry.mobile.haml diff --git a/app/assets/javascripts/mobile/mobile_drawer.js b/app/assets/javascripts/mobile/mobile_drawer.js index 4689c5660..f20cb5bf3 100644 --- a/app/assets/javascripts/mobile/mobile_drawer.js +++ b/app/assets/javascripts/mobile/mobile_drawer.js @@ -5,7 +5,7 @@ evt.preventDefault(); $("#app").toggleClass("draw"); }); - $("#all_aspects, #followed_tags, #admin").bind("tap click", function(evt) { + $("#all_aspects, #followed_tags, #admin").bind("tap click", function(evt) { evt.preventDefault(); $(this).find("+ li").toggleClass("hide"); }); diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 8d1d1cd3c..e85694a08 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -31,6 +31,11 @@ } } +// Weekly stats +.week-selector { + margin-top: 18px; +} + // Pod stats .segment-selection { select, @@ -49,6 +54,10 @@ .content { padding-bottom: 20px; } + + .panel-body .btn-info { + margin-right: 5px; + } } /** pod list **/ diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index 9b7d24466..e9d612991 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -886,7 +886,7 @@ select#aspect_ids_ { .tag_following_action { margin: 5px 0 10px 0; } -/* --- Admin pages --- */ +// --- Admin pages --- .pod-version { // The fetching of the pod version is not done on mobile currently so we hide this alert. display: none; diff --git a/app/controllers/admin/pods_controller.rb b/app/controllers/admin/pods_controller.rb index 739740831..309ee3861 100644 --- a/app/controllers/admin/pods_controller.rb +++ b/app/controllers/admin/pods_controller.rb @@ -27,7 +27,6 @@ module Admin respond_with do |format| format.html { redirect_to admin_pods_path } format.json { render json: PodPresenter.new(pod).as_json } - format.mobile { redirect_to admin_pods_path } end end end diff --git a/app/views/admins/_dashboard.haml b/app/views/admins/_dashboard.haml index 0fcdc3568..503162dbe 100644 --- a/app/views/admins/_dashboard.haml +++ b/app/views/admins/_dashboard.haml @@ -1,12 +1,11 @@ -.col-md-9 - #pod-status - %h2 - = t(".pod_status") - .alert.alert-info.pod-version{role: "alert"} - = t(".fetching_diaspora_version") - - if unreviewed_reports_count > 0 - .alert.alert-warning.reports-warning{role: "alert"} - = t("report.unreviewed_reports", count: unreviewed_reports_count) - - else - %p - = t("report.unreviewed_reports", count: 0) +#pod-status + %h2 + = t(".pod_status") + .alert.alert-info.pod-version{role: "alert"} + = t(".fetching_diaspora_version") + - if unreviewed_reports_count > 0 + .alert.alert-warning.reports-warning{role: "alert"} + = t("report.unreviewed_reports", count: unreviewed_reports_count) + - else + %p + = t("report.unreviewed_reports", count: 0) diff --git a/app/views/admins/_stats.haml b/app/views/admins/_stats.haml index 30f2293e4..ff8aa08f9 100644 --- a/app/views/admins/_stats.haml +++ b/app/views/admins/_stats.haml @@ -1,61 +1,50 @@ - content_for :head do = stylesheet_link_tag :admin -.col-md-9 - %h1= t(".usage_statistic") +%h1= t(".usage_statistic") - .row - = form_tag("/admins/stats", method: "get", class: "form-inline segment-selection") do - .col-sm-2.col-sm-push-8 - %select.form-control{name: "range"} - %option{value: "daily", selected: ("selected" if params[:range] == "daily")} - = t(".daily") - %option{value: "week", selected: ("selected" if params[:range] == "week")} - = t(".week") - %option{value: "2weeks", selected: ("selected" if params[:range] == "2weeks")} - = t(".2weeks") - %option{value: "month", selected: ("selected" if params[:range] == "month")} - = t(".month") - .col-sm-2.col-sm-push-8 - = 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"} + - ["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 + .col-sm-8.col-sm-pull-4 + %h4 + != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) + +.row + - %i(posts comments aspect_memberships users).each do |name| + - model = instance_variable_get("@#{name}") + - if name == :aspect_memberships + - name = t(".shares", count: model[:yesterday]) + - else + - name = t(".#{name}", count: model[:yesterday]) + + .col-md-3 + %h2{style: "font-weight:bold;"} + = name.to_s %h4 - != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) + = model[:day_before] + %span.percent_change{class: (model[:change] > 0 ? "green" : "red")} + = "(#{model[:change]}%)" - .row - - %i(posts comments aspect_memberships users).each do |name| - - model = instance_variable_get("@#{name}") - - if name == :aspect_memberships - - name = t(".shares", count: model[:yesterday]) - - if name == :posts - - name = t(".posts", count: model[:yesterday]) - - if name == :comments - - name = t(".comments", count: model[:yesterday]) - - if name == :users - - name = t(".users", count: model[:yesterday]) +.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.to_f), + post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) - .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]}%)" - - .row - .col-md-12 - %p.alert.alert-info.text-center{role: "alert"} - != t("admins.stats.current_segment", - post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f), - post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) - - .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_entry.haml b/app/views/admins/_user_entry.haml index e25294953..3ab517836 100644 --- a/app/views/admins/_user_entry.haml +++ b/app/views/admins/_user_entry.haml @@ -67,8 +67,6 @@ admin_close_account_path(user), method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, class: "btn btn-danger btn-block" - - - unless user.closed_account? - if user.access_locked? = link_to t("admins.user_search.unlock_account"), admin_unlock_account_path(user), diff --git a/app/views/admins/_user_search.haml b/app/views/admins/_user_search.haml index 8b61b30ef..44fbcc8b5 100644 --- a/app/views/admins/_user_search.haml +++ b/app/views/admins/_user_search.haml @@ -1,58 +1,57 @@ - content_for :head do = stylesheet_link_tag :admin -.col-md-9 - .row - .user_search.col-md-12 - %h3= t("admins.admin_bar.user_search") - = form_for @search, url: {action: "user_search"}, html: {method: :get, class: "form-horizontal"} do |f| - .form-group - = f.label :username, t("username"), class: "col-sm-2 control-label" - .col-sm-10 - = f.text_field :username, class: "form-control" +.row + .user_search.col-md-12 + %h3= t("admins.admin_bar.user_search") + = form_for @search, url: {action: "user_search"}, html: {method: :get, class: "form-horizontal"} do |f| + .form-group + = f.label :username, t("username"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :username, class: "form-control" - .form-group - = f.label :email, t("email"), class: "col-sm-2 control-label" - .col-sm-10 - = f.text_field :email, class: "form-control" + .form-group + = f.label :email, t("email"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :email, class: "form-control" - .form-group - = f.label :guid, t("admins.user_entry.guid"), class: "col-sm-2 control-label" - .col-sm-10 - = f.text_field :guid, class: "form-control" + .form-group + = f.label :guid, t("admins.user_entry.guid"), class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :guid, class: "form-control" - .form-group - .col-md-offset-2.col-md-8.col-sm-12 - = f.label :under13 do - = f.check_box :under13 - = t(".under_13") - .col-md-2.col-sm-12 - = submit_tag t("admins.stats.go"), class: "btn btn-block btn-primary" + .form-group + .col-md-offset-2.col-md-8.col-sm-12 + = f.label :under13 do + = f.check_box :under13 + = t(".under_13") + .col-md-2.col-sm-12 + = submit_tag t("admins.stats.go"), class: "btn btn-block btn-primary" - .row - .col-md-12 - .alert.alert-info.text-center{role: "alert"} - = t(".users", count: @users.count) +.row + .col-md-12 + .alert.alert-info.text-center{role: "alert"} + = t(".users", count: @users.count) - .row - .users.col-md-12 - %ul.media-list - - @users.each do |user| - = render partial: "user_entry", locals: {user: user} +.row + .users.col-md-12 + %ul.media-list + - @users.each do |user| + = render partial: "user_entry", locals: {user: user} - .row - .more_invites.col-md-12 - %h3= t("shared.invitations.invites") - .clearfix#add-invites-section - != t(".you_currently", count: current_user.invitation_code.count, - link: link_to(t(".add_invites"), add_invites_path(current_user.invitation_code), - class: "btn btn-link pull-right block-admin")) +.row + .more_invites.col-md-12 + %h3= t("shared.invitations.invites") + .clearfix#add-invites-section + != t(".you_currently", count: current_user.invitation_code.count, + link: link_to(t(".add_invites"), add_invites_path(current_user.invitation_code), + class: "btn btn-link pull-right block-admin")) - = form_tag "admin_inviter", method: :get, class: "form-horizontal" do - .form-group - %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" - .col-xs-12.col-md-2 - = submit_tag t(".invite"), class: "btn btn-block btn-primary" + = form_tag "admin_inviter", method: :get, class: "form-horizontal" do + .form-group + %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" + .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 new file mode 100644 index 000000000..2b1f29997 --- /dev/null +++ b/app/views/admins/_weekly_user_stats.haml @@ -0,0 +1,21 @@ +- content_for :head do + = stylesheet_link_tag :admin + +.row + .col-md-9.col-xs-12 + %h2 + = t(".current_server", date: Time.zone.now.to_date) + + .col-md-3.col-xs-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.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| + = link_to m, "/u/#{m}" diff --git a/app/views/admins/dashboard.html.haml b/app/views/admins/dashboard.html.haml index 7a61e5fe3..13f0f70d6 100644 --- a/app/views/admins/dashboard.html.haml +++ b/app/views/admins/dashboard.html.haml @@ -2,4 +2,5 @@ .row .col-md-3 = render partial: "admins/admin_bar" - = render partial: "admins/dashboard" + .col-md-9 + = render partial: "admins/dashboard" diff --git a/app/views/admins/dashboard.mobile.haml b/app/views/admins/dashboard.mobile.haml index c04c63648..0dbc94e97 100644 --- a/app/views/admins/dashboard.mobile.haml +++ b/app/views/admins/dashboard.mobile.haml @@ -1,4 +1 @@ -- content_for :head do - = stylesheet_link_tag :admin - = render partial: "admins/dashboard" diff --git a/app/views/admins/pods.mobile.haml b/app/views/admins/pods.mobile.haml index 1808cfac2..97a3ceeb7 100644 --- a/app/views/admins/pods.mobile.haml +++ b/app/views/admins/pods.mobile.haml @@ -1,8 +1,5 @@ -.container - .row - .col-md-9 - %h2 - = t(".pod_network") +%h2 + = t(".pod_network") - .alert.alert-warning - != t(".pod_desktop_view", desktop_link: link_to(t(".pod_desktop_link"), toggle_mobile_path)) +.alert.alert-warning + != t(".pod_desktop_view", desktop_link: link_to(t(".pod_desktop_link"), toggle_mobile_path)) diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index e108b1bed..0416b0e79 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -2,4 +2,5 @@ .row .col-md-3 = render partial: "admins/admin_bar" - = render partial: "admins/stats" + .col-md-9 + = render partial: "admins/stats" diff --git a/app/views/admins/user_entry.mobile.haml b/app/views/admins/user_entry.mobile.haml deleted file mode 100644 index 65f32991a..000000000 --- a/app/views/admins/user_entry.mobile.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: "user_entry" diff --git a/app/views/admins/user_search.html.haml b/app/views/admins/user_search.html.haml index ce5edef4a..747ef16b1 100644 --- a/app/views/admins/user_search.html.haml +++ b/app/views/admins/user_search.html.haml @@ -2,4 +2,5 @@ .row .col-md-3 = render partial: "admins/admin_bar" - = render partial: "admins/user_search" + .col-md-9 + = render partial: "admins/user_search" diff --git a/app/views/admins/weekly_user_stats.haml b/app/views/admins/weekly_user_stats.haml index 64834f1ac..b734c47c9 100644 --- a/app/views/admins/weekly_user_stats.haml +++ b/app/views/admins/weekly_user_stats.haml @@ -3,16 +3,4 @@ .col-md-3 = render partial: "admins/admin_bar" .col-md-9 - %h2 - = t(".current_server", date: Time.zone.now.to_date) - - .pull-right - = form_tag("/admins/weekly_user_stats", method: "get", class: "form-inline") do - = select_tag(:week, options_for_select(@created_users_by_week.keys.reverse, @selected_week), class: "form-control") - = 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| - = link_to m, "/u/#{m}" - %br + = render partial: "admins/weekly_user_stats" diff --git a/app/views/admins/weekly_user_stats.mobile.haml b/app/views/admins/weekly_user_stats.mobile.haml index c2d9022b9..2fa82921d 100644 --- a/app/views/admins/weekly_user_stats.mobile.haml +++ b/app/views/admins/weekly_user_stats.mobile.haml @@ -1,17 +1 @@ -.col-md-9 - %h2 - = t(".current_server", date: Time.zone.now.to_date) - - %div - = form_tag("/admins/weekly_user_stats", method: "get", class: "form-inline") do - = select_tag(:week, - options_for_select(@created_users_by_week.keys.reverse, - @selected_week), - class: "form-control") - = submit_tag t("admins.stats.go"), class: "btn btn-primary btn-block" - - = t(".amount_of", count: @counter) - %br - - @created_users_by_week[@selected_week].each do |m| - = link_to m, "/u/#{m}" - %br += render partial: "admins/weekly_user_stats" diff --git a/app/views/layouts/_drawer.mobile.haml b/app/views/layouts/_drawer.mobile.haml index a0bfc1e48..a9e9efb53 100644 --- a/app/views/layouts/_drawer.mobile.haml +++ b/app/views/layouts/_drawer.mobile.haml @@ -44,7 +44,7 @@ %li= link_to t("admins.admin_bar.user_search"), user_search_path %li= link_to t("admins.admin_bar.weekly_user_stats"), weekly_user_stats_path %li= link_to t("admins.admin_bar.pod_stats"), pod_stats_path - %li{role: "presentation", class: current_page?(report_index_path)} + %li %a{href: report_index_path} - if unreviewed_reports_count > 0 .pull-right.badge diff --git a/app/views/report/_reports.haml b/app/views/report/_reports.haml index 86a6325cf..fafe6bad0 100644 --- a/app/views/report/_reports.haml +++ b/app/views/report/_reports.haml @@ -1,46 +1,44 @@ - content_for :head do = stylesheet_link_tag :admin - = stylesheet_link_tag :report -.col-md-9 - .reports - %h1 - = t("report.title") - - if @reports.empty? - %p - = t("report.unreviewed_reports", count: 0) - - @reports.each do |report| - - if report.item - .panel.panel-default - - username = report.user.username - .panel-heading - .reporter.pull-right - != t("report.reported_label", person: link_to(username, user_profile_path(username))) - .reason - %span.reason-label - = t("report.reason_label") - %span - = report.text - .panel-body - .content - = report_content(report) - .segment-selection - = button_to t("report.reported_user_details"), - user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), - class: "btn pull-left btn-info btn-small col-md-3 col-xs-12", method: :post - = button_to t("report.review_link"), report_path(report.id, type: report.item_type), - class: "btn pull-left btn-info btn-small col-md-3 col-xs-12", method: :put - = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), - data: {confirm: t("report.confirm_deletion")}, - class: "btn pull-right btn-danger btn-small col-md-3 col-xs-12", method: :delete - - else - .panel.panel-default - - username = report.user.username - .panel-heading - .reporter.pull-right - != t("report.reported_label", person: link_to(username, user_profile_path(username))) - .title - = report_content(report) - .panel-body +.reports + %h1 + = t("report.title") + - if @reports.empty? + %p + = t("report.unreviewed_reports", count: 0) + - @reports.each do |report| + - if report.item + .panel.panel-default + - username = report.user.username + .panel-heading + .reporter.pull-right + != t("report.reported_label", person: link_to(username, user_profile_path(username))) + .reason + %span.reason-label + = t("report.reason_label") + %span + = report.text + .panel-body + .content + = report_content(report) + .segment-selection + = button_to t("report.reported_user_details"), + user_search_path(admins_controller_user_search: {guid: report.reported_author.guid}), + class: "btn pull-left btn-info btn-small col-md-3 col-xs-12", method: :post = button_to t("report.review_link"), report_path(report.id, type: report.item_type), - class: "btn pull-left btn-info btn-small", method: :put + class: "btn pull-left btn-info btn-small col-md-3 col-xs-12", method: :put + = button_to t("report.delete_link"), report_path(report.id, type: report.item_type), + data: {confirm: t("report.confirm_deletion")}, + class: "btn pull-right btn-danger btn-small col-md-3 col-xs-12", method: :delete + - else + .panel.panel-default + - username = report.user.username + .panel-heading + .reporter.pull-right + != t("report.reported_label", person: link_to(username, user_profile_path(username))) + .title + = report_content(report) + .panel-body + = button_to t("report.review_link"), report_path(report.id, type: report.item_type), + class: "btn pull-left btn-info btn-small", method: :put diff --git a/app/views/report/index.html.haml b/app/views/report/index.html.haml index 28956fba5..d96304603 100644 --- a/app/views/report/index.html.haml +++ b/app/views/report/index.html.haml @@ -3,4 +3,5 @@ .col-md-3 - if current_user.admin? = render partial: "admins/admin_bar" - = render partial: "report/reports" + .col-md-9 + = render partial: "report/reports" From 427aa8794e36c568caa5efc070864b45ab0d56e6 Mon Sep 17 00:00:00 2001 From: flaburgan Date: Fri, 2 Jun 2017 21:14:53 +0200 Subject: [PATCH 06/12] Add tests for mobile drawer --- app/views/admins/_stats.haml | 17 +++++---- app/views/admins/_user_search.haml | 2 +- app/views/admins/_weekly_user_stats.haml | 6 ++-- app/views/admins/stats.html.haml | 2 +- app/views/admins/stats.mobile.haml | 2 +- app/views/admins/user_search.html.haml | 2 +- app/views/admins/user_search.mobile.haml | 2 +- app/views/admins/weekly_user_stats.haml | 4 ++- .../admins/weekly_user_stats.mobile.haml | 3 +- features/mobile/drawer.feature | 36 +++++++++++++++---- features/step_definitions/user_steps.rb | 5 ++- 11 files changed, 54 insertions(+), 27 deletions(-) diff --git a/app/views/admins/_stats.haml b/app/views/admins/_stats.haml index ff8aa08f9..c06ce26e8 100644 --- a/app/views/admins/_stats.haml +++ b/app/views/admins/_stats.haml @@ -7,7 +7,7 @@ = 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"} - - ["daily", "week", "2weeks", "month"].each do |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 @@ -15,15 +15,14 @@ .col-sm-8.col-sm-pull-4 %h4 - != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) + != t("admins.stats.display_results", segment: content_tag(:strong, segment)) .row - %i(posts comments aspect_memberships users).each do |name| - - model = instance_variable_get("@#{name}") - - if name == :aspect_memberships - - name = t(".shares", count: model[:yesterday]) - - else - - name = t(".#{name}", count: model[:yesterday]) + :ruby + model = instance_variable_get("@#{name}") + count = model[:yesterday] + name = name == :aspect_memberships ? t(".shares", count: count) : t(".#{name}", count: count) .col-md-3 %h2{style: "font-weight:bold;"} @@ -36,8 +35,8 @@ .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.to_f), - post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) + post_yest: content_tag(:strong, posts[:yesterday] / user_count), + post_day: content_tag(:strong, posts[:day_before] / user_count)) .row .col-md-12 diff --git a/app/views/admins/_user_search.haml b/app/views/admins/_user_search.haml index 44fbcc8b5..e19070882 100644 --- a/app/views/admins/_user_search.haml +++ b/app/views/admins/_user_search.haml @@ -31,7 +31,7 @@ .row .col-md-12 .alert.alert-info.text-center{role: "alert"} - = t(".users", count: @users.count) + = t(".users", count: nb_users) .row .users.col-md-12 diff --git a/app/views/admins/_weekly_user_stats.haml b/app/views/admins/_weekly_user_stats.haml index 2b1f29997..f61b04eb8 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.keys.reverse, @selected_week), + options_for_select(created_users_by_week, selected_week), class: "form-control") .col-xs-3.center = submit_tag t("admins.stats.go"), class: "btn btn-primary" -= t(".amount_of", count: @counter) += 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/stats.html.haml b/app/views/admins/stats.html.haml index 0416b0e79..afa0980d2 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -3,4 +3,4 @@ .col-md-3 = render partial: "admins/admin_bar" .col-md-9 - = render partial: "admins/stats" + = render partial: "admins/stats", locals: {segment: @segment, posts: @posts, user_count: @user_count.to_f} diff --git a/app/views/admins/stats.mobile.haml b/app/views/admins/stats.mobile.haml index da4455fae..cbd77fa6a 100644 --- a/app/views/admins/stats.mobile.haml +++ b/app/views/admins/stats.mobile.haml @@ -1 +1 @@ -= render partial: "admins/stats" += render partial: "admins/stats", locals: {segment: @segment, posts: @posts, user_count: @user_count.to_f} diff --git a/app/views/admins/user_search.html.haml b/app/views/admins/user_search.html.haml index 747ef16b1..9bc5154ff 100644 --- a/app/views/admins/user_search.html.haml +++ b/app/views/admins/user_search.html.haml @@ -3,4 +3,4 @@ .col-md-3 = render partial: "admins/admin_bar" .col-md-9 - = render partial: "admins/user_search" + = render partial: "admins/user_search", locals: {nb_users: @users.count} diff --git a/app/views/admins/user_search.mobile.haml b/app/views/admins/user_search.mobile.haml index f98ad6f6a..6aae225d0 100644 --- a/app/views/admins/user_search.mobile.haml +++ b/app/views/admins/user_search.mobile.haml @@ -3,4 +3,4 @@ .flash-message{class: "message alert alert-#{flash_class name}", role: "alert"} = msg -= render partial: "admins/user_search" += render partial: "admins/user_search", locals: {nb_users: @users.count} diff --git a/app/views/admins/weekly_user_stats.haml b/app/views/admins/weekly_user_stats.haml index b734c47c9..aea22eba1 100644 --- a/app/views/admins/weekly_user_stats.haml +++ b/app/views/admins/weekly_user_stats.haml @@ -3,4 +3,6 @@ .col-md-3 = render partial: "admins/admin_bar" .col-md-9 - = render partial: "admins/weekly_user_stats" + = render partial: "admins/weekly_user_stats", + locals: {created_users_by_week: @created_users_by_week.keys.reverse, + 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 2fa82921d..98e7edc4e 100644 --- a/app/views/admins/weekly_user_stats.mobile.haml +++ b/app/views/admins/weekly_user_stats.mobile.haml @@ -1 +1,2 @@ -= render partial: "admins/weekly_user_stats" += render partial: "admins/weekly_user_stats", + locals: {created_users_by_week: @created_users_by_week.keys.reverse, selected_week: @selected_week, counter: @counter} diff --git a/features/mobile/drawer.feature b/features/mobile/drawer.feature index aa845a08d..fdeca1cc5 100644 --- a/features/mobile/drawer.feature +++ b/features/mobile/drawer.feature @@ -4,12 +4,7 @@ Feature: Navigate between pages using the header menu and the drawer I want to be able navigate between the pages of the mobile version Background: - Given following users exist: - | username | email | - | Bob Jones | bob@bob.bob | - | Alice Smith | alice@alice.alice | - - And a user with email "bob@bob.bob" is connected with "alice@alice.alice" + Given a user with email "alice@alice.alice" And I sign in as "alice@alice.alice" on the mobile website Scenario: navigate to the stream page @@ -57,9 +52,9 @@ Feature: Navigate between pages using the header menu and the drawer Then I should be on the mentioned stream page Scenario: navigate to aspects pages - Given "bob@bob.bob" has a public post with text "bob's text" Given I have a limited post with text "Hi you!" in the aspect "Besties" When I open the drawer + Then I should not see "All aspects" within "#drawer" And I click on "My aspects" in the drawer And I click on "All aspects" in the drawer Then I should be on the aspects page @@ -73,6 +68,7 @@ Feature: Navigate between pages using the header menu and the drawer When I follow the "boss" tag And I go to the stream page And I open the drawer + Then I should not see "All tags" within "#drawer" And I click on "#Followed tags" in the drawer And I click on "All tags" in the drawer Then I should be on the followed tags stream page @@ -109,3 +105,29 @@ Feature: Navigate between pages using the header menu and the drawer When I open the drawer And I click on "Settings" in the drawer Then I should be on my account settings page + + Scenario: navigate to the admin pages + Given an admin with email "bob@bob.bob" + And I sign in as "bob@bob.bob" on the mobile website + When I open the drawer + Then I should not see "Dashboard" within "#drawer" + When I click on "Admin" in the drawer + And I click on "Dashboard" in the drawer + Then I should see "Pod status" within "#main h2" + When I click on "Admin" in the drawer + And I click on "User search" in the drawer + Then I should see "User search" within "#main h3" + When I click on "Admin" in the drawer + And I click on "Weekly user stats" in the drawer + Then I should see "Current server date is " within "#main h2" + When I click on "Admin" in the drawer + And I click on "Pod stats" in the drawer + Then I should see "Usage statistics" within "#main h1" + When I click on "Admin" in the drawer + And I click on "Reports" in the drawer + Then I should see "Reports overview" within "#main h1" + When I click on "Admin" in the drawer + And I click on "Pod network" in the drawer + Then I should see "Pod network " within "#main h2" + When I click on "Admin" in the drawer + Then I should see "Sidekiq monitor" within "#drawer" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 0bad1d618..2338693c3 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -25,6 +25,10 @@ Given /^a nsfw user with email "([^\"]*)"$/ do |email| user.profile.update_attributes(:nsfw => true) end +Given /^an admin with email "([^\"]*)"$/ do |email| + user = create_user(email: email) + Role.add_admin(user) +end Given /^(?:|[tT]hat )?following user[s]?(?: exist[s]?)?:$/ do |table| table.hashes.each do |hash| @@ -38,7 +42,6 @@ Given /^(?:|[tT]hat )?following user[s]?(?: exist[s]?)?:$/ do |table| end end - Given /^I have been invited by an admin$/ do admin = FactoryGirl.create(:user) admin.invitation_code From 07d0ed916dcaeeebfe38b5315f1d4160a449341c Mon Sep 17 00:00:00 2001 From: flaburgan Date: Sun, 4 Jun 2017 20:18:01 +0200 Subject: [PATCH 07/12] Fix design issues + pronto closes #7295 --- Changelog.md | 1 + app/assets/stylesheets/admin.scss | 26 ++++-- app/assets/stylesheets/color-variables.scss | 3 + app/views/admins/_stats.haml | 87 ++++++++++--------- app/views/admins/_user_search.haml | 2 +- app/views/admins/_weekly_user_stats.haml | 4 +- app/views/admins/weekly_user_stats.haml | 3 +- .../admins/weekly_user_stats.mobile.haml | 2 +- config/locales/diaspora/en.yml | 2 +- 9 files changed, 74 insertions(+), 56 deletions(-) diff --git a/Changelog.md b/Changelog.md index aa7fbe850..11f045a16 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 e85694a08..078edf674 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 40acec470..e69540df5 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 c06ce26e8..ad74a7ab6 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 - - %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) - - .col-md-3 - %h2{style: "font-weight:bold;"} - = name.to_s + .row + .col-xs-12 %h4 - = model[:day_before] - %span.percent_change{class: (model[:change] > 0 ? "green" : "red")} - = "(#{model[:change]}%)" + != t("admins.stats.display_results", segment: content_tag(:strong, segment)) -.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 + - %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) -.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)) + .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 + .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 e19070882..33e02cee8 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 f61b04eb8..a3a9eff07 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 aea22eba1..264f27eaa 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 98e7edc4e..054f1468f 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 f1242cfe3..dc1a1f961 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" From ea9e50085df7ff6a57c5abaca2be1a855d9de59b Mon Sep 17 00:00:00 2001 From: flaburgan Date: Tue, 9 May 2017 13:12:45 +0200 Subject: [PATCH 08/12] Add link to discourse in footer and left side bar --- app/views/shared/_links.haml | 15 +++++++++------ app/views/streams/main_stream.html.haml | 9 +++++++-- config/locales/diaspora/en.yml | 3 +++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/app/views/shared/_links.haml b/app/views/shared/_links.haml index 1567e0159..8be514a17 100644 --- a/app/views/shared/_links.haml +++ b/app/views/shared/_links.haml @@ -1,8 +1,11 @@ -%li= link_to 'diasporafoundation.org', "https://diasporafoundation.org" -%li= link_to 'Wiki', "https://wiki.diasporafoundation.org" -%li= link_to t('layouts.application.whats_new'), changelog_url -%li= link_to t('layouts.header.code') + " " + pod_version, "#{source_url}", {:title => t('layouts.application.source_package')} +%li= link_to "diasporafoundation.org", "https://diasporafoundation.org" +%li= link_to "Wiki", "https://wiki.diasporafoundation.org" +%li= link_to t("layouts.application.discourse"), "https://discourse.diasporafoundation.org" +%li= link_to t("layouts.application.whats_new"), changelog_url +%li= link_to t("layouts.header.code") + " " + pod_version, + source_url.to_s, + title: t("layouts.application.source_package") %li= link_to t("layouts.application.statistics_link"), statistics_path -%li= link_to(t('layouts.application.toggle'), toggle_mobile_path) +%li= link_to(t("layouts.application.toggle"), toggle_mobile_path) - if AppConfig.settings.terms.enable? - %li= link_to(t('_terms'), terms_path) + %li= link_to(t("_terms"), terms_path) diff --git a/app/views/streams/main_stream.html.haml b/app/views/streams/main_stream.html.haml index da6c31f75..29da6a6c9 100644 --- a/app/views/streams/main_stream.html.haml +++ b/app/views/streams/main_stream.html.haml @@ -91,8 +91,8 @@ "https://wiki.diasporafoundation.org/How_to_report_a_bug")) %li != t("aspects.index.help.feature_suggestion", - link: link_to("#" + t("aspects.index.help.tag_feature"), - tag_path(name: t("aspects.index.help.tag_feature")))) + link: link_to(t("aspects.index.help.tag_feature"), + "https://discourse.diasporafoundation.org/c/features-and-ideas")) %p != t("aspects.index.help.tutorials_and_wiki", faq: link_to(t("_help"), help_path), @@ -102,6 +102,11 @@ target: "_blank"), target: "_blank") + %p + != t("aspects.index.help.support_forum", + support_forum: link_to(t("aspects.index.help.support_forum_link"), + "https://discourse.diasporafoundation.org/c/support", target: "_blank")) + - unless AppConfig.configured_services.blank? || all_services_connected? .section.collapsed .title diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index dc1a1f961..4a2543d12 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -217,6 +217,8 @@ en: tag_feature: "feature" tutorials_and_wiki: "%{faq}, %{tutorial} & %{wiki}: help for your first steps." tutorial_link_text: "Tutorials" + support_forum: "You can also join the %{support_forum}." + support_forum_link: "support forum" any_problem: "Got a problem?" contact_podmin: "Contact the administrator of your pod!" mail_podmin: "Podmin email" @@ -585,6 +587,7 @@ en: powered_by: "Powered by diaspora*" whats_new: "What’s new?" statistics_link: "Pod statistics" + discourse: "Project discussions and support" toggle: "Toggle mobile" public_feed: "Public diaspora* feed for %{name}" back_to_top: "Back to top" From ddda28102cd553b136a15654b4910bde3a9e8e96 Mon Sep 17 00:00:00 2001 From: flaburgan Date: Sun, 18 Jun 2017 13:00:41 +0200 Subject: [PATCH 09/12] Clean up the footer links a bit closes #7446 --- Changelog.md | 1 + app/assets/stylesheets/footer.scss | 10 +++++----- app/assets/stylesheets/navbar_left.scss | 4 ++-- app/views/layouts/_footer.html.haml | 7 +++---- app/views/shared/_links.haml | 6 ++---- app/views/streams/main_stream.html.haml | 5 +++++ 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Changelog.md b/Changelog.md index 11f045a16..993ece9ef 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ * 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) +* Add links to discourse to footer and sidebar [#7446](https://github.com/diaspora/diaspora/pull/7446) # 0.6.6.0 diff --git a/app/assets/stylesheets/footer.scss b/app/assets/stylesheets/footer.scss index ad1c398a2..99bb28158 100644 --- a/app/assets/stylesheets/footer.scss +++ b/app/assets/stylesheets/footer.scss @@ -5,6 +5,11 @@ html { body { margin-bottom: 150px; } +.powered-by-diaspora a { + color: $link-grey; + font-weight: bold; +} + footer.footer { background-color: $background-grey; border-top: 1px solid $border-grey; @@ -15,11 +20,6 @@ footer.footer { position: absolute; width: 100%; - .powered-by-diaspora { - color: $link-grey; - font-weight: bold; - } - ul#footer_nav { margin: 0; padding: 0; diff --git a/app/assets/stylesheets/navbar_left.scss b/app/assets/stylesheets/navbar_left.scss index 498b4fde5..319a38e9f 100644 --- a/app/assets/stylesheets/navbar_left.scss +++ b/app/assets/stylesheets/navbar_left.scss @@ -114,7 +114,8 @@ padding: 10px 20px 0; .excellence-box, - .info-links { + .info-links, + .powered-box { border-top: 1px solid $border-grey; padding: 5px; } @@ -175,7 +176,6 @@ ul { list-style: none; - margin-bottom: 5px; padding-left: 0; } diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index ab8263507..cfa2f167a 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -1,7 +1,6 @@ %footer.footer .container - .pull-left - .powered-by-diaspora - =t("layouts.application.powered_by") + .powered-by-diaspora.pull-left + = link_to t("layouts.application.powered_by"), "https://diasporafoundation.org" %ul#footer_nav.pull-right - = render :partial =>'shared/links' + = render partial: "shared/links" diff --git a/app/views/shared/_links.haml b/app/views/shared/_links.haml index 8be514a17..2032d6197 100644 --- a/app/views/shared/_links.haml +++ b/app/views/shared/_links.haml @@ -1,11 +1,9 @@ -%li= link_to "diasporafoundation.org", "https://diasporafoundation.org" -%li= link_to "Wiki", "https://wiki.diasporafoundation.org" %li= link_to t("layouts.application.discourse"), "https://discourse.diasporafoundation.org" %li= link_to t("layouts.application.whats_new"), changelog_url %li= link_to t("layouts.header.code") + " " + pod_version, source_url.to_s, title: t("layouts.application.source_package") %li= link_to t("layouts.application.statistics_link"), statistics_path -%li= link_to(t("layouts.application.toggle"), toggle_mobile_path) +%li= link_to t("layouts.application.toggle"), toggle_mobile_path - if AppConfig.settings.terms.enable? - %li= link_to(t("_terms"), terms_path) + %li= link_to t("_terms"), terms_path diff --git a/app/views/streams/main_stream.html.haml b/app/views/streams/main_stream.html.haml index 29da6a6c9..3a8b0225a 100644 --- a/app/views/streams/main_stream.html.haml +++ b/app/views/streams/main_stream.html.haml @@ -170,6 +170,11 @@ %ul = render "shared/links" + .powered-box + .content + .powered-by-diaspora.text-center + = link_to t("layouts.application.powered_by"), "https://diasporafoundation.org" + .col-md-9 .stream_container#aspect_stream_container = render "aspects/aspect_stream", stream: @stream From 0e13a316f6922eb88507fc68cfa2fc742b5e7378 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sun, 6 Nov 2016 17:51:59 +0100 Subject: [PATCH 10/12] Cleanup some translations closes #7465 --- Changelog.md | 1 + config/locales/diaspora/en.yml | 32 +++++++++------------ config/locales/javascript/javascript.en.yml | 6 ++-- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Changelog.md b/Changelog.md index 993ece9ef..c5acd5e91 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,7 @@ # 0.6.7.0 ## Refactor +* Cleanup some translations [#7465](https://github.com/diaspora/diaspora/pull/7465) ## Bug fixes diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 4a2543d12..be2a06f99 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -55,14 +55,10 @@ en: attributes: person_id: taken: "must be unique among this user’s contacts." - request: - attributes: - from_id: - taken: "is a duplicate of a pre-existing request." reshare: attributes: root_guid: - taken: "That good, eh? You've already reshared that post!" + taken: "That good, eh? You've already reshared that post!" poll: attributes: poll_answers: @@ -174,7 +170,7 @@ en: you_should_add_some_more_contacts: "You should add some more contacts!" try_adding_some_more_contacts: "You can search or %{invite_link} more contacts." invite_link_text: "invite" - or_spotlight: "Or you can share with %{link}" + or_spotlight: "Or you can share with %{link}" community_spotlight: "Community spotlight" aspect_listings: add_an_aspect: "+ Add an aspect" @@ -198,7 +194,7 @@ en: keep_pod_running: "Keep %{pod} running fast and buy servers their coffee fix with a monthly donation!" donate_liberapay: "Donate to liberapay" welcome_to_diaspora: "Welcome to diaspora*, %{name}!" - introduce_yourself: "This is your stream. Jump in and introduce yourself." + introduce_yourself: "This is your stream. Jump in and introduce yourself." new_here: title: "Welcome new users" @@ -254,7 +250,6 @@ en: contacts: index: start_a_conversation: "Start a conversation" - add_a_new_aspect: "Add a new aspect" title: "Contacts" no_contacts: "Looks like you need to add some contacts!" no_contacts_message: "Check out %{community_spotlight}" @@ -572,9 +567,9 @@ en: sending_invitation: "Sending invitation..." paste_link: "Share this link with your friends to invite them to diaspora*, or email them the link directly." codes_left: - zero: "No invites left on this code" - one: "One invite left on this code" - other: "%{count} invites left on this code" + zero: "No invites left on this code" + one: "One invite left on this code" + other: "%{count} invites left on this code" layouts: header: @@ -629,7 +624,6 @@ en: zero: "%{actors} have reshared your post %{post_link}." one: "%{actors} has reshared your post %{post_link}." other: "%{actors} have reshared your post %{post_link}." - post: "post" also_commented_deleted: zero: "%{actors} commented on a deleted post." one: "%{actors} commented on a deleted post." @@ -913,9 +907,9 @@ en: photos: create: - runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" - integrity_error: "Photo upload failed. Are you sure that was an image?" - type_error: "Photo upload failed. Are you sure an image was added?" + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Photo upload failed. Are you sure that was an image?" + type_error: "Photo upload failed. Are you sure an image was added?" destroy: notice: "Photo deleted." new_profile_photo: @@ -1080,8 +1074,8 @@ en: share_this: "Share this link via email, blog, or social networks!" public_explain: control_your_audience: "Control your audience" - new_user_welcome_message: "Use #hashtags to classify your posts and find people who share your interests. Call out awesome people with @Mentions" - visibility_dropdown: "Use this dropdown to change visibility of your post. (We suggest you make this first one public.)" + new_user_welcome_message: "Use #hashtags to classify your posts and find people who share your interests. Call out awesome people with @Mentions" + visibility_dropdown: "Use this dropdown to change visibility of your post. (We suggest you make this first one public.)" title: "Set up connected services" share: "Share" outside: "Public messages will be available for others outside of diaspora* to see." @@ -1234,11 +1228,11 @@ en: connect_to_facebook: "We can speed things up a bit by %{link} to diaspora*. This will pull your name and photo, and enable cross-posting." connect_to_facebook_link: "Hooking up your Facebook account" what_are_you_in_to: "What are you into?" - hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They’re also a great way to find new people on diaspora*." + hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They’re also a great way to find new people on diaspora*." hashtag_suggestions: "Try following tags like #art, #movies, #gif, etc." update: - password_changed: "Password changed. You can now log in with your new password." + password_changed: "Password changed. You can now log in with your new password." password_not_changed: "Password change failed" language_changed: "Language changed" diff --git a/config/locales/javascript/javascript.en.yml b/config/locales/javascript/javascript.en.yml index 5ef87d181..7c5071762 100644 --- a/config/locales/javascript/javascript.en.yml +++ b/config/locales/javascript/javascript.en.yml @@ -135,8 +135,6 @@ en: my_aspects: "My aspects" publisher: - limited: "Limited: your post will only be seen by people you are sharing with" - public: "Public: your post will be visible to everyone and found by search engines" near_from: "Posted from: <%= location %>" option: "Answer" add_option: "Add an answer" @@ -184,7 +182,7 @@ en: mobile_row_unchecked: "<%= name %> (add)" stopped_sharing_with: "You have stopped sharing with <%= name %>." started_sharing_with: "You have started sharing with <%= name %>!" - error: "Couldn’t start sharing with <%= name %>. Are you ignoring them?" + error: "Couldn’t start sharing with <%= name %>. Are you ignoring them?" error_remove: "Couldn’t remove <%= name %> from the aspect :(" toggle: one: "In <%= count %> aspect" @@ -206,7 +204,7 @@ en: add_an_aspect: "+ Add an aspect" getting_started: hey: "Hey, <%= name %>!" - no_tags: "Hey, you haven’t followed any tags! Continue anyway?" + no_tags: "Hey, you haven’t followed any tags! Continue anyway?" alright_ill_wait: "All right, I’ll wait." preparing_your_stream: "Preparing your personalized stream..." photo_uploader: From 068acd93ceeab8e9cfec277db68a4f2455e57343 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Wed, 5 Jul 2017 02:04:07 +0200 Subject: [PATCH 11/12] Cleanup changelog (no bugfixes in this release) --- Changelog.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index c5acd5e91..dad01e1dd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,8 +3,6 @@ ## Refactor * Cleanup some translations [#7465](https://github.com/diaspora/diaspora/pull/7465) -## Bug fixes - ## 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) From 58aa59fb8e7e678c7129cbb974f6508a7da72587 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Wed, 5 Jul 2017 02:07:45 +0200 Subject: [PATCH 12/12] Start 0.6.8.0 cycle --- Changelog.md | 8 ++++++++ config/defaults.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index dad01e1dd..4783712ab 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,11 @@ +# 0.6.8.0 + +## Refactor + +## Bug fixes + +## Features + # 0.6.7.0 ## Refactor diff --git a/config/defaults.yml b/config/defaults.yml index acf7bb03b..16b391a57 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -4,7 +4,7 @@ defaults: version: - number: "0.6.6.99" # Do not touch unless doing a release, do not backport the version number that's in master + number: "0.6.7.99" # Do not touch unless doing a release, do not backport the version number that's in master heroku: false environment: url: "http://localhost:3000/"