Merge pull request #5077 from svbergerem/bootstrap-people-search
Port people search to Bootstrap Conflicts: app/assets/stylesheets/application.css.sass
This commit is contained in:
commit
ddb80ad366
20 changed files with 219 additions and 103 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
* Port help pages to Bootstrap [#5050](https://github.com/diaspora/diaspora/pull/5050)
|
* Port help pages to Bootstrap [#5050](https://github.com/diaspora/diaspora/pull/5050)
|
||||||
* Refactor Notification#notify [#4945](https://github.com/diaspora/diaspora/pull/4945)
|
* Refactor Notification#notify [#4945](https://github.com/diaspora/diaspora/pull/4945)
|
||||||
* Port getting started to Bootstrap [#5057](https://github.com/diaspora/diaspora/pull/5057)
|
* Port getting started to Bootstrap [#5057](https://github.com/diaspora/diaspora/pull/5057)
|
||||||
|
* Port people search page to Bootstrap [#5077](https://github.com/diaspora/diaspora/pull/5077)
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Fix hiding of poll publisher on close [#5029](https://github.com/diaspora/diaspora/issues/5029)
|
* Fix hiding of poll publisher on close [#5029](https://github.com/diaspora/diaspora/issues/5029)
|
||||||
|
|
|
||||||
|
|
@ -40,5 +40,6 @@
|
||||||
//= require bootstrap-popover
|
//= require bootstrap-popover
|
||||||
//= require bootstrap-dropdown
|
//= require bootstrap-dropdown
|
||||||
//= require bootstrap-scrollspy-custom
|
//= require bootstrap-scrollspy-custom
|
||||||
|
//= require bootstrap-modal
|
||||||
//= require osmlocator
|
//= require osmlocator
|
||||||
//= require flexime
|
//= require flexime
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
@import 'stream_element'
|
@import 'stream_element'
|
||||||
@import 'report'
|
@import 'report'
|
||||||
@import 'new_styles/_forms'
|
@import 'new_styles/_forms'
|
||||||
|
@import 'tag'
|
||||||
|
|
||||||
/* ====== media ====== */
|
/* ====== media ====== */
|
||||||
.media
|
.media
|
||||||
|
|
@ -852,37 +853,6 @@ ul#press_logos
|
||||||
.avatar
|
.avatar
|
||||||
:float left
|
:float left
|
||||||
|
|
||||||
.tag
|
|
||||||
:display inline-block
|
|
||||||
:max-width 100%
|
|
||||||
&:hover
|
|
||||||
:text
|
|
||||||
:decoration underline
|
|
||||||
:background
|
|
||||||
:color lighten($blue, 47%)
|
|
||||||
|
|
||||||
:font
|
|
||||||
:weight bold
|
|
||||||
|
|
||||||
h1.tag
|
|
||||||
:border
|
|
||||||
:bottom 2px dotted $blue
|
|
||||||
&:hover
|
|
||||||
:border
|
|
||||||
:bottom 2px dotted $blue
|
|
||||||
|
|
||||||
.info
|
|
||||||
.tag
|
|
||||||
:background
|
|
||||||
:color #efefef
|
|
||||||
:color $text-grey
|
|
||||||
:border
|
|
||||||
:bottom 1px dotted $border-dark-grey
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
:border
|
|
||||||
:bottom 1px solid $border-dark-grey
|
|
||||||
|
|
||||||
.diaspora_handle
|
.diaspora_handle
|
||||||
:font
|
:font
|
||||||
:size 12px
|
:size 12px
|
||||||
|
|
|
||||||
23
app/assets/stylesheets/invitations.css.scss
Normal file
23
app/assets/stylesheets/invitations.css.scss
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#invite_code {
|
||||||
|
cursor: text;
|
||||||
|
display: block;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#invitationsModal {
|
||||||
|
#paste_link { font-weight: 700; }
|
||||||
|
#invite_code { margin-top: 10px; }
|
||||||
|
#codes_left { color: $text-grey; }
|
||||||
|
.control-label { width: 120px; }
|
||||||
|
.controls { margin-left: 140px; }
|
||||||
|
#email_invitation {
|
||||||
|
padding-top: 10px;
|
||||||
|
margin-top: 20px;
|
||||||
|
border-top: 1px dashed $border-grey;
|
||||||
|
label { font-weight: 700; }
|
||||||
|
#already_sent {
|
||||||
|
color: $text-grey;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -47,4 +47,11 @@
|
||||||
@import 'help';
|
@import 'help';
|
||||||
|
|
||||||
/* getting started */
|
/* getting started */
|
||||||
@import 'getting-started'
|
@import 'getting-started';
|
||||||
|
|
||||||
|
/* people */
|
||||||
|
@import 'people';
|
||||||
|
@import 'invitations';
|
||||||
|
|
||||||
|
/* stream */
|
||||||
|
@import 'tag';
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,24 @@ $bring-dark-accent-forward-color: #DDD;
|
||||||
padding-top: 40px;
|
padding-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#back-to-top {
|
||||||
|
display: block;
|
||||||
|
color: white;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 49;
|
||||||
|
right: 20px;
|
||||||
|
bottom: 20px;
|
||||||
|
opacity: 0;
|
||||||
|
font-size: 2.9em;
|
||||||
|
padding: 0 12px 0 12px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #aaa;
|
||||||
|
&:hover { opacity: 0.85 !important; }
|
||||||
|
&.visible { opacity: 0.5; }
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
/* responsive */
|
/* responsive */
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
body {
|
body {
|
||||||
|
|
|
||||||
17
app/assets/stylesheets/people.css.scss
Normal file
17
app/assets/stylesheets/people.css.scss
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#people_search {
|
||||||
|
#people_stream {
|
||||||
|
.stream_element {
|
||||||
|
border-bottom: 1px solid $border-grey;
|
||||||
|
padding-right: 10px;
|
||||||
|
.avatar {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
.info { font-size: 11px; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#search_title {
|
||||||
|
.term { font-weight: 700; }
|
||||||
|
small { margin-left: 15px; }
|
||||||
|
}
|
||||||
|
}
|
||||||
22
app/assets/stylesheets/tag.css.scss
Normal file
22
app/assets/stylesheets/tag.css.scss
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
.tag {
|
||||||
|
display: inline-block;
|
||||||
|
font-weight: bold;
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
background-color: lighten($blue, 47%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h1.tag {
|
||||||
|
border-bottom: 2px dotted $blue;
|
||||||
|
&:hover { border-bottom: 2px dotted $blue; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
.tag {
|
||||||
|
background-color: #efefef;
|
||||||
|
color: $text-grey;
|
||||||
|
border-bottom: 1px dotted $border-dark-grey;
|
||||||
|
&:hover { border-bottom: 1px solid $border-dark-grey; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ class InvitationsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html do
|
||||||
render :layout => false
|
render params[:blueprint] ? 'invitations/new_blueprint' : 'invitations/new', layout: false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
class PeopleController < ApplicationController
|
class PeopleController < ApplicationController
|
||||||
before_filter :authenticate_user!, :except => [:show, :last_post]
|
before_filter :authenticate_user!, :except => [:show, :last_post]
|
||||||
|
|
||||||
|
use_bootstrap_for :index
|
||||||
|
|
||||||
respond_to :html, :except => [:tag_index]
|
respond_to :html, :except => [:tag_index]
|
||||||
respond_to :json, :only => [:index, :show]
|
respond_to :json, :only => [:index, :show]
|
||||||
respond_to :js, :only => [:tag_index]
|
respond_to :js, :only => [:tag_index]
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ LISTITEM
|
||||||
end
|
end
|
||||||
|
|
||||||
def dropdown_may_create_new_aspect
|
def dropdown_may_create_new_aspect
|
||||||
@aspect == :profile || @aspect == :tag || @aspect == :search || @aspect == :notification || params[:action] == "getting_started"
|
@aspect == :profile || @aspect == :tag || @aspect == :notification || params[:action] == "getting_started"
|
||||||
end
|
end
|
||||||
|
|
||||||
def aspect_options_for_select(aspects)
|
def aspect_options_for_select(aspects)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
module TagsHelper
|
module TagsHelper
|
||||||
def looking_for_tag_link
|
def looking_for_tag_link
|
||||||
return if search_query.include?('@') || normalized_tag_name.blank?
|
return if search_query.include?('@') || normalized_tag_name.blank?
|
||||||
content_tag('h4') do
|
content_tag('small') do
|
||||||
content_tag('small') do
|
t('people.index.looking_for', :tag_link => tag_link).html_safe
|
||||||
t('people.index.looking_for', :tag_link => tag_link).html_safe
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,29 @@
|
||||||
.span-15.last
|
#paste_link
|
||||||
.span-3
|
= t('.paste_link')
|
||||||
.icons-monotone_email_letter_round
|
%span#codes_left
|
||||||
|
= '(' + t('.codes_left', :count => @invite_code.count) + ')'
|
||||||
|
.form-horizontal
|
||||||
|
.control-group
|
||||||
|
.controls
|
||||||
|
= invite_link(@invite_code)
|
||||||
|
|
||||||
.span-12.last
|
#email_invitation
|
||||||
%h2
|
= form_tag new_user_invitation_path, :class => 'form-horizontal' do
|
||||||
= t('.invite_someone_to_join')
|
|
||||||
%br
|
.control-group
|
||||||
.span-7.append-1.last
|
%label.control-label{ :for => 'email_inviter_emails' }
|
||||||
%b= t('.paste_link')
|
= t('email')
|
||||||
%br
|
.controls
|
||||||
%br
|
|
||||||
= invite_link(@invite_code)
|
|
||||||
= t('.codes_left', :count => @invite_code.count)
|
|
||||||
%br
|
|
||||||
%br
|
|
||||||
#email_invitation
|
|
||||||
|
|
||||||
= form_tag new_user_invitation_path do
|
|
||||||
%h4
|
|
||||||
= t('email')
|
|
||||||
= text_field_tag 'email_inviter[emails]', @invalid_emails, :title => t('.comma_separated_plz'), :placeholder => 'foo@bar.com, max@foo.com...'
|
= text_field_tag 'email_inviter[emails]', @invalid_emails, :title => t('.comma_separated_plz'), :placeholder => 'foo@bar.com, max@foo.com...'
|
||||||
%p
|
#already_sent
|
||||||
= t('invitations.create.note_already_sent', :emails => @valid_emails) unless @valid_emails.empty?
|
= t('invitations.create.note_already_sent', :emails => @valid_emails) unless @valid_emails.empty?
|
||||||
%br
|
|
||||||
|
.control-group
|
||||||
%h4
|
%label.control-label{ :for => 'email_inviter_locale' }
|
||||||
= t('.language')
|
= t('.language')
|
||||||
|
.controls
|
||||||
= select_tag('email_inviter[locale]', options_from_collection_for_select(available_language_options, "second", "first", :selected => current_user.language))
|
= select_tag('email_inviter[locale]', options_from_collection_for_select(available_language_options, "second", "first", :selected => current_user.language))
|
||||||
|
|
||||||
%br
|
.control-group
|
||||||
|
.controls
|
||||||
%p
|
= submit_tag t('.send_an_invitation'), :class => 'btn btn-primary creation', :disable_with => t('.sending_invitation')
|
||||||
= submit_tag t('.send_an_invitation'), :disable_with => t('.sending_invitation')
|
|
||||||
|
|
|
||||||
34
app/views/invitations/new_blueprint.html.haml
Normal file
34
app/views/invitations/new_blueprint.html.haml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
.span-15.last
|
||||||
|
.span-3
|
||||||
|
.icons-monotone_email_letter_round
|
||||||
|
|
||||||
|
.span-12.last
|
||||||
|
%h2
|
||||||
|
= t('invitations.new.invite_someone_to_join')
|
||||||
|
%br
|
||||||
|
.span-7.append-1.last
|
||||||
|
%b= t('invitations.new.paste_link')
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
= invite_link(@invite_code)
|
||||||
|
= t('invitations.new.codes_left', :count => @invite_code.count)
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
#email_invitation
|
||||||
|
|
||||||
|
= form_tag new_user_invitation_path do
|
||||||
|
%h4
|
||||||
|
= t('email')
|
||||||
|
= text_field_tag 'email_inviter[emails]', @invalid_emails, :title => t('invitations.new.comma_separated_plz'), :placeholder => 'foo@bar.com, max@foo.com...'
|
||||||
|
%p
|
||||||
|
= t('invitations.create.note_already_sent', :emails => @valid_emails) unless @valid_emails.empty?
|
||||||
|
%br
|
||||||
|
|
||||||
|
%h4
|
||||||
|
= t('invitaitons.new.language')
|
||||||
|
= select_tag('email_inviter[locale]', options_from_collection_for_select(available_language_options, "second", "first", :selected => current_user.language))
|
||||||
|
|
||||||
|
%br
|
||||||
|
|
||||||
|
%p
|
||||||
|
= submit_tag t('invitations.new.send_an_invitation'), :disable_with => t('invitations.new.sending_invitation')
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
- unless person == current_user.person
|
- unless person == current_user.person
|
||||||
- contact = current_user.contacts.find_by_person_id(person.id)
|
- contact = current_user.contacts.find_by_person_id(person.id)
|
||||||
- contact ||= Contact.new(:person => person)
|
- contact ||= Contact.new(:person => person)
|
||||||
= aspect_membership_dropdown(contact, person, 'left')
|
= aspect_membership_dropdown(contact, person, 'right')
|
||||||
-else
|
-else
|
||||||
= t('people.person.thats_you')
|
= t('people.person.thats_you')
|
||||||
|
|
|
||||||
|
|
@ -9,38 +9,45 @@
|
||||||
= javascript_include_tag :people
|
= javascript_include_tag :people
|
||||||
= javascript_include_tag 'contact-list'
|
= javascript_include_tag 'contact-list'
|
||||||
|
|
||||||
#section_header
|
.bootstrap_header_padding
|
||||||
= search_header
|
|
||||||
.span-15.append-1
|
|
||||||
#people_stream.stream
|
|
||||||
- if @hashes.empty?
|
|
||||||
- if @background_query.present?
|
|
||||||
|
|
||||||
/ TODO this is gross, and should be extracted!
|
.container-fluid#people_search
|
||||||
:javascript
|
.row-fluid
|
||||||
$(document).ready( function() {
|
.page-header
|
||||||
List.startSearchDelay('#{@background_query}')
|
= search_header
|
||||||
} );
|
.row-fluid
|
||||||
|
.span8
|
||||||
|
#people_stream.stream
|
||||||
|
- if @hashes.empty?
|
||||||
|
- if @background_query.present?
|
||||||
|
|
||||||
|
/ TODO this is gross, and should be extracted!
|
||||||
|
:javascript
|
||||||
|
$(document).ready( function() {
|
||||||
|
List.startSearchDelay('#{@background_query}')
|
||||||
|
} );
|
||||||
|
|
||||||
|
%p
|
||||||
|
= t('.searching')
|
||||||
|
= image_tag('static-loader.png', :class => 'loader')
|
||||||
|
- else
|
||||||
|
%p
|
||||||
|
= t('.no_one_found')
|
||||||
|
- else
|
||||||
|
- for hash in @hashes
|
||||||
|
= render :partial => 'people/person', :locals => hash
|
||||||
|
|
||||||
|
= will_paginate(@people)
|
||||||
|
|
||||||
|
%a{:id=>"back-to-top", :title=>"#{t('layouts.application.back_to_top')}", :href=>"#"}
|
||||||
|
⇧
|
||||||
|
|
||||||
|
.span4
|
||||||
|
- if AppConfig.settings.invitations.open?
|
||||||
|
%h4
|
||||||
|
= t('.couldnt_find_them')
|
||||||
%p
|
%p
|
||||||
= t('.searching')
|
= t('.search_handle')
|
||||||
= image_tag('static-loader.png', :class => 'loader')
|
%h4
|
||||||
- else
|
= t('.send_invite')
|
||||||
%p
|
= render "shared/invitations"
|
||||||
= t('.no_one_found')
|
|
||||||
- else
|
|
||||||
- for hash in @hashes
|
|
||||||
= render :partial => 'people/person', :locals => hash
|
|
||||||
|
|
||||||
= will_paginate(@people)
|
|
||||||
|
|
||||||
- if AppConfig.settings.invitations.open?
|
|
||||||
.span-8.last
|
|
||||||
%h4
|
|
||||||
= t('.couldnt_find_them')
|
|
||||||
%p
|
|
||||||
= t('.search_handle')
|
|
||||||
%h4
|
|
||||||
= t('.send_invite')
|
|
||||||
= render "shared/invitations"
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
= t('.share_this')
|
= t('.share_this')
|
||||||
= invite_link(current_user.invitation_code)
|
= invite_link(current_user.invitation_code)
|
||||||
= link_to t('.by_email'), new_user_invitation_path, :title => t('.invite_someone'), :rel => 'facebox'
|
.btn.btn-link{ 'data-toggle' => 'modal', 'data-target' => '#invitationsModal'}
|
||||||
|
= t('.by_email')
|
||||||
|
|
||||||
|
= render 'shared/modal',
|
||||||
|
:path => new_user_invitation_path,
|
||||||
|
:id => 'invitationsModal',
|
||||||
|
:title => t('invitations.new.invite_someone_to_join')
|
||||||
|
|
|
||||||
3
app/views/shared/_invitations_blueprint.haml
Normal file
3
app/views/shared/_invitations_blueprint.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
= t('shared.invitations.share_this')
|
||||||
|
= invite_link(current_user.invitation_code)
|
||||||
|
= link_to t('shared.invitations.by_email'), new_user_invitation_path(blueprint: true), :title => t('shared.invitations.invite_someone'), :rel => 'facebox'
|
||||||
12
app/views/shared/_modal.haml
Normal file
12
app/views/shared/_modal.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
.modal.hide.fade{ :id => id,
|
||||||
|
:tabindex => '-1',
|
||||||
|
:role => 'dialog',
|
||||||
|
'aria-labelledby' => "#{id}Label",
|
||||||
|
'aria-hidden' => 'true',
|
||||||
|
'data-remote' => path}
|
||||||
|
.modal-header
|
||||||
|
%button.close{:type => 'button', 'data-dismiss' => 'modal', 'aria-hidden' => 'true' }
|
||||||
|
×
|
||||||
|
%h3{ :id => "#{id}Label"}
|
||||||
|
= title
|
||||||
|
.modal-body
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
%h5.title-header
|
%h5.title-header
|
||||||
= t('shared.invitations.invite_your_friends')
|
= t('shared.invitations.invite_your_friends')
|
||||||
.content
|
.content
|
||||||
= render "shared/invitations"
|
= render "shared/invitations_blueprint"
|
||||||
|
|
||||||
.section
|
.section
|
||||||
.title
|
.title
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue