Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

[Frontend] Share Buttons #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

On a regular development Ubuntu Apache2-PHP5-MySQL server

* edit app/config/parameters.yml.default and save as parameters.yml
# curl -sS https://getcomposer.org/installer | php
# php composer.phar install
# sudo apt-get install php-apc
# php app/console doctrine:schema:create
# sudo apache2ctl restart
# chmod 777 app/logs/
# chmod 777 app/cache/

* edit app/config/config.yml and add cache : false to the twig configuration

For optimal result, create a VirtualHost pointing to job-board/web
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<table class="table table-hover">

<table class="table table-hover table-striped">
<thead>
<tr>
<th class="span6 text-left">Title</th>
Expand Down
97 changes: 70 additions & 27 deletions src/AmsterdamPHP/JobBundle/Resources/views/Job/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@
{% block body -%}
<div class="row-fluid">
<section id="details" class="span8 pull-left" xmlns="http://www.w3.org/1999/html">
<div class="pull-right">
<a class="btn btn-primary contact-recruiter" href="mailto:{{ entity.user.email }}?subject={{entity.title}}">
<i class="icon-comment icon-large"></i> Contact poster
</a>
</div>

{% if is_granted('OWNER', entity) or is_granted('ROLE_ADMIN') %}
<div class="owner actions pull-right">
<form id="formDelete" method="post" action="{{ path('job_delete', {'id':entity.id}) }}" class="">
<div class="btn-group">
<a class="btn btn-small" href="{{ path('job_edit', {'id':entity.id}) }}"> <i class="icon-edit icon-large"></i> Edit</a>
<a href="javascript:void(0)" onclick="$('#formDelete').submit()" class="btn btn-small btn-danger"><i class="icon-trash icon-large"></i> Delete</a>
</div>
</form>
</div>
{% endif %}

<h2>{{ entity.title }}</h2>
<h4>
Expand Down Expand Up @@ -51,46 +57,59 @@
</dl>

<div class="pull-right">
<a class="btn btn-primary contact-recruiter" href="mailto:{{ entity.user.email }}?subject={{entity.title}}">
<i class="icon-comment icon-large"></i> Contact poster
</a>
<p class="text-right">
<small><a href="{{ path('job_handle_report', { 'id': entity.id }) }}"><i class="icon-warning-sign"></i> Report abuse</a></small>
</p>
</div>
</section>

<section id="poster" class="span4 pull-right">
{% if is_granted('OWNER', entity) or is_granted('ROLE_ADMIN') %}
<div class="owner actions">
<a class="btn " href="{{ path('job_edit', {'id':entity.id}) }}"> <i class="icon-edit icon-large"></i> Edit</a>
<form method="post" action="{{ path('job_delete', {'id':entity.id}) }}" class="">
<button type="submit" class="btn btn-danger"><i class="icon-trash icon-large"></i> Delete</button>
</form>
</div>
{% endif %}

<h2>Poster Info</h2>
<div class="vcard">
<div class="userActions">

<a class="btn btn-inverse btn-block" href="mailto:{{ entity.user.email }}?subject={{entity.title}}">
<i class="icon-envelope"></i> Apply by Email
</a>

<a class="btn btn-info btn-block" href="mailto:{{ entity.user.email }}?subject={{entity.title}}">
<i class="icon-linkedin-sign"></i> Apply with LinkedIn
</a>

<p>Share:
<a href="javascript:void(0)" onclick="shareFB()"><i class="icon-facebook-sign icon-large"></i></a>
<a href="javascript:void(0)" onclick="shareTwitter()"><i class="icon-twitter-sign icon-large"></i></a>
<a href="javascript:void(0)" onclick="shareGPlus()"><i class="icon-google-plus-sign icon-large"></i></a>
<a href="javascript:void(0)" onclick="shareLinkedIn()"><i class="icon-linkedin-sign icon-large"></i></a>
</p>
</div>

<hr>

<div class="media">

<div class="pull-left span3">
{% if entity.user.companyLogo %}
<a href="{{ entity.user.companyUrl }}">
<img class="photo" src="{{ entity.user.companyLogo }}" />
<img class="media-object img-rounded" src="{{ entity.user.companyLogo }}" />
</a>
{% else %}
<img class="photo" src="{{ gravatar(entity.user.email) }}" />
<img class="media-object img-rounded" src="{{ gravatar(entity.user.email) }}" />
{% endif %}

<ul>
<li class="company">Company name: <strong>{{ entity.user.companyName }}</strong></li>
<li class="name">Contact name: {{ entity.user.name }}</li>
</ul>
</div>
<div class="media-body">
<h4 class="media-heading">{{ entity.user.companyName }}</h4>
<p>Contact: {{ entity.user.name }}</p>
</div>
<p class="clearfix"></p>
</div>

<div>
<blockquote>
{{ entity.user.companyBio }}
</div>
</blockquote>

</section>
</div>

{% endblock %}

{% block javascripts %}
Expand All @@ -108,5 +127,29 @@
<script type="text/javascript">
var jobRating = new JobRating();
jobRating.init();

function shareFB() {
var sharer = "https://www.facebook.com/sharer/sharer.php?u=";
window.open(sharer + location.href, 'sharer', 'width=626,height=436');
}

function shareTwitter() {
var sharer = 'https://twitter.com/share';
var params = '?url=' + location.href + '&via=amsterdamphp&text=' + '{{ entity.title }}' + '&hashtags=php,jobs';
window.open(sharer + params, 'sharer', 'width=550,height=450');
}

function shareGPlus() {
var sharer = 'https://plus.google.com/share';
var params = '?url=' + location.href;
window.open(sharer + params, 'sharer', 'width=550,height=450');
}

function shareLinkedIn() {
var sharer = 'http://www.linkedin.com/shareArticle';
var params = '?mini=true&url=' + location.href + '&title=' + '{{ entity.title }}' + '&source=AmsterdamPHP' ;
window.open(sharer + params, 'sharer', 'width=520,height=570');
}
</script>

{% endblock %}
10 changes: 10 additions & 0 deletions web/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.