Unverified Commit 8bed8a84 authored by Benjamin Neff's avatar Benjamin Neff

Merge branch 'release/0.6.7.0'

parents 7aadadce 0e8bb714
......@@ -164,16 +164,6 @@ Lint/Debugger:
Style/NumericPredicate:
EnforcedStyle: comparison
# Old defaults from rubocop < 0.48.1
Style/PercentLiteralDelimiters:
PreferredDelimiters:
default: '()'
'%i': '()'
'%I': '()'
'%r': '{}'
'%w': '()'
'%W': '()'
# Reset some HoundCI changes back to Rubocop defaults
Style/DotPosition:
EnforcedStyle: leading
......
# 0.6.7.0
## Refactor
* Cleanup some translations [#7465](https://github.com/diaspora/diaspora/pull/7465)
## 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)
* Add links to discourse to footer and sidebar [#7446](https://github.com/diaspora/diaspora/pull/7446)
# 0.6.6.0
## Refactor
......@@ -12,7 +23,6 @@
* Fix welcome message when podmin is set to an invalid username [#7452](https://github.com/diaspora/diaspora/pull/7452)
## Features
* Add support for Nodeinfo 2.0 [#7447](https://github.com/diaspora/diaspora/pull/7447)
# 0.6.5.0
......
......@@ -112,6 +112,7 @@ source "https://rails-assets.org" do
gem "rails-assets-autosize", "3.0.20"
gem "rails-assets-blueimp-gallery", "2.25.0"
gem "rails-assets-jquery.are-you-sure", "1.9.0"
gem "rails-assets-jquery-placeholder", "2.3.1"
gem "rails-assets-jquery-textchange", "0.2.3"
gem "rails-assets-perfect-scrollbar", "0.6.16"
......
......@@ -529,6 +529,8 @@ GEM
rails-assets-jquery (>= 1.6)
rails-assets-jquery-textchange (0.2.3)
rails-assets-jquery
rails-assets-jquery.are-you-sure (1.9.0)
rails-assets-jquery (>= 1.4.2)
rails-assets-jquery.slimscroll (1.3.8)
rails-assets-jquery.ui (1.11.4)
rails-assets-jquery (>= 1.6)
......@@ -847,6 +849,7 @@ DEPENDENCIES
rails-assets-jquery (= 2.2.4)!
rails-assets-jquery-placeholder (= 2.3.1)!
rails-assets-jquery-textchange (= 0.2.3)!
rails-assets-jquery.are-you-sure (= 1.9.0)!
rails-assets-markdown-it (= 8.3.0)!
rails-assets-markdown-it--markdown-it-for-inline (= 0.1.1)!
rails-assets-markdown-it-diaspora-mention (= 1.1.1)!
......
......@@ -14,6 +14,7 @@ app.pages.Settings = Backbone.View.extend({
el: $(".aspect_dropdown"),
form: $("#post-default-aspects")
});
$("#update_profile_form").areYouSure();
}
});
// @license-end
......@@ -41,5 +41,6 @@
//= require blueimp-gallery/blueimp-gallery-indicator
//= require leaflet
//= require api/authorization_page
// = require bootstrap-markdown/bootstrap-markdown
// = require helpers/markdown_editor
//= require bootstrap-markdown/bootstrap-markdown
//= require helpers/markdown_editor
//= require jquery.are-you-sure
(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");
});
......
......@@ -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;
......@@ -16,15 +16,14 @@
.avatar {
width: 50px;
height: 50px;
max-width: none;
}
.actions{ width: 150px; }
.pull-right .label{ display: inline-block; }
}
}
/** Invites panel **/
// Invites panel
.more_invites{
#add-invites-section{
line-height: 34px;
......@@ -32,12 +31,49 @@
}
}
/** reported posts **/
.invite-emails {
margin-bottom: 10px;
}
@import 'report';
// Weekly stats
.week-selector {
margin-top: 10px;
}
/** pod list **/
// Pod stats
.segment-selection {
select,
[type=submit] {
margin-top: 10px;
}
}
.percent-change {
&.increase {
color: $increase;
}
&.decrease {
color: $decrease;
}
}
// reported posts
.reports {
.reason-label {
font-weight: bold;
}
.content {
padding-bottom: 20px;
}
.panel-body .btn-info {
margin-right: 5px;
}
}
// pod list
#pod-list {
.pod-title {
max-width: 200px;
......
......@@ -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;
......@@ -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;
......
......@@ -885,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;
}
......@@ -114,13 +114,15 @@
padding: 10px 20px 0;
.excellence-box,
.info-links {
.info-links,
.powered-box {
border-top: 1px solid $border-grey;
padding: 5px;
}
.excellence-box {
margin-top: 10px;
text-align: center;
.content {
font-size: $font-size-base;
......@@ -175,7 +177,6 @@
ul {
list-style: none;
margin-bottom: 5px;
padding-left: 0;
}
......
#reports {
.reason-label {
font-weight: bold;
}
.content {
padding-bottom: 20px;
}
form input {
margin-right: 5px;
}
}
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
......
......@@ -220,15 +220,23 @@ class UsersController < ApplicationController
end
def change_email(user_data)
@user.unconfirmed_email = user_data[:email]
if @user.save
@user.send_confirm_email
if @user.unconfirmed_email
if AppConfig.mail.enable?
@user.unconfirmed_email = user_data[:email]
if @user.save
@user.send_confirm_email
flash.now[:notice] = t("users.update.unconfirmed_email_changed")
else
@user.reload # match user object with the database
flash.now[:error] = t("users.update.unconfirmed_email_not_changed")
end
else
@user.reload # match user object with the database
flash.now[:error] = t("users.update.unconfirmed_email_not_changed")
@user.email = user_data[:email]
if @user.save
flash.now[:notice] = t("users.update.settings_updated")
else
@user.reload
flash.now[:error] = t("users.update.unconfirmed_email_not_changed")
end
end
end
......
- 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 +18,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
#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)
- content_for :head do
= stylesheet_link_tag :admin
.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
.col-xs-12
%h4
!= t("admins.stats.display_results", segment: content_tag(:strong, segment))
.row
- %i(posts comments aspect_memberships users).each do |name|
:ruby
model = instance_variable_get("@#{name}")
count = model[:yesterday]
label_with_count = name == :aspect_memberships ? t(".shares", count: count) : t(".#{name}", count: 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))
%li.user.media
%div.pull-left
.media-left
- if user.person
%span.media-object
.media-object
= person_image_tag(user.person, size: :thumb_small)
%div.media-body.row
%div.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
%div.pull-right
.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'
- 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'
- 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'
- 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'
%div.row
%div.col-md-5
.media-body
.row
.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')
%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')
-if user.invited_by.present?
%dt= t('.invite_token')
%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')
%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
.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"
- 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"
- content_for :head do
= stylesheet_link_tag :admin
.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 :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"
.row
.col-md-12
.alert.alert-info.text-center{role: "alert"}
= t(".users", count: nb_users)
.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"))
= 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 invite-emails"
.col-xs-12.col-md-2
= submit_tag t(".invite"), class: "btn btn-block btn-primary"
- 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}"
......@@ -3,11 +3,4 @@
.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"
= render partial: "admins/dashboard"
- content_for :head do
= stylesheet_link_tag :admin
.container
.row
.col-md-3
......
%h2
= t(".pod_network")
.alert.alert-warning
!= t(".pod_desktop_view", desktop_link: link_to(t(".pod_desktop_link"), toggle_mobile_path))
......@@ -3,58 +3,4 @@
.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')}