Skip to content

Commit

Permalink
Merge pull request #720 from nishizoe/t-4698
Browse files Browse the repository at this point in the history
(refs #4698, BP from #4696) スマートフォン版に Information ガジェットを追加
  • Loading branch information
balibali authored Dec 11, 2024
2 parents 4b6a1a1 + 7b9d655 commit 649ca2a
Show file tree
Hide file tree
Showing 14 changed files with 242 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php if ($communityCount): ?>
<hr class="toumei" />
<p class="caution">
<?php echo __('You\'ve gotten %1% %community% administrator taking over requests', array('%1%' => $communityCount)) ?>
<br />
<?php echo link_to(__('Go to Confirmation Page'), '@confirmation_list?category=community_admin_request') ?>
</p>
<?php endif; ?>

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php if ($communityMembersCount): ?>
<hr class="toumei" />
<p class="caution">
<?php echo __('You\'ve gotten %1% one\'s %community% joining requests', array('%1%' => $communityMembersCount)); ?>
<br />
<?php echo link_to(__('Go to Confirmation Page'), '@confirmation_list?category=community_confirm') ?>
</p>
<?php endif; ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php if ($communityCount): ?>
<hr class="toumei" />
<p class="caution">
<?php echo __('You\'ve gotten %1% %community% sub-administrator requests', array('%1%' => $communityCount)) ?>
<br />
<?php echo link_to(__('Go to Confirmation Page'), '@confirmation_list?category=community_sub_admin_request') ?>
</p>
<?php endif; ?>

66 changes: 66 additions & 0 deletions apps/pc_frontend/modules/confirmation/templates/smtListSuccess.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php slot('op_sidemenu'); ?>
<?php
$categoryList = array();
foreach ($config as $k => $v)
{
$categoryList[$k] = link_to(__($v), '@confirmation_list?category='.$k);
}

op_include_parts('pageNav', 'pageNav', array('list' => $categoryList, 'current' => $category));
?>
<?php end_slot(); ?>

<?php if (count($list)): ?>
<div class="row">
<div class="gadget_header span12"><?php echo __($config[$category]) ?></div>
</div>
<div class="row">
<div class="pad12">
<?php echo __('You have the following pending requests. Select "Accept" or "Reject".') ?>
</div>

<?php foreach ($list as $item): ?>
<div class="pad12">
<?php echo $form->renderFormTag(url_for('@confirmation_decision?id='.$item['id'].'&category='.$category)) ?>
<?php echo $form->renderHiddenFields() ?>

<table class="smt-table" style="width: 100%;">
<?php foreach ($item['list'] as $k => $v): ?>
<tr>
<th style="width: 40%; "><?php echo __($k) ?></th>
<td>
<?php if ($k == '%nickname%'): ?>
<div style="margin-bottom: 3px;">
<?php echo link_to(op_image_tag_sf_image($item['image']['url'], array('size' => '76x76', 'style' => 'width: 32px;')), $item['image']['link']); ?>
</div>
<?php endif; ?>
<?php if (isset($v['link'])): ?>
<?php echo link_to(nl2br($v['text']), $v['link']) ?>
<?php else: ?>
<?php echo nl2br($v['text']) ?>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<tr class="operation">
<td colspan="3">
<input type="submit" name="accept" value="<?php echo __('Accept') ?>" class="input_submit" />
<input type="submit" value="<?php echo __('Reject') ?>" class="input_submit" />
</td>
</tr>
<?php endforeach; ?>
</table>
</form>
</div>
</div>

<?php else: ?>
<div class="row">
<div class="gadget_header span12"><?php echo __($config[$category]) ?></div>
</div>
<div class="row">
<div class="pad12">
<?php echo __('You don\'t have any pending requests') ?>
</div>
</div>
<?php endif; ?>
5 changes: 5 additions & 0 deletions apps/pc_frontend/modules/default/actions/components.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public function executeInformationBox()
$this->information = Doctrine::getTable('SnsConfig')->get('pc_home_information');
}

public function executeSmtInformationBox()
{
$this->information = Doctrine::getTable('SnsConfig')->get('pc_home_information');
}

public function executeFreeAreaBox()
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
op_include_parts('smtInformationBox', 'information_'.$gadget->getId(), array('body' => $gadget->getRawValue()->getConfig('value')))
?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php if ($sf_user->getMember()->countFriendPreTo()) : ?>
<hr class="toumei" />
<p class="caution">
<?php
echo __('You\'ve gotten %1% %friend% requests', array(
'%1%' => $sf_user->getMember()->countFriendPreTo(),
));
?>
<br />
<?php echo link_to(__('Go to Confirmation Page'), '@confirmation_list?category=friend_confirm') ?>
</p>
<?php endif; ?>
22 changes: 21 additions & 1 deletion apps/pc_frontend/modules/member/config/view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homeSuccess:
template : [community, cautionAboutCommunityMemberPre]
parts : [information]
target : [bodyBottom]
is_component: true
is_component: true
cautionAboutChangeAdminRequest:
template : [community, cautionAboutChangeAdminRequest]
parts : [information]
Expand All @@ -33,6 +33,26 @@ loginSuccess:

smtHomeSuccess:
layout: smtLayoutHome
customize:
cautionAboutFriendPre:
template: [friend, smtCautionAboutFriendPre]
parts : [information]
target : [bodyBottom]
cautionAboutCommunityMemberPre:
template : [community, smtCautionAboutCommunityMemberPre]
parts : [information]
target : [bodyBottom]
is_component: true
cautionAboutChangeAdminRequest:
template : [community, smtCautionAboutChangeAdminRequest]
parts : [information]
target : [bodyBottom]
is_component: true
cautionAboutSubAdminRequest:
template : [community, smtCautionAboutSubAdminRequest]
parts : [information]
target : [bodyBottom]
is_component: true

smtProfileSuccess:
layout: smtLayoutMember
Expand Down
13 changes: 13 additions & 0 deletions apps/pc_frontend/templates/_partsSmtInformationBox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php $options->setDefault('single', true) ?>
<div class="row">
<div class="gadget_header span12"><?php echo __('Information') ?></div>
</div>
<div class="row">
<div class="pad12">
<?php include_customizes($id, 'bodyTop') ?>
<?php include_customizes('information', 'bodyTop') ?>
<?php echo $options->getRaw('body') ?>
<?php include_customizes('information', 'bodyBottom') ?>
<?php include_customizes($id, 'bodyBottom') ?>
</div>
</div>
5 changes: 4 additions & 1 deletion data/fixtures/005_import_gadgets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@ Gadget:
name: "loginForm"
sort_order: 10


gadget_smt_information:
type: "smartphoneContents"
name: "informationBox"
sort_order: 10
17 changes: 17 additions & 0 deletions lib/action/opCommunityComponents.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,21 @@ public function executeCautionAboutSubAdminRequest(opWebRequest $request)
$this->communityCount = Doctrine::getTable('Community')->countPositionRequestCommunities('sub_admin');
}

public function executeSmtCautionAboutCommunityMemberPre(opWebRequest $request)
{
$memberId = sfContext::getInstance()->getUser()->getMemberId();

$this->communityMembersCount = Doctrine::getTable('CommunityMember')->countCommunityMembersPre($memberId);
}

public function executeSmtCautionAboutChangeAdminRequest(opWebRequest $request)
{
$this->communityCount = Doctrine::getTable('Community')->countPositionRequestCommunities('admin');
}

public function executeSmtCautionAboutSubAdminRequest(opWebRequest $request)
{
$this->communityCount = Doctrine::getTable('Community')->countPositionRequestCommunities('sub_admin');
}

}
6 changes: 6 additions & 0 deletions lib/action/opConfirmationAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public function executeList(opWebRequest $request)
}

$this->form = new sfForm();

if ($request->isSmartphone())
{
$this->setLayout('smtLayoutSns');
$this->setTemplate('smtList');
}
}

public function executeDecision(opWebRequest $request)
Expand Down
14 changes: 14 additions & 0 deletions lib/config/config/smartphone_gadget.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
informationBox:
caption:
ja_JP: "インフォメーションボックス"
description:
ja_JP: "ホーム画面にお知らせなどの通知が可能なインフォメーションボックスを設置できます。"
component: [default, smtInformationBox]
config:
value:
Name: "value"
Caption: "内容"
FormType: "rich_textarea"
ValueType: "text"
IsRequired: false

freeArea:
caption:
ja_JP: "フリーエリア"
Expand Down
56 changes: 55 additions & 1 deletion web/css/smt_main.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ul.error_list {
width: auto;
}

ul > li > input[type="text"],
ul > li > input[type="text"],
ul > li > input[type="textarea"],
ul > li > input[type="password"] {
width: 285px;
Expand Down Expand Up @@ -532,3 +532,57 @@ table td {
float: right;
}

/*==============================================================================
* informationBox
*----------------------------------------------------------------------------*/
.smtInformationBox {
border: 1px solid #CCCCCC;
}
.smtInformationBox .pad12 {
padding: 12px;
}

.smtInformationBox div.body {
min-height: 1.2em;
padding: 5px;
border-left: 1px solid #CCCCCC;
background: #FFFFFF;
}
.smtInformationBox .caution {
color: #FF0000;
}

/*==============================================================================
* Other
*----------------------------------------------------------------------------*/
.pad12 {
padding: 12px;
}

.smt-table table {
table-layout: fixed;
}

.smt-table th,
.smt-table td {
border-width: 1px 1px 1px 1px !important;
border-style: solid !important;
border-color: #CCCCCC !important;
padding: 3px 3px 3px 3px !important;
font-weight: normal;
font-size: 0.98em;
}

.smt-table tr.operation {
text-align: right;
padding-top: 2px !important;
}

.input_submit {
border: 1px solid #888888;
background: #dadce6 url('../images/bg_button.gif') repeat-x scroll 50% 0;
letter-spacing: 0;
width: 50px !important;
margin-bottom: 0 !important;
margin-left: 2px !important;
}

0 comments on commit 649ca2a

Please sign in to comment.