#85 REMOVING OF DUPLICATE (SEND ME HAPPINESS NOW ) BUTTON
Closed 5 years ago by jflory7. Opened 5 years ago by feisal.
Unknown source fix-duplicate-buttons  into  master

@@ -9,7 +9,8 @@

  # For clean_pyc to work without complaining

  BASE_DIR = PROJECT_DIR

  

- DEBUG = False

+ # DEBUG = False

+ DEBUG = True

  

  ADMINS = (

      ('Anna Philips', 'algogator@fedoraproject.org'),
@@ -69,8 +70,22 @@

      'django.middleware.common.CommonMiddleware',

      'django.middleware.csrf.CsrfViewMiddleware',

      'django.contrib.messages.middleware.MessageMiddleware',

+     'debug_toolbar.panels.versions.VersionsPanel' , 'debug_toolbar.panels.timer.TimerPanel' ,

+         'debug_toolbar.panels.settings.SettingsPanel' , 'debug_toolbar.panels.headers.HeadersPanel' ,

+         'debug_toolbar.panels.request.RequestPanel' , 'debug_toolbar.panels.sql.SQLPanel' ,

+         'debug_toolbar.panels.staticfiles.StaticFilesPanel' , 'debug_toolbar.panels.templates.TemplatesPanel' ,

+         'debug_toolbar.panels.cache.CachePanel' , 'debug_toolbar.panels.signals.SignalsPanel' ,

+         'debug_toolbar.panels.logging.LoggingPanel' , 'debug_toolbar.panels.redirects.RedirectsPanel'

  ]

  

+ 

+ """

+ function to get the django debug toolbar

+ """

+ def show_toolbar(request):

+     return True

+ 

+ DEBUG_TOOLBAR_CONFIG={'INTERCEPT_REDIRECT': False , 'SHOW_TOOLBAR_CALLBACK': show_toolbar , }

  ROOT_URLCONF = 'happinesspackets.urls'

  

  # Python dotted path to the WSGI application used by Django's runserver.

@@ -18,7 +18,7 @@

  EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" 

  

  

- SECRET_KEY = 'only-for-testing'

+ SECRET_KEY =  '*_8(8jk-1j&m-zy1p9*giy%$x9ngyr_!s_=g3o-mdcz@h!-x9m'

  

  INTERNAL_IPS = ('127.0.0.1',)

  
@@ -47,6 +47,12 @@

  INSTALLED_APPS += (

      'debug_toolbar',

  )

+ MIDDLEWARE_CLASSES+=['debug_toolbar.middleware.DebugToolbarMiddleware' , ]

+ 

+ # DEBUG TOOLBAR SETTINGS:

+ 

+ 

+ 

  

  SELENIUM_SCREENSHOT_DIR = PROJECT_DIR.child('selenium-screenshots')

  

file modified
+9 -1
@@ -4,14 +4,22 @@

  from django.conf import settings

  from django.conf.urls import include, url

  from django.contrib import admin

+ from django.conf.urls.static import static

  

  urlpatterns = [

      url(r'^oidc/', include('mozilla_django_oidc.urls')),

      url(r'^', include('happinesspackets.messaging.urls', namespace="messaging")),

  ]

- 

+ # refactor django toolbar conflict

+ """

+ dispalying the django debug toolbar

+ """

  if settings.ADMIN_ENABLED or settings.DEBUG:

      urlpatterns.append(url(r'^drunken-octo-lama/', include(admin.site.urls)))

+     if settings:

+         import debug_toolbar

+     

+         urlpatterns+=[url( '__debug__/' , include( debug_toolbar.urls ) ) , ]

  

  if settings.DEBUG:

      urlpatterns.append(url(r'^media/(?P<path>.*)$', django.views.static.serve, {'document_root': settings.MEDIA_ROOT}))

file modified
+8 -1
@@ -20,7 +20,14 @@

  # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks

  # if running multiple sites in the same mod_wsgi process. To fix this, use

  # mod_wsgi daemon mode with each site in its own daemon process, or use

- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "happinesspackets.settings")

+ """

+     you can change this os settings to whatever setting file you want to work

+     note: now the setting is for development only

+     hint: change to os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.prod" )/

+     when in production

+     hint: do the same also manage.py file

+     """

+ os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.dev" )

  

  # This application object is used by any WSGI server configured to use this

  # file. This includes Django's development server, if the WSGI_APPLICATION

file modified
+8 -1
@@ -3,7 +3,14 @@

  import sys

  

  if __name__ == "__main__":

-     os.environ.setdefault("DJANGO_SETTINGS_MODULE", "happinesspackets.settings")

+     """

+     you can change this os settings to whatever setting file you want to work

+     note: now the setting is for development only

+     hint: change to os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.prod" )/

+     when in production

+     """

+     os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.dev" )

+     

  

      from django.core.management import execute_from_command_line

  

@@ -19,10 +19,6 @@

          trying to spread that feeling.

      </p>

  

-     <p class="text-center">

-         <a class="btn btn-primary btn-lg btn-responsive" href="{% url 'messaging:send' %}" role="button">Send some happiness now! <img class="emoji" src="static/images/emoji/loveletter.png" alt="💌" title="Love letter" aria-label="Emoji: Love letter"></a>

-     </p>

- 

      <h2>How does it work?</h2>

      <p>

          Openly expressing appreciation, gratitude, or happiness to other people can be difficult. This is especially

Removed one of the duplicate of send me happiness buttons. this change would prettify the user interface giving the user the needed experience to use the webapp. While the two had urls, one of them was lacking logic behind which the url can return the request needed hence the removal.

@jonatoni kindly review it. am still working on other issues related to the emails being not sent. Kindly if you have questions about this PR. You can contact me through my email feisalibrahim19@gmail.com

Hi @feisal, there is some discussion in #72 about this topic (see here). This change should be sent to the upstream project. More details are in the soon-to-be-published contributor guidelines.

Metadata Update from @jflory7:
- Pull-request tagged with: type - frontend
- Request assigned

5 years ago

Metadata Update from @jflory7:
- Pull-request tagged with: type - summer coding

5 years ago

Pull-Request has been closed by jflory7

5 years ago

@jflory7 ok.Kindly assign the issue to me and i will be able to work on it better