Merge branch 'master' of /var/www/trunk

This commit is contained in:
Zach Copley 2009-01-23 05:37:45 +00:00
commit df25b5f5f5
8 changed files with 163 additions and 270 deletions

View File

@ -90,17 +90,31 @@ class BlockAction extends Action
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($this->arg('block')) {
$this->areYouSureForm();
} else if ($this->arg('no')) {
if ($this->arg('no')) {
$cur = common_current_user();
common_redirect(common_local_url('subscribers', array('nickname' => $cur->nickname)));
} else if ($this->arg('yes')) {
$other = Profile::staticGet('id', $this->arg('blockto'));
common_redirect(common_local_url('showstream', array('nickname' => $other->nickname)));
} elseif ($this->arg('yes')) {
$this->blockProfile();
} elseif ($this->arg('blockto')) {
$this->showPage();
}
}
}
function showContent() {
$this->areYouSureForm();
}
function title() {
return _('Block user');
}
function showNoticeForm() {
// nop
}
/**
* Confirm with user.
*
@ -111,7 +125,6 @@ class BlockAction extends Action
function areYouSureForm()
{
$id = $this->profile->id;
common_show_header(_('Block user'));
$this->element('p', null,
_('Are you sure you want to block this user? '.
'Afterwards, they will be unsubscribed from you, '.
@ -134,7 +147,6 @@ class BlockAction extends Action
$this->submit('no', _('No'));
$this->submit('yes', _('Yes'));
$this->elementEnd('form');
common_show_footer();
}
/**
@ -160,7 +172,7 @@ class BlockAction extends Action
foreach ($this->args as $k => $v) {
if ($k == 'returnto-action') {
$action = $v;
} else if (substr($k, 0, 9) == 'returnto-') {
} elseif (substr($k, 0, 9) == 'returnto-') {
$args[substr($k, 9)] = $v;
}
}

View File

@ -92,14 +92,26 @@ class RemotesubscribeAction extends Action
{
# id = remotesubscribe conflicts with the
# button on profile page
$this->elementStart('form', array('id' => 'remsub', 'method' => 'post',
'action' => common_local_url('remotesubscribe')));
$this->elementStart('form', array('id' => 'form_remote_subscribe',
'method' => 'post',
'class' => 'form_settings',
'action' => common_local_url('remotesubscribe')));
$this->elementStart('fieldset');
$this->element('legend', 'Subscribe to a remote user');
$this->hidden('token', common_session_token());
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$this->input('nickname', _('User nickname'), $this->nickname,
_('Nickname of the user you want to follow'));
$this->elementEnd('li');
$this->elementStart('li');
$this->input('profile_url', _('Profile URL'), $this->profile_url,
_('URL of your profile on another compatible microblogging service'));
$this->elementEnd('li');
$this->elementEnd('ul');
$this->submit('submit', _('Subscribe'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}

View File

@ -95,7 +95,7 @@ class ShownoticeAction extends Action
return false;
}
$this->avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
return true;
}

View File

@ -367,7 +367,7 @@ class ShowstreamAction extends Action
$url = common_local_url('remotesubscribe',
array('nickname' => $this->profile->nickname));
$this->element('a', array('href' => $url,
'id' => 'entity_subscribe_remote'),
'class' => 'entity_remote_subscribe'),
_('Subscribe'));
}

View File

@ -1,5 +1,16 @@
<?php
/*
/**
* Unblock a user action class.
*
* PHP version 5
*
* @category Action
* @package Laconica
* @author Evan Prodromou <evan@controlyourself.ca>
* @author Robin Millette <millette@controlyourself.ca>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://laconi.ca/
*
* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
@ -17,67 +28,86 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('LACONICA')) { exit(1); }
if (!defined('LACONICA')) {
exit(1);
}
/**
* Unblock a user action class.
*
* @category Action
* @package Laconica
* @author Evan Prodromou <evan@controlyourself.ca>
* @author Robin Millette <millette@controlyourself.ca>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://laconi.ca/
*/
class UnblockAction extends Action
{
var $profile = null;
/**
* Take arguments for running
*
* @param array $args $_REQUEST args
*
* @return boolean success flag
*/
function prepare($args)
{
parent::prepare($args);
if (!common_logged_in()) {
$this->clientError(_('Not logged in.'));
return false;
}
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
$this->clientError(_('There was a problem with your session token. Try again, please.'));
return;
}
$id = $this->trimmed('unblockto');
if (!$id) {
$this->clientError(_('No profile specified.'));
return false;
}
$this->profile = Profile::staticGet('id', $id);
if (!$this->profile) {
$this->clientError(_('No profile with that ID.'));
return false;
}
return true;
}
/**
* Handle request
*
* Shows a page with list of favorite notices
*
* @param array $args $_REQUEST args; handled in prepare()
*
* @return void
*/
function handle($args)
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->unblock_profile();
$this->unblockProfile();
}
}
function unblock_profile()
/**
* Unblock a user.
*
* @return void
*/
function unblockProfile()
{
$cur = common_current_user();
$cur = common_current_user();
$result = $cur->unblock($this->profile);
if (!$result) {
$this->serverError(_('Error removing the block.'));
return;
}
foreach ($this->args as $k => $v) {
if ($k == 'returnto-action') {
$action = $v;
@ -85,7 +115,6 @@ class UnblockAction extends Action
$args[substr($k, 9)] = $v;
}
}
if ($action) {
common_redirect(common_local_url($action, $args));
} else {
@ -94,3 +123,4 @@ class UnblockAction extends Action
}
}
}

View File

@ -274,14 +274,19 @@ class NoticeListItem extends Widget
function showAvatar()
{
$avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
if ('shownotice' === $this->out->trimmed('action')) {
$avatar_size = AVATAR_PROFILE_SIZE;
} else {
$avatar_size = AVATAR_STREAM_SIZE;
}
$avatar = $this->profile->getAvatar($avatar_size);
$this->out->element('img', array('src' => ($avatar) ?
common_avatar_display_url($avatar) :
common_default_avatar(AVATAR_STREAM_SIZE),
common_default_avatar($avatar_size),
'class' => 'avatar photo',
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
'width' => $avatar_size,
'height' => $avatar_size,
'alt' =>
($this->profile->fullname) ?
$this->profile->fullname :

View File

@ -1,4 +1,12 @@
/* theme: base */
/** theme: base
*
* @package Laconica
* @author Sarven Capadisli <csarven@controlyourself.ca>
* @copyright 2009 Control Yourself, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://laconi.ca/
*/
* { margin:0; padding:0; }
img { display:block; border:0; }
a abbr { cursor: pointer; border-bottom:0; }
@ -13,7 +21,6 @@ font-size:1em;
line-height:1.65;
position:relative;
margin:0 auto;
width:1004px;
width:71.714em;
}
h1,h2,h3,h4,h5,h6 {
@ -34,7 +41,6 @@ h6 { font-size:0.9em; }
caption {
font-weight:bold;
}
legend {
font-weight:bold;
font-size:1.3em;
@ -59,8 +65,6 @@ font-weight:bold;
textarea {
overflow:auto;
}
select {
}
option {
padding-bottom:0;
}
@ -74,7 +78,6 @@ margin:0 0 18px 0;
}
form label {
font-weight:bold;
/*margin:0 0 11px 0;*/
}
input.checkbox {
position:relative;
@ -104,16 +107,10 @@ margin-bottom:29px;
.form_settings input.remove {
margin-left:11px;
}
.form_guide {
font-style:italic;
}
.form_settings .form_data li {
width:100%;
float:left;
}
.form_settings .form_data label {
float:left;
}
@ -123,7 +120,6 @@ float:left;
margin-left:11px;
float:left;
}
.form_settings label {
margin-top:2px;
width:152px;
@ -132,6 +128,9 @@ width:152px;
.form_actions label {
display:none;
}
.form_guide {
font-style:italic;
}
.form_settings #settings_autosubscribe label {
display:inline;
@ -145,7 +144,8 @@ font-weight:bold;
#form_settings_avatar legend,
#newgroup legend,
#editgroup legend,
#form_tag_user legend {
#form_tag_user legend,
#form_remote_subscribe legend {
display:none;
}
@ -185,7 +185,6 @@ padding:0 7px;
}
address {
float:left;
margin-bottom:18px;
@ -291,12 +290,7 @@ width:100%;
#site_nav_global_secondary dt {
display:none;
}
/*
#site_nav_global_primary .current a {
font-weight:bold;
border-style:solid;
}
*/
#site_nav_global_secondary {
margin-bottom:11px;
}
@ -350,10 +344,9 @@ margin-right:4px;
}
#wrap {
float:left;
margin:0 auto;
width:1004px;
width:71.714em;
float:left;
margin:0 auto;
width:71.714em;
}
#core {
@ -489,9 +482,9 @@ margin-top:11px;
#notice_to select {
float:left;
}
/*end FORM NOTICE*/
/* entity_profile */
.entity_profile {
position:relative;
@ -559,9 +552,9 @@ display:none;
.entity_profile h2 {
display:none;
}
/* entity_profile */
/*entity_actions*/
.entity_actions {
float:right;
@ -594,7 +587,8 @@ cursor:pointer;
width:100%;
}
.entity_actions a,
#entity_nudge p {
#entity_nudge p,
.entity_remote_subscribe {
text-decoration:none;
font-weight:bold;
display:block;
@ -614,6 +608,16 @@ padding-left:20px;
padding:4px 4px 4px 23px;
}
.entity_remote_subscribe {
padding:4px;
border-width:2px;
border-style:solid;
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
}
.entity_tags ul {
list-style-type:none;
}
@ -642,11 +646,6 @@ display:inline;
content: ":";
}
#user_subscriptions,
#user_subscribers,
#user_groups, {
}
.section ul.entities {
width:220px;
float:left;
@ -721,9 +720,6 @@ margin-right:11px;
}
/* NOTICE */
.notice,
.profile {
@ -735,11 +731,9 @@ float:left;
width:100%;
border-top-width:1px;
border-top-style:dashed;
/*-moz-border-radius:7px;*/
}
.notices li {
list-style-type:none;
/*margin-bottom:11px;*/
}
.notices li.hover {
border-radius:4px;
@ -767,11 +761,6 @@ padding-left:28px;
.notice .author {
margin-right:11px;
}
.notice .author a {
}
.notice .author:after {
/*content:":";*/
}
.notice .author .fn {
font-weight:bold;
@ -795,29 +784,20 @@ text-decoration:underline;
}
.vcard .fn {
font-style:italic;
}
.vcard .fn:hover {
}
.notice .entry-title {
float:left;
width:100%;
}
#shownotice .notice .entry-title {
font-size:2.2em;
}
.notice p.entry-content {
display:inline;
}
.notice_video p.entry-content,
.notice_audio p.entry-content,
.notice_image p.entry-content,
.notice_location p.entry-content,
.notice_event p.entry-content,
.notice_document p.entry-content {
}
#laconicat .notice p.entry-content {
/*margin-left:199px;*/
}
#content .notice p.entry-content a:visited {
border-radius:4px;
-moz-border-radius:4px;
@ -932,10 +912,6 @@ text-decoration:none;
padding-left:16px;
}
.notice-options .notice_delete {
}
.notice-options form input.submit {
cursor:pointer;
width:16px;
@ -953,9 +929,19 @@ display:none;
border:0;
padding:0;
}
/*END: NOTICES */
#groups p {
margin-bottom:18px;
}
#groups #new_group a {
padding-left:20px;
}
.pagination dt {
font-weight:bold;
display:none;
@ -995,10 +981,9 @@ border-left:0;
padding-right:20px;
border-right:0;
}
/* END: NOTICE */
/*If there is hentry on #content_inner, then this doesn't need to be specific to #doc or any other section */
.hentry .entry-content p {
margin-bottom:18px;
}
@ -1013,67 +998,10 @@ margin-bottom:18px;
margin-left:18px;
}
/*START: LOAD ALONG WITH JS*/
.notice .in-reply-to {
width:98%;
margin-left:2%;
}
.notice .in-reply-to li {
background-color:#F7F9FB;
}
.notice .in-reply-to li .in-reply-to li {
background-color:#E4E9F0;
}
.notice .in-reply-to li .in-reply-to li .in-reply-to li {
background-color:#D1D9E4;
}
.entity_actions #user_subscribe .form_note,
.entity_actions #user_subscribe .form_data,
.entity_actions #user_subscribe .form_actions label {
display:none;
}
#form_user-relationship .form_note,
#form_user-relationship .form_data,
#form_user-relationship .form_actions label {
display:block;
}
.entity_actions #user-relationship_submit {
margin-bottom:0;
}
#form_user-relationship .form_data li label {
margin-right:11px;
}
#user_relationship_xfn {
/*z-index:1000;
position:absolute;
width:521px;
height:322px;*/
display:none;
}
#user_relationship_xfn fieldset {
background-color:#fff;
}
/*END: LOAD ALONG WITH JS*/
/* TOP_POSTERS */
#top_posters caption {
text-align:left;
text-transform:uppercase;
}
#top_posters thead {
display:none;
}
#top_poster_user {
width:199px;
}
#top_poster_number-of-notices {
width:123px;
}
.section tbody td {
padding-right:11px;
padding-bottom:11px;
@ -1086,7 +1014,6 @@ margin-bottom:0;
.section .notice {
padding-top:11px;
padding-bottom:11px;
}
.section .notice:first-child {
@ -1095,19 +1022,14 @@ border-top:0;
}
/* tagcloud */
.tag-cloud {
list-style-type:none;
text-align:center;
}
.aside .tag-cloud {
font-size:0.8em;
}
.tag-cloud li {
display:inline;
margin-right:7px;
@ -1181,82 +1103,3 @@ clear:both;
#form_settings_avatar .form_actions {
margin-bottom:0;
}
#groups_related ul,
#users_featured ul {
list-style-type:none;
}
#groups_related li,
#users_featured li {
margin-top:11px;
float:left;
width:100%;
}
#groups_related li:first-child,
#users_featured li:first-child {
margin-top:0;
}
#groups_related .vcard,
#users_featured .vcard {
float:left;
margin-bottom:-23px;
}
#groups_related dl,
#users_featured dl {
float:left;
margin-left:63px;
clear:left;
}
#groups_related dt,
#users_featured dt {
display:none;
font-weight:bold;
}
#home.logged_out h1 {
display:none;
}
#home #intro {
margin-bottom:29px;
float:left;
width:100%;
}
#home #intro p {
margin-bottom:18px;
font-size:1.8em;
}
#home #intro #guide_steps {
list-style-type:none;
}
#home #intro #guide_steps li {
float:left;
margin-left:18px;
}
#home #intro #guide_steps li:first-child {
margin-left:0;
}
#home #intro #guide_steps li a {
display:block;
float:left;
width:185px;
height:109px;
border-width:1px;
border-style:dotted;
text-decoration:none;
border-radius:7px;
-moz-border-radius:7px;
-webkit-border-radius:7px;
padding:7px;
font-size:1.6em;
font-weight:bold;
text-align:center;
}
#testimonials {
clear:both;
}

View File

@ -1,4 +1,12 @@
/* theme: identica */
/** theme: identica
*
* @package Laconica
* @author Sarven Capadisli <csarven@controlyourself.ca>
* @copyright 2009 Control Yourself, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://laconi.ca/
*/
html,
body,
a:active {
@ -18,7 +26,8 @@ display:none;
input, textarea, select, option {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}
input, textarea, select {
input, textarea, select,
.entity_remote_subscribe {
border-color:#aaa;
}
@ -26,7 +35,8 @@ border-color:#aaa;
input.submit,
#form_notice.warning #notice_text-count,
#nav_register a,
.form_settings .form_note {
.form_settings .form_note,
.entity_remote_subscribe {
background-color:#A9BF4F;
}
@ -35,7 +45,8 @@ input:focus, textarea:focus, select:focus,
border-color:#A9BF4F;
}
input.submit,
#nav_register a {
#nav_register a,
.entity_remote_subscribe {
color:#fff;
}
@ -66,9 +77,7 @@ background-color:#fcfcfc;
background-color:#fcfffc;
}
#aside_primary,
#entity_subscribe a,
#TB_window input.submit {
#aside_primary {
background-color:#CEE1E9;
}
@ -151,12 +160,6 @@ background-image:url(../../base/images/icons/icon_vcard.gif);
}
/*user_actions*/
#user_actions li {
/*border-top-color:#eee;*/
}
#entity_send-a-message a,
.form_user_nudge input.submit,
.form_user_block input.submit,
@ -259,6 +262,10 @@ background-color:#fcfcfc;
/*END: NOTICES */
#groups #new_group a {
background:transparent url(../images/icons/twotone/green/news.gif) no-repeat 0 45%;
}
.pagination .nav_prev a,
.pagination .nav_next a {
@ -272,19 +279,3 @@ background-position:0 45%;
background-image:url(../images/icons/twotone/green/arrow-right.gif);
background-position:100% 45%;
}
#home #intro #guide_steps li a {
border-color:#ccc;
color:#fff;
}
#home #intro #step_join-now a {
background-color:#f00;
}
#home #intro #step_start-a-group a {
background-color:#0f0;
}
#home #intro #step_create-a-community a {
background-color:#00f;
}