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
This commit is contained in:
flaburgan 2017-03-16 17:46:16 +01:00 committed by Benjamin Neff
parent 7bdf33e1a8
commit a7d97b7fd3
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
14 changed files with 128 additions and 136 deletions

View file

@ -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 **/

View file

@ -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%;
}
}
}

View file

@ -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;
}

View file

@ -1,12 +0,0 @@
#reports {
.reason-label {
font-weight: bold;
}
.content {
padding-bottom: 20px;
}
form input {
margin-right: 5px;
}
}

View file

@ -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

View file

@ -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"}

View file

@ -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|

View file

@ -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"

View file

@ -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"

View file

@ -1 +1,4 @@
- content_for :head do
= stylesheet_link_tag :admin
= render partial: "admins/dashboard"

View file

@ -1,3 +1,6 @@
- content_for :head do
= stylesheet_link_tag :admin
.container
.row
.col-md-3

View file

@ -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"

View file

@ -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

View file

@ -1,6 +1,3 @@
- content_for :head do
= stylesheet_link_tag :admin
.container
.row
.col-md-3