diff options
-rw-r--r-- | app/config/services.yml | 6 | ||||
-rw-r--r-- | config/deploy.rb | 45 | ||||
-rw-r--r-- | config/deploy/staging.rb | 62 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 23 |
6 files changed, 32 insertions, 108 deletions
diff --git a/app/config/services.yml b/app/config/services.yml index a7fa9bfe..965bc319 100644 --- a/app/config/services.yml +++ b/app/config/services.yml | |||
@@ -17,3 +17,9 @@ services: | |||
17 | class: Twig_Extensions_Extension_Text | 17 | class: Twig_Extensions_Extension_Text |
18 | tags: | 18 | tags: |
19 | - { name: twig.extension } | 19 | - { name: twig.extension } |
20 | |||
21 | wallabag.twig_extension: | ||
22 | class: Wallabag\CoreBundle\Twig\WallabagExtension | ||
23 | public: false | ||
24 | tags: | ||
25 | - { name: twig.extension } | ||
diff --git a/config/deploy.rb b/config/deploy.rb index 67eb0c9c..be18ce5a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb | |||
@@ -16,51 +16,8 @@ set :log_level, :info | |||
16 | set :composer_install_flags, '--no-dev --prefer-dist --no-interaction --optimize-autoloader' | 16 | set :composer_install_flags, '--no-dev --prefer-dist --no-interaction --optimize-autoloader' |
17 | 17 | ||
18 | set :linked_files, %w{app/config/parameters.yml} | 18 | set :linked_files, %w{app/config/parameters.yml} |
19 | set :linked_dirs, %w{app/logs web/uploads} | 19 | set :linked_dirs, %w{app/logs web/uploads data} |
20 | 20 | ||
21 | set :keep_releases, 3 | 21 | set :keep_releases, 3 |
22 | 22 | ||
23 | after 'deploy:finishing', 'deploy:cleanup' | 23 | after 'deploy:finishing', 'deploy:cleanup' |
24 | |||
25 | # Default branch is :master | ||
26 | # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp | ||
27 | |||
28 | # Default deploy_to directory is /var/www/my_app_name | ||
29 | # set :deploy_to, '/var/www/my_app_name' | ||
30 | |||
31 | # Default value for :scm is :git | ||
32 | # set :scm, :git | ||
33 | |||
34 | # Default value for :format is :pretty | ||
35 | # set :format, :pretty | ||
36 | |||
37 | # Default value for :log_level is :debug | ||
38 | # set :log_level, :debug | ||
39 | |||
40 | # Default value for :pty is false | ||
41 | # set :pty, true | ||
42 | |||
43 | # Default value for :linked_files is [] | ||
44 | # set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml') | ||
45 | |||
46 | # Default value for linked_dirs is [] | ||
47 | # set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system') | ||
48 | |||
49 | # Default value for default_env is {} | ||
50 | # set :default_env, { path: "/opt/ruby/bin:$PATH" } | ||
51 | |||
52 | # Default value for keep_releases is 5 | ||
53 | # set :keep_releases, 5 | ||
54 | |||
55 | namespace :deploy do | ||
56 | |||
57 | after :restart, :clear_cache do | ||
58 | on roles(:web), in: :groups, limit: 3, wait: 10 do | ||
59 | # Here we can do anything such as: | ||
60 | # within release_path do | ||
61 | # execute :rake, 'cache:clear' | ||
62 | # end | ||
63 | end | ||
64 | end | ||
65 | |||
66 | end | ||
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb index 76e23bb7..d67d7247 100644 --- a/config/deploy/staging.rb +++ b/config/deploy/staging.rb | |||
@@ -1,64 +1,2 @@ | |||
1 | # server-based syntax | ||
2 | # ====================== | ||
3 | # Defines a single server with a list of roles and multiple properties. | ||
4 | # You can define all roles on a single server, or split them: | ||
5 | |||
6 | set :branch, 'v2' | 1 | set :branch, 'v2' |
7 | set :deploy_to, '/var/www/' | 2 | set :deploy_to, '/var/www/' |
8 | |||
9 | # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value | ||
10 | # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value | ||
11 | # server 'db.example.com', user: 'deploy', roles: %w{db} | ||
12 | |||
13 | |||
14 | |||
15 | # role-based syntax | ||
16 | # ================== | ||
17 | |||
18 | # Defines a role with one or multiple servers. The primary server in each | ||
19 | # group is considered to be the first unless any hosts have the primary | ||
20 | # property set. Specify the username and a domain or IP for the server. | ||
21 | # Don't use `:all`, it's a meta role. | ||
22 | |||
23 | # role :app, %w{deploy@example.com}, my_property: :my_value | ||
24 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value | ||
25 | # role :db, %w{deploy@example.com} | ||
26 | |||
27 | |||
28 | |||
29 | # Configuration | ||
30 | # ============= | ||
31 | # You can set any configuration variable like in config/deploy.rb | ||
32 | # These variables are then only loaded and set in this stage. | ||
33 | # For available Capistrano configuration variables see the documentation page. | ||
34 | # http://capistranorb.com/documentation/getting-started/configuration/ | ||
35 | # Feel free to add new variables to customise your setup. | ||
36 | |||
37 | |||
38 | |||
39 | # Custom SSH Options | ||
40 | # ================== | ||
41 | # You may pass any option but keep in mind that net/ssh understands a | ||
42 | # limited set of options, consult the Net::SSH documentation. | ||
43 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start | ||
44 | # | ||
45 | # Global options | ||
46 | # -------------- | ||
47 | # set :ssh_options, { | ||
48 | # keys: %w(/home/rlisowski/.ssh/id_rsa), | ||
49 | # forward_agent: false, | ||
50 | # auth_methods: %w(password) | ||
51 | # } | ||
52 | # | ||
53 | # The server-based syntax can be used to override options: | ||
54 | # ------------------------------------ | ||
55 | # server 'example.com', | ||
56 | # user: 'user_name', | ||
57 | # roles: %w{web app}, | ||
58 | # ssh_options: { | ||
59 | # user: 'user_name', # overrides user setting above | ||
60 | # keys: %w(/home/user_name/.ssh/id_rsa), | ||
61 | # forward_agent: false, | ||
62 | # auth_methods: %w(publickey password) | ||
63 | # # password: 'please use keys' | ||
64 | # } | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig index 08f3fe60..abbcb389 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig | |||
@@ -36,7 +36,7 @@ | |||
36 | <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> | 36 | <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> |
37 | <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li> | 37 | <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li> |
38 | <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li> | 38 | <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li> |
39 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName }}</span></a></li> | 39 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName|removeWww }}</span></a></li> |
40 | </ul> | 40 | </ul> |
41 | {% if entry.previewPicture is null %} | 41 | {% if entry.previewPicture is null %} |
42 | <p>{{ entry.content|striptags|slice(0, 300) }}…</p> | 42 | <p>{{ entry.content|striptags|slice(0, 300) }}…</p> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index dcdf7c09..ff69e821 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig | |||
@@ -76,7 +76,7 @@ | |||
76 | {% endif %} | 76 | {% endif %} |
77 | 77 | ||
78 | <div class="card-action"> | 78 | <div class="card-action"> |
79 | <span class="bold"><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %}: {{ entry.title|e }} - {{ entry.domainName }}" class="tool original grey-text"><span>{{ entry.domainName | truncate(18) }}</span></a></bold> | 79 | <span class="bold"><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %}: {{ entry.title|e }} - {{ entry.domainName|removeWww }}" class="tool original grey-text"><span>{{ entry.domainName|removeWww|truncate(18) }}</span></a></bold> |
80 | 80 | ||
81 | <ul class="tools links right"> | 81 | <ul class="tools links right"> |
82 | <li> | 82 | <li> |
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php new file mode 100644 index 00000000..f8328860 --- /dev/null +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php | |||
@@ -0,0 +1,23 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Twig; | ||
4 | |||
5 | class WallabagExtension extends \Twig_Extension | ||
6 | { | ||
7 | public function getFilters() | ||
8 | { | ||
9 | return array( | ||
10 | new \Twig_SimpleFilter('removeWww', array($this, 'removeWww')), | ||
11 | ); | ||
12 | } | ||
13 | |||
14 | public function removeWww($url) | ||
15 | { | ||
16 | return preg_replace('/^www\./i', '',$url); | ||
17 | } | ||
18 | |||
19 | public function getName() | ||
20 | { | ||
21 | return 'wallabag_extension'; | ||
22 | } | ||
23 | } | ||