Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

Commit

Permalink
loksabha view #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikas Yadav committed Sep 30, 2017
1 parent e86a5e0 commit 8e066d4
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 17 deletions.
Binary file modified protected/messages/hi/messages.mo
Binary file not shown.
133 changes: 121 additions & 12 deletions protected/messages/hi/messages.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Kono\n"
"POT-Creation-Date: 2017-09-28 22:41+0530\n"
"PO-Revision-Date: 2017-09-28 22:46+0530\n"
"POT-Creation-Date: 2017-09-30 12:14+0530\n"
"PO-Revision-Date: 2017-09-30 12:14+0530\n"
"Last-Translator: Vikas Yadav <[email protected]>\n"
"Language-Team: Vikas\n"
"Language: hi\n"
Expand Down Expand Up @@ -144,17 +144,17 @@ msgstr "ईमेल पता"

#: models/ContactForm.php:52
msgid "Subject"
msgstr ""
msgstr "विषय"

#: models/ContactForm.php:53
msgid "Body"
msgstr ""
msgstr "तन"

#: models/Election.php:70
msgid "Election ID"
msgstr "चुनाव आईडी"

#: models/Election.php:71 models/LokSabha2014.php:95 views/site/_address.php:40
#: models/Election.php:71 models/LokSabha2014.php:95 views/site/_address.php:49
#: views/site/report.php:76
msgid "State"
msgstr "स"
Expand Down Expand Up @@ -399,19 +399,19 @@ msgstr "सेंट कोड"
msgid "District"
msgstr " ज़िला"

#: views/site/_address.php:44
#: views/site/_address.php:62
msgid "Country"
msgstr "देश"

#: views/site/_address.php:48
#: views/site/_address.php:66
msgid "Latitude"
msgstr "अक्षांश"

#: views/site/_address.php:52
#: views/site/_address.php:70
msgid "Longitude"
msgstr "रेखांश"

#: views/site/_address.php:56
#: views/site/_address.php:74
msgid "Altitude"
msgstr "ऊंचाई"

Expand Down Expand Up @@ -465,9 +465,7 @@ msgstr "हमसे संपर्क करें"
msgid ""
"If you have business inquiries or other questions, please fill out the following form to "
"contact us. Thank you."
msgstr ""
"यदि आपके पास व्यावसायिक पूछताछ या अन्य प्रश्न हैं, तो कृपया हमसे संपर्क करने के लिए निम्न फ़ॉर्म भरें। "
"धन्यवाद।"
msgstr "यदि आपके पास व्यावसायिक पूछताछ या अन्य प्रश्न हैं, तो कृपया हमसे संपर्क करने के लिए निम्न फ़ॉर्म भरें। धन्यवाद।"

#: views/site/contact.php:36 views/site/login.php:25
msgid "Fields with {star} are required."
Expand Down Expand Up @@ -517,3 +515,114 @@ msgstr "विधायक"
#: views/site/report.php:119
msgid "Picture"
msgstr "तस्वीर"

#: views/state/district.php:51
msgid "{distname} District, {state}"
msgstr "{distname} जिला, {राज्य}"

#: views/state/district.php:64
msgid "Legislative Assemblies"
msgstr "विधान सभाएं"

#: views/state/district.php:79
#, fuzzy
#| msgid "Town"
msgid "Towns"
msgstr "कस्बा"

#: views/state/district.php:89
msgid "Cantonment Board"
msgstr "छावनी बोर्ड"

#: views/state/district.php:90 views/state/district.php:91
msgid "City Municipal Council"
msgstr "सिटी नगर परिषद"

#: views/state/district.php:92 views/state/district.php:93
msgid "Gram Panchayat"
msgstr "ग्राम पंचायत"

#: views/state/district.php:94
msgid "Industrial Notified Area"
msgstr "औद्योगिक अधिसूचित क्षेत्र"

#: views/state/district.php:95 views/state/district.php:96
msgid "Industrial Township"
msgstr "औद्योगिक टाउनशिप"

#: views/state/district.php:97 views/state/district.php:98
msgid "Municipality"
msgstr "नगरपालिका"

#: views/state/district.php:99 views/state/district.php:100
msgid "Municipal Board"
msgstr "नगर निगम"

#: views/state/district.php:101 views/state/district.php:102
#, fuzzy
#| msgid "Committee"
msgid "Municipal Committee"
msgstr "समिति"

#: views/state/district.php:103
msgid "mci"
msgstr "एमसीआई"

#: views/state/district.php:104
msgid "mci+og"
msgstr "एमसीआई + ओग"

#: views/state/district.php:105 views/state/district.php:106
msgid "Municipal Council"
msgstr "नगर पालिका परिषद"

#: views/state/district.php:107 views/state/district.php:108
msgid "Municipal Corporation"
msgstr "नगर निगम"

#: views/state/district.php:109 views/state/district.php:110
msgid "Notified Area"
msgstr "अधिसूचित क्षेत्र"

#: views/state/district.php:111 views/state/district.php:112
msgid "Notified Area Committee"
msgstr "अधिसूचित क्षेत्र समिति"

#: views/state/district.php:113 views/state/district.php:114
msgid "Nagar Parishad"
msgstr "नगर परिषद"

#: views/state/district.php:115 views/state/district.php:116
msgid "Nagar Palika Parishad"
msgstr "नगर पालिका परिषद"

#: views/state/district.php:117
msgid "Notified Town"
msgstr "अधिसूचित टाउन"

#: views/state/district.php:118
#, fuzzy
#| msgid "Committee"
msgid "Small Town Committee"
msgstr "समिति"

#: views/state/district.php:119
#, fuzzy
#| msgid "Committee"
msgid "Town Committee"
msgstr "समिति"

#: views/state/district.php:120 views/state/district.php:121
msgid "Town Municipal Council"
msgstr "नगर नगर परिषद"

#: views/state/district.php:122 views/state/district.php:123
msgid "Town Panchayat"
msgstr "नगर पंचायत"

#: views/state/view.php:50
#, fuzzy
#| msgid "District"
msgid "Districts"
msgstr " ज़िला"

72 changes: 69 additions & 3 deletions protected/urlrules/StateUrlRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,41 @@ public function handle_state_assembly($manager, $route, $params, $ampersand)
return $this->prefix . $lang . '/' . $url_path . '/' . $qs;
}

public function handle_state_loksabha($manager, $route, $params, $ampersand)
{
$qs = '';

if (! isset ( $params ['lang'] ))
{
$lang = $this->lang;
}
else
{
$lang = $params ['lang'];
unset ( $params ['lang'] );
}

if (! isset ( $params ['id'] ))
return false;

$id= $params ['id'];
unset ( $params ['id'] );

$obj = Constituency::model ()->cache ( Yii::app ()->params ['data_cache_duration'] )->findByPk($id);

if (count ( $params ))
{
$qs = "?" . http_build_query ( $params );
}

if (isset ( $obj ))
$url_path = 'loksabha/' . $obj->slug;
else
return false;

return $this->prefix . $lang . '/' . $url_path . '/' . $qs;
}

public function handle_state_town($manager, $route, $params, $ampersand)
{
$url_path = $qs = '';
Expand Down Expand Up @@ -298,6 +333,9 @@ public function parse_district($manager, $request, $pathInfo, $rawPathInfo)
{
$dtslug = $matches['dtslug'];
$stateslug = $matches ['stateslug'];
if($stateslug == 'loksabha')
return false;

$stateobj = State::model ()->cache ( Yii::app ()->params ['data_cache_duration'] )->find (
'slug=:cc',
array (
Expand All @@ -324,9 +362,7 @@ public function parse_assembly($manager, $request, $pathInfo, $rawPathInfo)
if (preg_match ( '/^(?<lang>\w\w)\/(?<stateslug>[\w-]*)\/assembly\/(?<amlyslug>[\w-]*)\/?$/', $pathInfo, $matches ))
{
if (isset ( $matches ['stateslug'] ) && isset ( $matches ['amlyslug'] ))
{
print_r($matches);

{
$amlyslug = $matches['amlyslug'];
$stateslug = $matches ['stateslug'];
$obj = Constituency::model ()->cache ( Yii::app ()->params ['data_cache_duration'] )->with ( [
Expand Down Expand Up @@ -354,4 +390,34 @@ public function parse_assembly($manager, $request, $pathInfo, $rawPathInfo)
}
return false;
}

public function parse_loksabha($manager, $request, $pathInfo, $rawPathInfo)
{
if (preg_match ( '/^(?<lang>\w\w)\/loksabha\/(?<amlyslug>[\w-]*)\/?$/', $pathInfo,
$matches ))
{
if ( isset ( $matches ['amlyslug'] ))
{
$amlyslug = $matches ['amlyslug'];
$obj = Constituency::model ()->cache ( Yii::app ()->params ['data_cache_duration'] )->find (
[
'condition' => 't.slug=:cc and ctype=:ctype',
'params' => [
':ctype' => 'PARL',
':cc' => $amlyslug
]
] );

if (isset ( $obj ))
{
$_GET ['id_consti'] = $obj->id_consti;
$_GET ['lang'] = $matches ['lang'];
return $this->prefix2 . "state/loksabha";
}
else
return false;
}
}
return false;
}
}
3 changes: 2 additions & 1 deletion protected/views/site/_assembly.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<?php
if(!empty($data->picture))
echo CHtml::image('/images/pics/' . $data->picture,$data->name,['class' => 'picture amly']);

?>
<h2 class="acname"><?=__('{acname} Assembly Constituency - #{acno}',['{acname}' => strtolower($poly->AC_NAME),'{acno}' => $data->acno])?></h2>
<h2 class="acname"><?= CHtml::link(__('{acname} Assembly Constituency - #{acno}',['{acname}' => strtolower($poly->AC_NAME),'{acno}' => $data->acno]),['state/assembly','acno' => $data->acno,'id_state' => $poly->id_state])?></h2>

<?php

Expand Down
4 changes: 3 additions & 1 deletion protected/views/site/_lowerhouse.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php
/* @var $this SiteController */
/* @var $data Array */

$consti = Constituency::model()->findByAttributes(['name' => strtolower($poly->pc_name_clean)]);
?>

<div class="view lsmp">
<h2 class="acname"><?=__('{pcname} Lok Sabha Constituency',['{pcname}' => strtolower($poly->pc_name_clean)])?></h2>
<h2 class="acname"><?= CHtml::link(__('{pcname} Lok Sabha Constituency',['{pcname}' => strtolower($poly->pc_name_clean)]),['state/loksabha','id' => $consti->id_consti])?></h2>

<?php
$this->widget ( 'zii.widgets.CDetailView',
Expand Down
30 changes: 30 additions & 0 deletions protected/views/state/district.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,36 @@
<h1 class="acname"><?= strtolower(__('{distname} District, {state}',['{distname}' => $model->name,'{state}' => $model->state->name])) ?></h1>

<?php
$poly = AssemblyPolygon::model ()->findAll (
[
'select' => 'pcno,pc_name_clean',
'group' => 'pcno,pc_name_clean',
'condition' => 'dist_name=:dist and id_state=:state',
'params' => [
'state' => $model->id_state,
'dist' => $model->dt_name
]
] );

echo '<h2>' . __ ( 'Lok Sabha Parliamentary Constituency' ) . '</h2>';

echo '<ol>';
foreach ( $poly as $ac )
{
if(empty($ac->pc_name_clean))
continue;

$attrs= ['name' => $ac->pc_name_clean,'ctype' => 'PARL','id_state' => $model->id_state];
$consti = Constituency::model()->findByAttributes($attrs);
echo CHtml::tag ( 'li', [ ],
CHtml::link ( $consti->name,
[
'state/loksabha',
'id' => $consti->id_consti
] ) );
}
echo '</ol>';

$poly = AssemblyPolygon::model ()->findAll (
[
'condition' => 'dist_name=:dist and id_state=:state and polytype=:ptype',
Expand Down

0 comments on commit 8e066d4

Please sign in to comment.