Commit 42b3d3c7 authored by Sanyam Khurana's avatar Sanyam Khurana

chrore(*): Add banner for inviting-contributors

Inviting contributors

See merge request new-contributor-wizard-team/new-contributor-wizard!10
parents e2667d2e 1e8dec40
v0.0.1
## July 20 2018
- Adding additional block in Tools and Tutorials menu to invite contributors by providing link to the project repository. (Shashank Kumar - realslimshanky)
## July 12 2018
- Adding Encryption Tutorials module (Shashank Kumar - realslimshanky)
......
......@@ -3,10 +3,19 @@ Root Kivy Application
'''
from kivy.app import App
from kivy.config import Config
from kivy.factory import Factory
from kivy.uix.boxlayout import BoxLayout
from settings import get_db_connection, installing_kivy_garden_package
class InvitingContributors(BoxLayout):
'''
InvitingContributors class has been imported from main.kv to display a block
which invites new contributors to the project
'''
class NewContributorWizard(App):
'''
Declaration of Root Kivy App which contains Root Widget
......@@ -24,6 +33,7 @@ class NewContributorWizard(App):
'''
self.root.clear_widgets()
self.root.add_widget(Dashboard())
Factory.register('InvitingContributors', cls=InvitingContributors)
if __name__ == '__main__':
......
......@@ -4,8 +4,9 @@ Modules containing Tools classes for Encryption
import json
from importlib import import_module
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.boxlayout import BoxLayout
Builder.load_file('./ui/encryption/tools.kv')
......@@ -71,6 +72,8 @@ class Tools(BoxLayout):
self.ids['tools_menu'].add_widget(tool_box_widget)
self.import_tool_modules(key)
self.ids['tools_menu'].add_widget(Factory.InvitingContributors())
def import_tool_modules(self, tool_to_import):
'''
import_tool_modules try to import tool_to_import named module and also
......
......@@ -4,8 +4,9 @@ Modules containing Tutorials classes for Encryption
import os
import json
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.boxlayout import BoxLayout
from modules.parser import tutorial_parser
......@@ -72,6 +73,8 @@ class Tutorials(BoxLayout):
tutorial_box_widget.ids['tutorial_box_difficulty'].text = t_d
self.ids['tutorials_menu'].add_widget(tutorial_box_widget)
self.ids['tutorials_menu'].add_widget(Factory.InvitingContributors())
@staticmethod
def get_tutorial_modules(tutorial_to_import):
'''
......
......@@ -28,3 +28,32 @@ BoxLayout
font_size: dp(50)
padding_x: dp(10)
halign: 'left'
# To be imported inside Tools or Tutorials of any module
<InvitingContributors>
orientation: 'vertical'
padding: (20, 20, 20, 20)
size_hint_y: None
height: 150
canvas.before:
Color
rgba: 0, 0, 0, 1
RoundedRectangle
pos: self.pos
size: self.size
Label
id: inviting_contributors_box_title
text_size: self.width, None
size: self.texture_size
text: 'You can contribute Tools or Tutorials for this application by visting [ref=https://salsa.debian.org/new-contributor-wizard-team/new-contributor-wizard][color=0000ff]New Contributor Wizard[/color][/ref]\'s repository'
markup: True
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 20
line_height: 1
color: 1, 1, 1, 1
halign: 'justify'
valign: 'top'
on_ref_press:
import webbrowser
webbrowser.open(args[1])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment