Blend people tags UI into the new theme!

This commit is contained in:
Shashi Gowda 2011-03-22 10:40:16 +05:30
parent 13e9e41d2f
commit f81aaa5375
5 changed files with 260 additions and 15 deletions

View File

@ -34,6 +34,8 @@ if (!defined('STATUSNET')) {
exit(1);
}
require_once INSTALLDIR.'/lib/peopletags.php';
/**
* Profile block to show for an account
*
@ -93,6 +95,22 @@ class AccountProfileBlock extends ProfileBlock
return $this->profile->bio;
}
function showTags()
{
$cur = common_current_user();
$self_tags = new SelftagsWidget($this->out, $this->profile, $this->profile);
$self_tags->show();
if ($cur) {
// don't show self-tags again
if ($cur->id != $this->profile->id && $cur->getProfile()->canTag($this->profile)) {
$tags = new PeopletagsWidget($this->out, $cur, $this->profile);
$tags->show();
}
}
}
function showActions()
{
if (Event::handle('StartProfilePageActionsSection', array($this->out, $this->profile))) {

View File

@ -173,7 +173,7 @@ class PeopletagEditForm extends Form
$this->out->element('h2', null, 'Add or remove people');
$this->out->elementStart('div', 'profile_search_wrap');
$this->out->element('h3', null, 'Add user');
$this->out->element('h3', null, _m('BUTTON', 'Search'));
$search = new SearchProfileForm($this->out, $this->peopletag);
$search->show();
$this->out->element('ul', array('id' => 'profile_search_results', 'class' => 'empty'));

View File

@ -100,6 +100,7 @@ abstract class ProfileBlock extends Widget
$description);
}
$this->showTags();
$this->showActions();
$this->out->elementEnd('div');
@ -110,6 +111,10 @@ abstract class ProfileBlock extends Widget
return AVATAR_PROFILE_SIZE;
}
function showTags()
{
}
function showActions()
{
}

View File

@ -695,7 +695,7 @@ background-color:rgba(200, 200, 200, 0.300);
margin-bottom: 10px;
}
.entity_actions a, .entity_actions p, .entity_actions .entity_subscribe input, .entity_actions .entity_block input, .entity_actions .entity_moderation input, .entity_actions .entity_role input, .entity_actions .entity_nudge input, .entity_actions .entity_delete input {
.entity_actions a, .entity_actions p, .entity_actions .entity_subscribe input, .entity_actions .entity_block input, .entity_actions .entity_moderation input, .entity_actions .entity_role input, .entity_actions .entity_nudge input, .entity_actions .entity_delete input, .entity_actions input.submit {
text-shadow:0 1px 0 rgba(255,255,255,0.4);
border-radius: 4px;
-moz-border-radius: 4px;

View File

@ -399,7 +399,7 @@ address .poweredby {
padding-bottom: 2px;
}
.notice, .profile, .application {
.notice, .profile, .application, #content .peopletag {
position:relative;
clear:both;
float:left;
@ -554,7 +554,7 @@ left:0;
padding-left:16px;
}
.notice .attachment.more {
.notice .attachment.more, .mode-private .privacy_mode {
text-indent:-9999px;
width:16px;
height:16px;
@ -1081,7 +1081,7 @@ font-weight:bold;
#form_settings_avatar legend,
#newgroup legend,
#editgroup legend,
#form_tag_user legend,
.form_tag_user legend,
#form_remote_subscribe legend,
#form_openid_login legend,
#form_search legend,
@ -1091,10 +1091,26 @@ font-weight:bold;
#form_password_change legend,
.form_entity_block legend,
#form_filter_bytag legend,
#apioauthauthorize_allowdeny {
#apioauthauthorize_allowdeny,
.form_tag_user_wrap form,
.form_tag_user_wrap label,
.form_tag_user_wrap legend {
display:none;
}
.form_tag_user_wrap {
clear:both;
}
.form_tag_user {
float:left;
width:auto;
}
.form_tag_user input.submit {
width:50px;
}
.form_settings .form_data p.form_guide {
clear:both;
margin-left:26%;
@ -1321,6 +1337,14 @@ margin-left:113px;
margin-bottom:4px;
}
.peopletags_edit_button {
cursor:pointer;
border:0;
padding:0;
width:16px;
height:16px;
}
.entity_profile .entity_nickname,
.entity_profile .entity_fn {
margin-left:0;
@ -1408,7 +1432,7 @@ display:block;
padding: 4px 4px 4px 26px;
}
.entity_actions a, .entity_actions p, .entity_actions .entity_subscribe input, .entity_actions .entity_block input, .entity_actions .entity_moderation input, .entity_actions .entity_role input, .entity_actions .entity_nudge input, .entity_actions .entity_delete input {
.entity_actions a, .entity_actions p, .entity_actions .entity_subscribe input, .entity_actions .entity_block input, .entity_actions .entity_moderation input, .entity_actions .entity_role input, .entity_actions .entity_nudge input, .entity_actions .entity_delete input, .entity_actions input.submit {
background-color: #ccc !important;
border: none;
}
@ -1417,7 +1441,7 @@ display:block;
padding: 2px 4px 4px 28px;
}
.entity_actions a:hover, .entity_actions p:hover, .entity_actions .entity_subscribe input:hover, .entity_actions .entity_block input:hover, .entity_actions .entity_moderation input:hover, .entity_actions .entity_role input:hover, .entity_actions .entity_nudge input:hover, .entity_actions .entity_delete input:hover {
.entity_actions a:hover, .entity_actions p:hover, .entity_actions .entity_subscribe input:hover, .entity_actions .entity_block input:hover, .entity_actions .entity_moderation input:hover, .entity_actions .entity_role input:hover, .entity_actions .entity_nudge input:hover, .entity_actions .entity_delete input:hover, .entity_actions input.submit:hover {
background-color: #f2f2f2 !important;
}
@ -1509,6 +1533,9 @@ margin-right:7px;
.entity_tags li:before {
content:'\0009';
}
.entity_tags p.error {
clear:both;
}
#filter_tags {
margin-bottom: 20px;
@ -1529,17 +1556,35 @@ padding-left:7px;
border-left-width: 1px;
border-left-style:solid;
}
#filter_tags #filter_tags_all {
#filter_tags #filter_tags_all,
#filter_tags #filter_tags_for {
margin-left: 10px;
border-left:0;
padding-left:0;
}
#filter_tags_all a {
#filter_tags_all a,
#filter_tags_for a {
font-weight:bold;
margin-top: 4px;
float:left;
}
#filter_tags_for a {
margin:0;
}
#filter_tags #form_filter_bymode .form_guide {
display:none;
}
#filter_tags #form_filter_bymode .checkbox {
float:none;
}
#filter_tags #form_filter_bymode legend {
display:none;
}
#filter_tags_item label {
margin-right: 14px;
margin-left: 7px;
@ -1569,7 +1614,9 @@ min-height:60px;
.profile .form_group_join legend,
.profile .form_group_leave legend,
.profile .form_user_subscribe legend,
.profile .form_user_unsubscribe legend {
.profile .form_user_unsubscribe legend,
.form_user_add_peopletag legend,
.form_user_remove_peopletag legend {
display:none;
}
@ -1604,9 +1651,120 @@ clear:none;
display:block;
width:auto;
}
.profile .entity_profile .entity_tags dt {
.profile_block .entity_tags dt {
display: inline;
margin-right: 3px;
font-weight: bold;
}
.profile_block .entity_tags dd {
display: inline;
}
.profile .entity_profile .form_subscription_edit {
clear:left;
}
.peopletag {
min-height: 90px;
list-style: none;
}
.peopletag .entry-content {
width:auto;
}
.peopletag .tagged-count a:after,
.peopletag .subscriber-count a:after,
.entity_tags dt:after {
content: ':';
}
.peopletag .updated {
display:none;
}
.peopletag .tag a{
font-weight: bold;
}
.peopletag .tag:before {
/* raquo */
content: "\00BB";
}
.peopletag .entity_statistics {
font-size:80%;
}
.profile-lister li {
min-height:30px;
padding:5px;
clear:both;
border-top: 1px #eee solid;
}
.profile-lister {
list-style-type:none;
}
.profile_search_wrap h3 {
float:left;
font-weight:normal;
margin-right:10px;
}
.profile-lister li .photo {
display:inline;
margin-right:11px;
margin-right:7px;
margin-bottom:-5px;
}
.profile-lister li .fn {
font-weight:bold;
}
.profile-lister li .entity_actions {
margin:0;
}
#profile_search_results {
display:block;
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
max-height:800px;
margin:10px 0;
padding: 5px;
border:1px #ddd solid;
background:#f1f1f1;
}
#profile_search_results.empty {
display: none;
}
.form_peopletag_edit_user_search legend,
.form_peopletag_edit_user_search label,
.form_peopletag_edit_user_search .form_guide {
display:none;
}
.form_peopletag_edit_user_search #field {
height:30px;
}
.form_peopletag_edit_user_search .submit {
width:60px;
}
.form_user_remove_peopletag,
.form_user_add_peopletag {
float:right;
}
.form_user_add_peopletag input.submit,
.form_user_remove_peopletag input.submit {
width:100px;
padding-left:25px;
text-align:left;
}
.profile .entity_profile .form_subscription_edit label {
@ -1779,17 +1937,24 @@ button.close,
.entity_role p,
.entity_role_administrator input.submit,
.entity_role_moderator input.submit,
.form_user_remove_peopletag input.submit,
.form_user_add_peopletag input.submit,
.form_peopletag_subscribe input.submit,
.form_peopletag_unsubscribe input.submit,
.notice-options .repeated,
.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_tag a,
.entity_clear input.submit,
.entity_flag input.submit,
.entity_flag p,
.entity_subscribe input.submit,
#realtime_play,
#realtime_pause,
#realtime_popup {
#realtime_popup,
.peopletags_edit_button,
.mode-private .privacy_mode {
background-image:url(../images/icons/icons-01.gif);
background-repeat:no-repeat;
background-color:transparent;
@ -1811,15 +1976,23 @@ background-position:0 -64px;
background-position:0 1px;
}
.form_group_leave input.submit,
.form_user_unsubscribe input.submit {
.form_user_unsubscribe input.submit,
.form_user_remove_peopletag input.submit,
.form_peopletag_unsubscribe input.submit {
background-position:5px -1246px;
}
.form_group_join input.submit,
.form_user_subscribe input.submit,
.form_remote_authorize input.submit,
.form_user_add_peopletag input.submit,
.form_peopletag_subscribe input.submit,
.entity_subscribe a {
background-position:5px -1181px;
}
.peopletags_edit_button {
background-position: 0 -724px;
}
.entity_edit a {
background-position: 5px -719px;
}
@ -1982,6 +2155,55 @@ padding-left:20px;
display: block;
}
.entity_tags li.mode-private {
color: #829D25;
}
.mode-private .privacy_mode {
background-position: 0px -1978px;
}
/* tag autocomplete */
.tagInputDiv {
display: none;
position: absolute;
background-color:#f1f1f1;
overflow: auto;
margin-top:-1px;
z-index: 99;
}
.tagInputLine {
font-weight: normal;
padding:4px;
}
.tagInputLineTag {
min-width: 150px;
display: inline-block;
}
.tagInputLineFreq {
min-width: 50px;
text-align: right;
display: inline-block;
float:right;
}
.tagInputDiv {
background-color: white;
border: 1px solid lightgray;
}
.tagInputDiv .mode-public .privacy_mode {
display:none;
}
.tagInputSel {
background-color: gray;
color:white;
}
/*end of @media screen, projection, tv*/