Skip to content

Commit

Permalink
Update to 0.2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Goroun committed Nov 7, 2016
1 parent 881c880 commit 9829627
Show file tree
Hide file tree
Showing 16 changed files with 402 additions and 77 deletions.
285 changes: 234 additions & 51 deletions Controller/EditorController.php

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Controller/PointController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace IgorGoroun\FTNWBundle\Controller;

use Doctrine\Common\Cache\ApcuCache;
use IgorGoroun\FTNWBundle\Entity\reCaptcha;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/FTNWExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setParameter('ftnw_ver','ftnw-0.2.6');
$container->setParameter('ftnw_ver','ftnw-0.2.10');
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
Expand Down
17 changes: 17 additions & 0 deletions Entity/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ class Navigation
private $prev = null;
private $new = null;
private $reply = null;
private $unseen = 0;

/**
* @return int
*/
public function getUnseen()
{
return $this->unseen;
}

/**
* @param int $unseen
*/
public function setUnseen($unseen)
{
$this->unseen = $unseen;
}

private $list_unseen = null;
private $list_all = null;
Expand Down
38 changes: 38 additions & 0 deletions Form/EmailPostType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace IgorGoroun\FTNWBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class EmailPostType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('hTo',EmailType::class,['label'=>'To:','attr'=>['class'=>'form-control','placeholder'=>'Recipient e-mail'],'label_attr'=>['class'=>'col-xs-12 col-sm-2 control-label']])
->add('subject',TextType::class,['label'=>'Subject:','attr'=>['placeholder'=>'Subject','class'=>'form-control'],'label_attr'=>['class'=>'col-sm-2 control-label']])
->add('body',TextareaType::class,['attr'=>['rows'=>14,'class'=>'form-control textarea ftnweditor']])
->add('save',SubmitType::class,['label'=>'Send','attr'=>['value'=>'Send','class'=>'btn btn-primary btn-md']])
;
}

/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'IgorGoroun\FTNWBundle\Entity\Netmail'
));
}
}
5 changes: 4 additions & 1 deletion Resources/config/doctrine/MessageCache.orm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ IgorGoroun\FTNWBundle\Entity\MessageCache:
type: entity
table: null
repositoryClass: IgorGoroun\FTNWBundle\Repository\MessageCacheRepository
indexes:
em_hdate_idx:
columns: [h_date]
id:
id:
type: integer
Expand Down Expand Up @@ -37,7 +40,7 @@ IgorGoroun\FTNWBundle\Entity\MessageCache:
column: h_to_ftn
hToRfc:
type: string
length: '32'
length: '64'
nullable: true
column: h_to_rfc
hDate:
Expand Down
5 changes: 4 additions & 1 deletion Resources/config/doctrine/Netmail.orm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ IgorGoroun\FTNWBundle\Entity\Netmail:
type: entity
table: null
repositoryClass: IgorGoroun\FTNWBundle\Repository\NetmailRepository
indexes:
nm_hdate_idx:
columns: [h_date]
id:
id:
type: integer
Expand All @@ -28,7 +31,7 @@ IgorGoroun\FTNWBundle\Entity\Netmail:
column: h_from_ftn
hTo:
type: string
length: '32'
length: '64'
column: h_to
hToFtn:
type: string
Expand Down
3 changes: 3 additions & 0 deletions Resources/config/parameters.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ parameters:
node_binkd_host: 'fido.snake.mk.ua'
node_api_passwd: '####'
node_tearline: 'Sent with FTNW. https://fido.snake.mk.ua'
internet_gate: '2:46/128'
point_default_origin: 'FTNW. https://fido.snake.mk.ua'
point_default_subscription: 'wbw, '
group_list_visible: 10
recaptcha_site_key: ''
recaptcha_secret_key: ''
recaptcha_verify_host: 'https://www.google.com/recaptcha/api/siteverify'
Expand All @@ -15,3 +17,4 @@ twig:
globals:
node_address: '%node_ftn_address%'
node_host: '%node_binkd_host%'
recaptcha_site_key: '%recaptcha_site_key%'
7 changes: 5 additions & 2 deletions Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ netmail_message:
netmail_id: \d+

netmail_post:
path: /netmail/post
defaults: { _controller: FTNWBundle:Editor:netmailPost }
path: /netmail/post/{nm}/{rfca}
defaults: { _controller: FTNWBundle:Editor:netmailPost, nm: null, rfca: null }
netmail_email:
path: /netmail/email
defaults: { _controller: FTNWBundle:Editor:netmailPostEmail }

netmail_reply:
path: /netmail/{id}/reply
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Editor/echomail-buttons.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="btn-group" role="group" aria-label="...">
{% if nav.prev is defined %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.prev}) }}" type="button" class="btn btn-primary btn-md">&larr;</a>{% endif %}
{% if nav.prev %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.prev}) }}" type="button" class="btn btn-primary btn-md">&larr;</a>{% endif %}
<a href="{{ path('fidonews_post',{'id':group_current.id}) }}" type="button" class="btn btn-primary btn-md"><span class="glyphicon glyphicon-plus"></span> New</a>
<a href="{{ path('fidonews_reply',{'id':message.id}) }}" type="button" class="btn btn-primary btn-md"><span class="glyphicon glyphicon-share-alt"></span> Reply</a>
{% if group_current is defined %}
Expand All @@ -15,5 +15,5 @@
</ul>
</div>
{% endif %}
{% if nav.next is defined %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.next}) }}" type="button" class="btn btn-primary btn-md">&rarr;</a>{% endif %}
{% if nav.next %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.next}) }}" type="button" class="btn btn-primary btn-md">&rarr;</a>{% endif %}
</div>
53 changes: 53 additions & 0 deletions Resources/views/Editor/email-new.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% extends 'FTNWBundle:Layout:main.html.twig' %}

{% block stylesheets %}
{{ parent() }}
{% endblock %}

{% block body %}
{{ parent() }}
<div class="container">
<div class="row">
<div class="col-md-3">
{% include 'FTNWBundle:Editor:netlistmenu.html.twig' %}
</div>
<div class="col-md-9">
<div class="page-header hidden-xs">
<h1 class="bloghead"><small>new</small> Email</h1>
</div>
{{ form_start(form, {'attr': {'class':'form-horizontal'}}) }}
<div class="form-group">
{{ form_label(form.hTo) }}
<div class="col-xs-6 col-sm-5">
{{ form_widget(form.hTo) }}
</div>
</div>
<div class="form-group">
{{ form_label(form.subject) }}
<div class="col-sm-10">
{{ form_widget(form.subject) }}
</div>
</div>
<div class="form-group">
<div class="col-xs-12">
{{ form_widget(form.body) }}
</div>
</div>
{{ form_widget(form.save) }}
{{ form_end(form) }}
<div class="row">
<div class="col-xs-12">
<blockquote class="blockquote-reverse">
{{ point.origin }}
<footer>{{ node_address }}</footer>
</blockquote>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

{% block javascripts %}
{{ parent() }}
{% endblock %}
29 changes: 23 additions & 6 deletions Resources/views/Editor/grouplistmenu.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@

<div class="list-group hidden-xs hidden-sm">
<a href="{{ path("netmail") }}" class="list-group-item">{% if netmail_unread is defined %}<span class="badge">{{ netmail_unread }}</span>{% endif %}NETMAIL</a>
{% for group in groups %}
<a href="{{ path('fidonews_group',{'group_id':group.id}) }}" class="list-group-item"><span class="badge">{{ group.cnt }}</span>{{ group.name }}</a>
{% endfor %}
<div class="panel-group hidden-xs hidden-sm" role="tablist">
<div class="panel panel-default">
<div class="list-group">
<a href="{{ path("netmail") }}" class="list-group-item">{% if netmail_unread is defined %}<span class="badge">{{ netmail_unread }}</span>{% endif %}NETMAIL</a>
{% for group in groups_visible %}
<a href="{{ path('fidonews_group',{'group_id':group.id}) }}" class="list-group-item"><span class="badge">{{ group.cnt }}</span>{{ group.name }}</a>
{% endfor %}
</div>
{% if groups_more is defined %}
<div class="panel-collapse collapse" role="tabpanel" id="echoFullList" aria-labelledby="collapseListGroupHeading1" aria-expanded="true" style="">
<div class="list-group">
{% for group in groups_more %}
<a href="{{ path('fidonews_group',{'group_id':group.id}) }}" class="list-group-item"><span class="badge">{{ group.cnt }}</span>{{ group.name }}</a>
{% endfor %}
</div>
</div>
<div class="panel-heading" role="tab" id="collapseListGroupHeading1">
<h4 class="panel-title">
<a href="#echoFullList" class="" id="echoListMoreButton" role="button" data-toggle="collapse" aria-expanded="true" aria-controls="echoFullList">Еще <span class="glyphicon glyphicon-chevron-down"></span></a>
</h4>
</div>
{% endif %}
</div>
</div>
14 changes: 7 additions & 7 deletions Resources/views/Editor/groups.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<h1 class="bloghead">
{{ group_current.name }}
{% if nav %}
<small>{{ nav.current }}/{{ nav.total }}</small>
<small>{{ nav.unseen }} new</small>
{% endif %}
</h1>
</div>
Expand All @@ -34,12 +34,12 @@
<table class="table table-condensed">
<tr class="default">
<td class="text-right"><strong>From:</strong></td>
<td class="text-left">{{ message.hFrom }} <a class="btn btn-xs btn-default">{{ message.hFromFtn }}</a></td>
<td class="text-left">{{ message.hFrom }} <a href="{{ path('netmail_post',{'nm':message.hFrom,'rfca':message.hFromRfc}) }}" class="btn btn-xs btn-default">{{ message.hFromFtn }}</a></td>
<td class="text-left">{{ message.hDate|date('d M Y H:i O') }}</td>
</tr>
<tr class="default">
<td class="text-right"><strong>To:</strong></td>
<td class="text-left">{{ message.hTo }} {% if message.hToFtn %}<a class="btn btn-xs btn-default">{{ message.hToFtn }}</a>{% endif %}</td>
<td class="text-left">{{ message.hTo }} {% if message.hToFtn %}<a href="{{ path('netmail_post',{'nm':message.hTo,'rfca':message.hToRfc}) }}" class="btn btn-xs btn-default">{{ message.hToFtn }}</a>{% endif %}</td>
<td class="text-left">
</td>
</tr>
Expand All @@ -57,7 +57,7 @@
<li><a href="{{ path('fidonews_reply',{'id':message.id}) }}"><span class="glyphicon glyphicon-share-alt"></span> Reply to message</a></li>
<li role="separator" class="divider"></li>
<li><a href="{{ path("fidonews_group_list",{'group_id':group_current.id}) }}"><span class="glyphicon glyphicon-list"></span> Unseen messages list</a></li>
<li><a role="button" data-toggle="collapse" href="#collapseHeaders" aria-expanded="false" aria-controls="collapseHeaders"><span class="glyphicon glyphicon-console"></span>Message headers</a></li>
<li><a role="button" data-toggle="collapse" href="#collapseHeaders" aria-expanded="false" aria-controls="collapseHeaders"><span class="glyphicon glyphicon-console"></span> Message headers</a></li>
</ul>
</div>
{% endif %}
Expand All @@ -67,11 +67,11 @@
</div>
<p>
<div class="btn-group btn-group-justified visible-sm visible-xs" role="group" aria-label="...">
{% if nav.prev is defined %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.prev}) }}" type="button" class="btn btn-primary">&larr;</a>{% endif %}
{% if nav.prev %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.prev}) }}" type="button" class="btn btn-primary">&larr;</a>{% endif %}
<a href="{{ path("netmail") }}" class="btn btn-primary">Netmail{% if netmail_unread %} <span class="badge">{{ netmail_unread }}</span>{% endif %}</a>
<a class="btn btn-primary active" role="button" data-toggle="collapse" href="#collapseAreas" aria-expanded="false" aria-controls="collapseAreas">{% if group_current is defined %}{{ group_current.name }}{% else %}Echoareas{% endif %}
<span class="caret"></span></a>
{% if nav.next is defined %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.next}) }}" type="button" class="btn btn-primary">&rarr;</a>{% endif %}
{% if nav.next %}<a href="{{ path('fidonews_message',{'group_id':group_current.id,'message_number':nav.next}) }}" type="button" class="btn btn-primary">&rarr;</a>{% endif %}
</div>
</p>
<div class="collapse" id="collapseAreas">
Expand Down Expand Up @@ -135,7 +135,7 @@
<script>
$(function(){
//$("#message_body>code").text(parseText($("#message_body>code").text()));
//$("div.message_viewer").text(parseText($("div.message_viewer").text()));
//console.log($("#message_body>code").text());
function parseText(text) {
var rows = text.split('\n');
Expand Down
7 changes: 1 addition & 6 deletions Resources/views/Editor/netlistmenu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@
</div>
</div>

<div class="list-group hidden-xs hidden-sm">
<a href="{{ path("netmail") }}" class="list-group-item">{% if netmail_unread is defined %}<span class="badge">{{ netmail_unread }}</span>{% endif %}NETMAIL</a>
{% for group in groups %}
<a href="{{ path('fidonews_group',{'group_id':group.id}) }}" class="list-group-item"><span class="badge">{{ group.cnt }}</span>{{ group.name }}</a>
{% endfor %}
</div>
{% include 'FTNWBundle:Editor:grouplistmenu.html.twig' %}
1 change: 1 addition & 0 deletions Resources/views/Editor/netmail-buttons.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div class="btn-group" role="group" aria-label="...">
{% if nav.prev %}<a href="{{ path('netmail_message',{'netmail_id':nav.prev}) }}" type="button" class="btn btn-primary btn-md">&larr;</a>{% endif %}
<a href="{{ path("netmail_post") }}" type="button" class="btn btn-primary btn-md"><span class="glyphicon glyphicon-plus"></span> New</a>
<a href="{{ path("netmail_email") }}" type="button" class="btn btn-primary btn-md"><span class="glyphicon glyphicon-envelope"></span> Email</a>
{% if message %}<a href="{{ path('netmail_reply',{'id':message.m_id}) }}" type="button" class="btn btn-primary btn-md"><span class="glyphicon glyphicon-share-alt"></span> Reply</a>{% endif %}
{% if nav.next %}<a href="{{ path('netmail_message',{'netmail_id':nav.next}) }}" type="button" class="btn btn-primary btn-md">&rarr;</a>{% endif %}
</div>
8 changes: 8 additions & 0 deletions Resources/views/Layout/main.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>

<script type="text/javascript">
$(function(){
$('#echoFullList').on('shown.bs.collapse', function () {
$('#echoListMoreButton').html('Спрятать <span class="glyphicon glyphicon-chevron-up"></span>');
})
$('#echoFullList').on('hidden.bs.collapse', function () {
$('#echoListMoreButton').html('Еще <span class="glyphicon glyphicon-chevron-down"></span>');
})
});
</script>
{% endblock %}
</body>
Expand Down

0 comments on commit 9829627

Please sign in to comment.