Skip to content

Commit

Permalink
Merge pull request #1398 from voltan/develop
Browse files Browse the repository at this point in the history
Update message module
  • Loading branch information
taiwen committed Feb 26, 2016
2 parents 024032f + 3cb63b4 commit e7002cb
Show file tree
Hide file tree
Showing 53 changed files with 2,109 additions and 1,084 deletions.
4 changes: 4 additions & 0 deletions usr/module/message/asset/script/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.message-single {
padding: 15px 5px;
border-bottom: 1px solid #ccc;
}
39 changes: 24 additions & 15 deletions usr/module/message/asset/script/front.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
padding: 12px 20px 18px 15px;
padding-left: 12px \9;
margin-top: 0;
cursor: pointer;
}

.message-hidden .message-mark,
Expand All @@ -31,7 +30,7 @@

.message-detail-primary:hover .message-hidden,
.message-item:hover .message-hidden {
display: block;
/* display: block; */
}

.message-hidden {
Expand All @@ -40,8 +39,7 @@
}

.message-media-right {
width: 160px;
margin-left: 60px;
width: 200px;
}

.message-time {
Expand Down Expand Up @@ -79,20 +77,20 @@
color: #005580;
}

.message-content p {
width: 628px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.message-content p.message-body {
width: 690px;
.message-content a {
color: #000;
text-decoration: none;
width: 100%;
padding: 8px;
display: block;
margin: 0 -8px;
}

.message-content p a {
color: #888;
.message-content a:hover {
color: #000;
text-decoration: none;
background-color: #e0e0e0;
border-radius: 4px;
}

.message-foot-form {
Expand Down Expand Up @@ -272,3 +270,14 @@
font-weight: bold;
}

.form-group label.col-md-12 {
text-align: left;
}

.message-checkbox {
margin-top: 10px;
}

.message-avatar {
margin: 0 20px;
}
2 changes: 1 addition & 1 deletion usr/module/message/asset/script/index-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
var href = app.$delete.attr('href');
$('#confirm-modal').find('.modal-body').text($(this).attr('data-confirm'));
$('.confirm-ok').attr('href', href);
$('#confirm-modal').modal({show: true});
$('#confirm-modal').modal('show');
return false;
},
};
Expand Down
28 changes: 14 additions & 14 deletions usr/module/message/asset/script/index-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
}
},
batchAction: function () {
var checked = app.$('.message-js-check:checked');
var checked = this.$('.message-js-check:checked');
var action = $.trim(this.$select.val());
var ids = [];

if (checked.length) {
if (action == "delete") {
if (!confirm(options.confirms)) {
app.$select.attr('value', '');
return;
if (checked.length > 1) {
$('#confirm-modal').modal('show');
} else {
$('#confirm-modal').modal('show');
}
return false;
}

checked.each(function () {
ids.push($(this).attr('data-id'));
});
Expand All @@ -60,21 +60,21 @@
location.href = url;
}
} else {
app.$select.attr('value', '');
this.$select.attr('value', '');
}
},
itemsBind: function (c) {
if (c.target.tagName === "A" || c.target.tagName === "INPUT" || c.target.tagName === "IMG") {
return;
}
window.location = $(this).find(".message-content p a").attr("href")
window.location = $(this).find(".message-content-link").attr("href")
},
deleteAction: function (e) {
var target = $(e.target);
var msg = target.data('confirm')
if (!confirm(msg)) {
e.preventDefault();
}
deleteAction: function () {
var href = $(this).attr('href');
$('#confirm-modal').find('.modal-body').text($(this).attr('data-confirm'));
$('.confirm-ok').attr('href', href);
$('#confirm-modal').modal('show');
return false;
},
};

Expand Down
12 changes: 4 additions & 8 deletions usr/module/message/asset/script/notify-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@
if (checked.length) {
if (action == "delete") {
if (checked.length > 1) {
$('#confirm-modals').modal({show: true});
}
else {
$('#confirm-modal').modal({show: true});
$('#confirm-modal').modal('show');
} else {
$('#confirm-modal').modal('show');
}
return false;
}
Expand All @@ -63,9 +62,6 @@
} else {
this.$select.attr('value', '');
}
if ($(this).val() == 'delete') {

}
},
itemsBind: function (c) {
if (c.target.tagName === "A" || c.target.tagName === "INPUT" || c.target.tagName === "IMG") {
Expand All @@ -77,7 +73,7 @@
var href = $(this).attr('href');
$('#confirm-modal').find('.modal-body').text($(this).attr('data-confirm'));
$('.confirm-ok').attr('href', href);
$('#confirm-modal').modal({show: true});
$('#confirm-modal').modal('show');
return false;
},
};
Expand Down
7 changes: 5 additions & 2 deletions usr/module/message/config/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// Description, for admin, optional
'description' => _a('A module to send message'),
// Version number, required
'version' => '1.0.0',
'version' => '1.0.6',
// Distribution license, required
'license' => 'New BSD',
// Module is ready for clone? Default as false
Expand All @@ -45,10 +45,13 @@
// SQL schema/data file
'sqlfile' => 'sql/mysql.sql',
),
// permission
'permission' => 'permission.php',
// page
'page' => 'page.php',
// Navigation definition
'navigation' => 'navigation.php',
// User specs
'user' => 'user.php',
),

);
48 changes: 21 additions & 27 deletions usr/module/message/config/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,29 @@
*/

return array(

// Hide from front menu
'front' => false,
/*
'front' => array(
'private' => array(
'label' => _a('Private message'),
'route' => 'default',
'controller' => 'index',
'action' => 'index',
),
'archive' => array(
'label' => _a('Archive'),
'route' => 'default',
'controller' => 'index',
'action' => 'archive'
),
'notify' => array(
'label' => _a('Notification'),
'route' => 'default',
'controller' => 'notify',
'action' => 'index',
// Admin side
'admin' => array(
'list' => array(
'label' => _a('List'),
'permission' => array(
'resource' => 'list',
),
'route' => 'admin',
'module' => 'message',
'controller' => 'list',
'action' => 'index',
),
'send' => array(
'label' => _a('New message'),
'route' => 'default',
'controller' => 'index',
'action' => 'send',
'prune' => array(
'label' => _a('Prune'),
'permission' => array(
'resource' => 'prune',
),
'route' => 'admin',
'module' => 'message',
'controller' => 'prune',
'action' => 'index',
),
),
*/
);
);
27 changes: 27 additions & 0 deletions usr/module/message/config/page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Pi Engine (http://pialog.org)
*
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* @author Hossein Azizabadi <[email protected]>
*/
return array(
// Admin section
'admin' => array(
array(
'title' => _a('List'),
'controller' => 'list',
'permission' => 'list',
),
array(
'title' => _a('Prune'),
'controller' => 'prune',
'permission' => 'prune',
),
),
);
25 changes: 25 additions & 0 deletions usr/module/message/config/permission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* Pi Engine (http://pialog.org)
*
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* @author Hossein Azizabadi <[email protected]>
*/
return array(
// Admin section
'admin' => array(
'list' => array(
'title' => _a('List'),
'access' => array(),
),
'prune' => array(
'title' => _a('Prune'),
'access' => array(),
),
),
);
Binary file modified usr/module/message/locale/en/admin.mo
Binary file not shown.
29 changes: 13 additions & 16 deletions usr/module/message/locale/en/admin.po
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
msgid ""
msgstr ""
"Project-Id-Version: Pi-message\n"
"POT-Creation-Date: 2013-11-10 13:57+0800\n"
"PO-Revision-Date: 2013-11-10 13:58+0800\n"
"POT-Creation-Date: 2016-02-25 15:54+0330\n"
"PO-Revision-Date: 2016-02-25 15:54+0330\n"
"Last-Translator: Taiwen Jiang <[email protected]>\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.7\n"
"X-Generator: Poedit 1.8.5\n"
"X-Poedit-KeywordsList: _a;_t\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: C:\\wamp\\www\\master\\usr\\module\\message\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-SearchPath-0: .\n"

#: C:\wamp\www\master\usr\module\message/config/module.php:17
#: config/module.php:17
msgid "Message"
msgstr ""

#: C:\wamp\www\master\usr\module\message/config/module.php:19
#: config/module.php:19
msgid "A module to send message"
msgstr ""

#: C:\wamp\www\master\usr\module\message/config/navigation.php:13
msgid "Private message"
#: config/navigation.php:16 config/page.php:17 config/permission.php:17
msgid "List"
msgstr ""

#: C:\wamp\www\master\usr\module\message/config/navigation.php:19
msgid "Notification"
#: config/navigation.php:26 config/page.php:22 config/permission.php:21
msgid "Prune"
msgstr ""

#: C:\wamp\www\master\usr\module\message/config/navigation.php:25
msgid "New message"
msgstr ""

#: C:\wamp\www\master\usr\module\message/config/user.php:20
#: config/user.php:20
msgid "Messages"
msgstr ""

Expand Down
Binary file modified usr/module/message/locale/en/block.mo
Binary file not shown.
11 changes: 6 additions & 5 deletions usr/module/message/locale/en/block.po
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
msgid ""
msgstr ""
"Project-Id-Version: Pi-message\n"
"POT-Creation-Date: 2013-11-10 13:58+0800\n"
"PO-Revision-Date: 2013-11-10 13:58+0800\n"
"POT-Creation-Date: 2015-10-23 10:13+0330\n"
"PO-Revision-Date: 2015-10-23 10:13+0330\n"
"Last-Translator: Taiwen Jiang <[email protected]>\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.7\n"
"X-Generator: Poedit 1.8.5\n"
"X-Poedit-KeywordsList: _b\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: C:\\wamp\\www\\master\\usr\\module\\message\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-SearchPath-0: .\n"

#~ msgid "Checked all"
#~ msgstr "All Categories"
Binary file modified usr/module/message/locale/en/default.mo
Binary file not shown.
Loading

0 comments on commit e7002cb

Please sign in to comment.