Refactor, more partials + No version check for mobile
This commit is contained in:
parent
276b640418
commit
5cb4c6e5df
21 changed files with 261 additions and 446 deletions
|
|
@ -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");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
app/views/admins/_dashboard.haml
Normal file
12
app/views/admins/_dashboard.haml
Normal file
|
|
@ -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)
|
||||
55
app/views/admins/_stats.haml
Normal file
55
app/views/admins/_stats.haml
Normal file
|
|
@ -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))
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
56
app/views/admins/_user_search.haml
Normal file
56
app/views/admins/_user_search.haml
Normal file
|
|
@ -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}
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
1
app/views/admins/user_entry.mobile.haml
Normal file
1
app/views/admins/user_entry.mobile.haml
Normal file
|
|
@ -0,0 +1 @@
|
|||
= render partial: "user_entry"
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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}"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
39
app/views/report/_reports.haml
Normal file
39
app/views/report/_reports.haml
Normal file
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue