From 792d54b4faedf5f162d4de4f25df562aa56e892a Mon Sep 17 00:00:00 2001 From: okhin Date: Thu, 2 Feb 2017 19:00:21 +0100 Subject: [PATCH] Fixing the home page --- app/Main.php | 3 -- templates/base.html | 1 - templates/contact.html | 21 +++++++---- templates/contactslist.html | 74 ++++++++++++++++++++++++++++++------- templates/footer.html | 5 --- templates/header.html | 41 +++++++++++++++++++- templates/home.html | 66 +++++++++++++++++++++++++++------ 7 files changed, 166 insertions(+), 45 deletions(-) diff --git a/app/Main.php b/app/Main.php index b3f9840..2aa7bfa 100644 --- a/app/Main.php +++ b/app/Main.php @@ -14,7 +14,6 @@ class Main extends Controller { function home($f3,$args) { // Select a random contact //TODO: use weight for random - $rand_id = rand(0, count($f3->get('contacts'))-1); $contacts = $f3->get('contacts'); $groups = Api::get_groups(); @@ -23,7 +22,6 @@ class Main extends Controller { $group_types = Api::get_group_types(); $f3->set('group_types', $group_types); - $f3->set('contact', $contacts[$rand_id]); $f3->set('block_content', 'home.html'); } @@ -108,7 +106,6 @@ class Main extends Controller { function contactslist($f3, $args) { $contacts = Api::get_contacts(); $f3->set('contacts', $contacts); - $f3->set('random', 2); $f3->set('block_content', 'contactslist.html'); } diff --git a/templates/base.html b/templates/base.html index dc81c09..e965a7b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,4 +1,3 @@ - diff --git a/templates/contact.html b/templates/contact.html index a4cee32..750910d 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -8,13 +8,19 @@ {{ @contact.first_name }} {{ @contact.last_name }} + +
    {{ @group_type.name }} -
    - - {{ @group.type }} - - {{ @group.name }} -
    + +
  • + + {{ @group.type }} + + {{ @group.name }} +
  • +
    +
    +
@@ -26,7 +32,7 @@

{{ _("If you want to call for free, you must provide us with your phone number (the PiPhone will call that number to initiate the communication).") }}

-
> +
@@ -39,7 +45,6 @@
diff --git a/templates/contactslist.html b/templates/contactslist.html index 7fec512..ded9735 100644 --- a/templates/contactslist.html +++ b/templates/contactslist.html @@ -1,18 +1,64 @@ -
-
-
-
-

{{ @campaign.title }}

-

{{ @campaign.description }}

+
+
    +
-
-
+ -
- -
+
  • + /static/img/placeholder.jpg{{ @contact.photo }}" class="circle"> + {{ @contact.last_name }} {{ @contact.full_name }} +
      + +
    • {{ @group.name }}
    • +
      +
    +
  • -
    + +
    -
    + diff --git a/templates/footer.html b/templates/footer.html index 79fbc42..308b1d0 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,7 +1,2 @@ - diff --git a/templates/header.html b/templates/header.html index b682a02..9349c87 100644 --- a/templates/header.html +++ b/templates/header.html @@ -9,10 +9,47 @@ - - +
    +
    +
    +
    +

    {{ @campaign.title}}

    +
    +
    +
    +

    + {{ @campaign.description }} +

    + {{ _("Act Now!") }} +
    +
    + + + +

    + {{ @organization.name }} +

    +

    + {{ @organization.description }} +

    + {{ _("Visit Us!") }} +
    +
    +
    +
    + +
    +
    diff --git a/templates/home.html b/templates/home.html index a3d0b95..a88557a 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,15 +1,57 @@ -
    -
    -
    -
    -

    {{ @campaign.title }}

    -

    {{ @campaign.description }}

    +
    +
    +
    +

    + {{ _("Call a representative and make your voice heard!") }} +

    + +
    +
    + +
    + + John Doe + + +
      {{ @group_type.name }} +
    • + Group +
    • +
    +
    +
    +
    + John Doe + close + +
    {{ _("Call for free") }}
    +
    + +

    {{ _("If you want to call for free, you must provide us with your phone number + (the PiPhone will call that number to initiate the communication).") }}

    +
    + + +
    +

    + {{ _('Starting with your country code, without the initial 0') }} +

    + +
    +
    + +
    +
    -
    -
    - -
    -
    -
    + +
    -- GitLab