{% load i18n static cosinnus_tags widget_tweaks facebook_integration_tags %} {% with is_fb_connected=request.user.cosinnus_profile.get_facebook_user_id %} {% if not is_fb_connected %}

{% trans "You need to connect your user account to Facebook before you can link this group/project!" %} {% trans "You can do this here" context "a link to click on"%}

{% endif %}

{% trans "Connect a Facebook Group" %}

{% blocktrans with site_name=COSINNUS_CURRENT_PORTAL.site.name %}You can connect your projects and groups to a Facebook Group. Once connected, your members can choose to share the news posts they write on {{ site_name }} to the Facebook Group. (They need to connect their accounts to Facebook, as well!){% endblocktrans%}

{% trans "Please be aware that users can only post to your Group if they would also be permitted post in it on Facebook!" %}

{# Facebook group id Field #} {% trans "Facebook Group to link to" as fb_id_label %} {% captureas fb_gid_html %} {% captureas fb_id_placeholder %}{% trans "Group Id or name (example: 1172392116092353)" %}{% endcaptureas %} {% if is_fb_connected %} {% render_field form.forms.obj.facebook_group_id class+="form-control" placeholder=fb_id_placeholder %} {% else %} {% render_field form.forms.obj.facebook_group_id class+="form-control" disabled="true" placeholder=fb_id_placeholder %} {% endif %} {% endcaptureas %} {% include 'cosinnus/fields/default_field.html' with field=form.forms.obj.facebook_group_id field_html=fb_gid_html label=fb_id_label %}

{% trans "Connect a Facebook Fan-Page" %}

{% blocktrans with site_name=COSINNUS_CURRENT_PORTAL.site.name %}You can connect your projects and groups to a Facebook Fan-Page. Once connected, you can publish the posts you write on {{ site_name }} directly on that Fan-Page, if you are one of its administrators on Facebook.{% endblocktrans%}

{% trans "All other members of your project/group can publish their posts as visitor's posts on the Fan-Page. (They need to connect their accounts to Facebook, as well!)" %}

{% trans "If you wish for other members to be able to post directly to the Fan-Page, you can make them co-administrators of your project/group (and you must make them Editors of the Fan-Page on Facebook!). They will be asked to confirm their Editor access of the Fan-Page, and then will be able to publish to it." %}

{# Facebook group id Field #} {% trans "Facebook Fan-Page link to" as fb_page_label %} {% captureas fb_page_html %} {% captureas fb_page_placeholder %}{% trans "Fan-Page unique name (example: myfanpage)" %}{% endcaptureas %} {% if is_fb_connected %} {% render_field form.forms.obj.facebook_page_id class+="form-control" placeholder=fb_page_placeholder %}
{% else %} {% render_field form.forms.obj.facebook_page_id class+="form-control" disabled="true" placeholder=fb_page_placeholder %} {% endif %} {% endcaptureas %} {% include 'cosinnus/fields/default_field.html' with field=form.forms.obj.facebook_page_id field_html=fb_page_html label=fb_page_label %} {% if group.facebook_page_id and is_fb_connected %} {% if user|user_has_group_fb_page_access:group %}

{% trans "You have Editor access to this Fan-Page and can publish your posts directly to it." %}

{% else %}

{% trans "Editor access of your Facebook-account for this Fan-Page has not been confirmed. This is required before you can publish your posts in the voice of the Fan-Page!" %}

{% endif %}

{% endif %} {% if is_fb_connected %} {% endif %} {% endwith %}